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

Source Code for Script script-xalt_find_exec_openmpi_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   
 26  from __future__             import print_function 
 27  import os, re, sys 
 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  from xalt_parse_mpirun_args import find_exec 
 31   
 32  ignoreT = { 
 33    'env'              : True, 
 34    'time'             : True, 
 35  } 
 36   
 37  argT = { 
 38    '-am'                       : 1, 
 39    '--app'                     : 1, 
 40    '-c'                        : 1, 
 41    '-n'                        : 1, 
 42    '-np'                       : 1, 
 43    '-cf'                       : 1,   
 44    '--cartofile'               : 1, 
 45    '-cpus-per-proc'            : 1, 
 46    '--cpus-per-proc'           : 1, 
 47    '-cpus-per-rank'            : 1, 
 48    '--cpus-per-rank'           : 1, 
 49    '-H'                        : 1, 
 50    '-host'                     : 1, 
 51    '--host'                    : 1, 
 52    '-launch-agent'             : 1, 
 53    '--launch-agent'            : 1, 
 54    '-machinefile'              : 1, 
 55    '--machinefile'             : 1, 
 56    '-mca'                      : 2, 
 57    '--mca'                     : 2, 
 58    '-nperboard'                : 1, 
 59    '--nperboard'               : 1, 
 60    '-npernode'                 : 1, 
 61    '--npernode'                : 1, 
 62    '-npersocket'               : 1, 
 63    '--npersocket'              : 1, 
 64    '-num-boards'               : 1, 
 65    '--num-boards'              : 1, 
 66    '-num-cores'                : 1, 
 67    '--num-cores'               : 1, 
 68    '-num-socket'               : 1, 
 69    '--num-socket'              : 1, 
 70    '-ompi-server'              : 1, 
 71    '--ompi-server'             : 1, 
 72    '-output-filename'          : 1, 
 73    '--output-filename'         : 1, 
 74    '-path'                     : 1, 
 75    '--path'                    : 1, 
 76    '--prefix'                  : 1, 
 77    '--preload-files'           : 1,      
 78    '--preload-files-dest-dir'  : 1, 
 79    '-report-events'            : 1,      
 80    '--report-events'           : 1,      
 81    '-report-pid'               : 1,      
 82    '--report-pid'              : 1,      
 83    '-report-uri'               : 1,      
 84    '--report-uri'              : 1,      
 85    '-rf'                       : 1,      
 86    '--rankfile'                : 1,      
 87    '-server-wait-time'         : 1, 
 88    '--server-wait-time'        : 1, 
 89    '-slot-list'                : 1, 
 90    '--slot-list'               : 1, 
 91    '-stdin'                    : 1, 
 92    '--stdin'                   : 1, 
 93    '-stride'                   : 1, 
 94    '--stride'                  : 1, 
 95    '-tmpdir'                   : 1, 
 96    '--tmpdir'                  : 1, 
 97    '-wd'                       : 1, 
 98    '--wd'                      : 1, 
 99    '-wdir'                     : 1, 
100    '--wdir'                    : 1, 
101    '-xml'                      : 1, 
102    '--xml'                     : 1, 
103    '-xml-file'                 : 1, 
104    '--xml-file'                : 1, 
105    '-xterm'                    : 1, 
106    '--xterm'                   : 1, 
107  } 
108   
109 -def main():
110 """ 111 Find name of executable when using openmpi 112 """ 113 print(find_exec(ignoreT, argT, None, sys.argv[1:], dot=True))
114 115 if ( __name__ == '__main__'): main() 116