HWRF
trunk@4391
|
Generates files with one line per MPI rank, telling what program to run on each rank. More...
Generates files with one line per MPI rank, telling what program to run on each rank.
This class is used to generate command files for mpiserial, poe or mpirun.lsf. Command files are files with one MPI rank per line containing a shell command to run for that rank. Generally the input (lines) is generated by the to_arglist function in a subclass of produtil.mpiprog.MPIRanksBase. See the produtil.mpi_impl.mpirun_lsf for an example of how to use this.
Definition at line 30 of file mpi_impl_base.py.
Public Member Functions | |
def | __init__ (self, base, lines, cmd_envar='SCR_CMDFILE', model_envar=None, filename_arg=False, kwargs) |
CMDFGen constructor. More... | |
def | __call__ |
Adds the environment variables to runner and creates the command file. More... | |
Public Attributes | |
filename | |
command file's filename | |
tmpprefix | |
temporary file prefix | |
tmpsuffix | |
temporary file suffix | |
tmpdir | |
temporary file directory | |
cmd_envar | |
Environment variable to set telling the path to the command file. | |
model_envar | |
Environment variable to set to "MPMD". | |
filename_arg | |
cmdf_contents | |
String containing the command file contents. More... | |
def produtil.mpi_impl.mpi_impl_base.CMDFGen.__init__ | ( | self, | |
base, | |||
lines, | |||
cmd_envar = 'SCR_CMDFILE' , |
|||
model_envar = None , |
|||
filename_arg = False , |
|||
kwargs | |||
) |
CMDFGen constructor.
base | type of command file being generated. See below. |
lines | the command file contents as a list of strings, one per line |
cmd_envar | environment variable to set to the command file path |
model_envar | environment variable to set to "MPMD" |
kwargs | Sets the command file name. See below. |
filename_arg | If True, the name of the command file is appended to the program argument list. |
The command file is generated from tempfile.NamedTemporaryFile, passing several arguments from kwargs, if provided, or suitable defaults otherwise. There are several arguments used. In all cases, replace "base" with the contents of the base
argument:
Definition at line 41 of file mpi_impl_base.py.
def produtil.mpi_impl.mpi_impl_base.CMDFGen.__call__ | ( | self, | |
runner, | |||
logger = None |
|||
) |
Adds the environment variables to runner
and creates the command file.
[out] | runner | A produtil.prog.Runner to modify |
logger | a logging.Logger for log messages |
Definition at line 113 of file mpi_impl_base.py.
produtil.mpi_impl.mpi_impl_base.CMDFGen.cmdf_contents |
String containing the command file contents.
Definition at line 77 of file mpi_impl_base.py.
Referenced by produtil.mpi_impl.mpi_impl_base.CMDFGen.__call__().