Script xalt_find_exec_srun_in_py
[hide private]
[frames] | no frames]

Source Code for Script script-xalt_find_exec_srun_in_py

 1  # -*- python -*- 
 2  # 
 3  # Git Version: @git@ 
 4   
 5  #----------------------------------------------------------------------- 
 6  # XALT: A tool that tracks users jobs and environments on a cluster. 
 7  # Copyright (C) 2013-2014 University of Texas at Austin 
 8  # Copyright (C) 2013-2014 University of Tennessee 
 9  #  
10  # This library is free software; you can redistribute it and/or modify 
11  # it under the terms of the GNU Lesser General Public License as 
12  # published by the Free Software Foundation; either version 2.1 of  
13  # the License, or (at your option) any later version.  
14  # 
15  # This library is distributed in the hope that it will be useful, 
16  # but WITHOUT ANY WARRANTY; without even the implied warranty of 
17  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 
18  # Lesser  General Public License for more details.  
19  # 
20  # You should have received a copy of the GNU Lesser General Public 
21  # License along with this library; if not, write to the Free 
22  # Software Foundation, Inc., 59 Temple Place, Suite 330, 
23  # Boston, MA 02111-1307 USA 
24  #----------------------------------------------------------------------- 
25  from __future__             import print_function 
26  import os, sys 
27   
28  dirNm, execName = os.path.split(os.path.realpath(sys.argv[0])) 
29  sys.path.insert(1,os.path.abspath(os.path.join(dirNm, "../libexec"))) 
30   
31  from xalt_parse_mpirun_args import find_exec 
32   
33  ignoreT = { 
34  } 
35   
36  # srun args that take one option in the form "-arg option" 
37  argT = { 
38    '-A'                        : 1, 
39    '-c'                        : 1, 
40    '-d'                        : 1, 
41    '-D'                        : 1, 
42    '-e'                        : 1, 
43    '-i'                        : 1, 
44    '-J'                        : 1, 
45    '-L'                        : 1, 
46    '-m'                        : 1, 
47    '-n'                        : 1, 
48    '-N'                        : 1, 
49    '-o'                        : 1, 
50    '-p'                        : 1, 
51    '-r'                        : 1, 
52    '-T'                        : 1, 
53    '-t'                        : 1, 
54    '-W'                        : 1, 
55    '-C'                        : 1, 
56    '-w'                        : 1, 
57    '-x'                        : 1, 
58    '-B'                        : 1, 
59  } 
60   
61   
62 -def main():
63 """ 64 Find name of executable when using srun. 65 """ 66 67 print(find_exec(ignoreT, argT, "-c", sys.argv[1:]))
68 69 if ( __name__ == '__main__'): main() 70