HWRF  trunk@4391
Functions | Variables
produtil.mpi_impl.mpiexec Namespace Reference

Adds MPICH or MVAPICH2 support to produtil.run. More...

Detailed Description

Adds MPICH or MVAPICH2 support to produtil.run.

This module is part of the mpi_impl package – see produtil.mpi_impl for details. This implements the Hydra MPI wrapper and MPICH MPI implementation with Intel OpenMP, but may work for other MPI implementations that use the "mpiexec" command and OpenMP implementations that use the KMP_NUM_THREADS or OMP_NUM_THREADS environment variables.

Warning
This module assumes the TOTAL_TASKS environment variable is set to the maximum number of MPI ranks the program has available to it. That is used when the mpirunner is called with the allranks=True option.

Functions

def runsync
 Runs the "sync" command as an exe(). More...
 
def openmp (arg, threads)
 Adds OpenMP support to the provided object. More...
 
def detect ()
 Detects whether the MPICH mpi implementation is available by looking for the mpiexec program in $PATH. More...
 
def can_run_mpi ()
 Does this module represent an MPI implementation? Returns True. More...
 
def make_bigexe (exe, kwargs)
 Returns an ImmutableRunner that will run the specified program. More...
 
def mpirunner (arg, allranks=False, kwargs)
 Turns a produtil.mpiprog.MPIRanksBase tree into a produtil.prog.Runner. More...
 

Variables

tuple mpiexec_path = produtil.fileop.find_exe('mpiexec',raise_missing=False)
 Path to the mpiexec program.
 
tuple module_logger = logging.getLogger('lsf_cray_intel')
 

Function Documentation

def produtil.mpi_impl.mpiexec.can_run_mpi ( )

Does this module represent an MPI implementation? Returns True.

Definition at line 54 of file mpiexec.py.

def produtil.mpi_impl.mpiexec.detect ( )

Detects whether the MPICH mpi implementation is available by looking for the mpiexec program in $PATH.

Definition at line 49 of file mpiexec.py.

def produtil.mpi_impl.mpiexec.make_bigexe (   exe,
  kwargs 
)

Returns an ImmutableRunner that will run the specified program.

Returns
an empty list
Parameters
exeThe executable to run on compute nodes.
kwargsIgnored.

Definition at line 58 of file mpiexec.py.

def produtil.mpi_impl.mpiexec.mpirunner (   arg,
  allranks = False,
  kwargs 
)

Turns a produtil.mpiprog.MPIRanksBase tree into a produtil.prog.Runner.

Parameters
arga tree of produtil.mpiprog.MPIRanksBase objects
allranksif True, and only one rank is requested by arg, then all MPI ranks will be used
kwargspassed to produtil.mpi_impl.mpi_impl_base.CMDFGen when mpiserial is in use.
Returns
a produtil.prog.Runner that will run the selected MPI program
Warning
Assumes the TOTAL_TASKS environment variable is set if allranks=True

Definition at line 65 of file mpiexec.py.

def produtil.mpi_impl.mpiexec.openmp (   arg,
  threads 
)

Adds OpenMP support to the provided object.

Parameters
argAn produtil.prog.Runner or produtil.mpiprog.MPIRanksBase object tree
threadsthe number of threads, or threads per rank, an integer

Definition at line 34 of file mpiexec.py.

def produtil.mpi_impl.mpiexec.runsync (   logger = None)

Runs the "sync" command as an exe().

Definition at line 26 of file mpiexec.py.