HWRF  trunk@4391
Public Member Functions | List of all members
produtil.mpiprog.MPISerial Class Reference

Represents a single rank of an MPI program that is actually running a serial program. More...

Detailed Description

Represents a single rank of an MPI program that is actually running a serial program.

This is supported directly by some MPI implementations while others require kludges to work properly.

Definition at line 604 of file mpiprog.py.

Inheritance diagram for produtil.mpiprog.MPISerial:
produtil.mpiprog.MPIRank produtil.mpiprog.MPIRanksBase

Public Member Functions

def __init__
 MPISerial constructor. More...
 
def make_runners_immutable (self)
 Creates a version of self with a produtil.prog.ImmutableRunner child. More...
 
def copy (self)
 Duplicates self. More...
 
def __repr__ (self)
 Returns a pythonic string representation of self for debugging. More...
 
def args (self)
 Iterates over command arguments of the child serial program. More...
 
def get_logger (self)
 Returns my logging.Logger that I use for log messages. More...
 
def validate (self)
 Does nothing. More...
 
def __eq__ (self, other)
 Returns True if other is an MPISerial with the same Runner, False otherwise. More...
 
def check_serial (self)
 Returns (True,False) because this is a serial program (True,) and not a parallel program (,False). More...
 
def isplainexe (self)
 Returns True if the child serial program is a plain executable, False otherwise. More...
 
def to_shell (self)
 Returns a POSIX sh version of the child serial program. More...
 
- Public Member Functions inherited from produtil.mpiprog.MPIRank
def __init__
 MPIRank constructor. More...
 
def getthreads (self)
 Returns the number of threads requested by this MPI rank, or by each MPI rank in this group of MPI ranks. More...
 
def setthreads (self, nthreads)
 Sets the number of threads requested by each MPI rank within this group of MPI ranks. More...
 
def delthreads (self)
 Removes the request for threads. More...
 
def to_shell (self)
 Return a POSIX sh representation of this MPI rank, if possible. More...
 
def __getitem__ (self, args)
 Adds arguments to this MPI rank's program. More...
 
def __repr__ (self)
 Returns a Pythonic representation of this object for debugging. More...
 
def get_logger (self)
 Returns a logging.Logger for this object, or None. More...
 
def validate
 Checks to see if this MPIRank is valid, or has errors. More...
 
def args (self)
 Iterates over the executable arguments. More...
 
def copy (self)
 Return a copy of self. More...
 
def nranks (self)
 Returns 1: the number of MPI ranks. More...
 
def ngroups (self)
 Returns 1: the number of groups of identical ranks. More...
 
def ranks (self)
 Yields self once: all MPI ranks. More...
 
def groups
 Yields (self,1): all groups of identical ranks and the number per group. More...
 
def __add__ (self, other)
 Creates an MPIRanksSPMD or MPIRanksMPMD with this MPIRank and the other ranks. More...
 
def __mul__ (self, factor)
 Creates an MPIRanksSPMD with this MPIRank duplicated factor times. More...
 
def __rmul__ (self, factor)
 Creates an MPIRanksSPMD with this MPIRank duplicated factor times. More...
 
def __eq__ (self, other)
 Returns True if this MPIRank is equal to the other object. More...
 
def check_serial (self)
 Returns (False,True): this is a pure parallel program. More...
 
- Public Member Functions inherited from produtil.mpiprog.MPIRanksBase
def to_arglist
 This is the underlying implementation of most of the mpi_impl modules, and hence make_runner as well. More...
 
def make_runners_immutable (self)
 Returns a copy of this object where all child produtil.prog.Runner objects have been replaced with produtil.prog.ImmutableRunner objects. More...
 
def get_logger (self)
 Returns a logger.Logger object for this MPIRanksBase or one from its child MPIRanksBase objects (if it has any). More...
 
def check_serial (self)
 Returns a tuple (s,p) where s=True if there are serial ranks in this part of the MPI program, and p=True if there are parallel ranks. More...
 
def nranks (self)
 Returns the number of ranks in this part of the MPI program. More...
 
def ranks (self)
 Iterates over all MPIRank objects in this part of the MPI program. More...
 
def ngroups (self)
 Returns the number of groups of repeated MPI ranks in the MPI program. More...
 
def groups
 Iterates over all groups of repeating MPI ranks in the MPI program returning tuples (r,c) containing a rank r and the count (number) of that rank c. More...
 
def getthreads (self)
 Returns the number of threads requested by this MPI rank, or by each MPI rank in this group of MPI ranks. More...
 
def setthreads (self, nthreads)
 Sets the number of threads requested by each MPI rank within this group of MPI ranks. More...
 
def delthreads (self)
 Removes the request for threads. More...
 
def __eq__ (self, other)
 Returns True if this part of the MPI program is the same as another part. More...
 
def __mul__ (self, factor)
 Returns a new set of MPI ranks that consist of this group of ranks repeated "factor" times. More...
 
def __rmul__ (self, other)
 Returns a new set of MPI ranks that consist of this group of ranks repeated "factor" times. More...
 
def __add__ (self, other)
 Returns a new set of MPI ranks that consist of this set of ranks with the "other" set appended. More...
 
def __radd__ (self, other)
 Returns a new set of MPI ranks that consist of the "other" set of ranks with this set appended. More...
 
def isplainexe (self)
 Determines if this set of MPI ranks can be represented by a single serial executable with a single set of arguments run without MPI. More...
 
def to_shell (self)
 Returns a POSIX sh command that will execute the serial program, if possible, or raise a subclass of NotValidPosixSh otherwise. More...
 
def expand_iter
 This is a wrapper around ranks() and groups() which will call self.groups() if expand=False. More...
 
def __repr__ (self)
 Returns a string representation of this object intended for debugging. More...
 

Constructor & Destructor Documentation

def produtil.mpiprog.MPISerial.__init__ (   self,
  runner,
  logger = None 
)

MPISerial constructor.

Definition at line 608 of file mpiprog.py.

Member Function Documentation

def produtil.mpiprog.MPISerial.__eq__ (   self,
  other 
)

Returns True if other is an MPISerial with the same Runner, False otherwise.

Parameters
otherthe other object to compare against.

Definition at line 635 of file mpiprog.py.

def produtil.mpiprog.MPISerial.__repr__ (   self)

Returns a pythonic string representation of self for debugging.

Definition at line 621 of file mpiprog.py.

Referenced by produtil.prog.Runner.__str__().

def produtil.mpiprog.MPISerial.args (   self)

Iterates over command arguments of the child serial program.

Definition at line 624 of file mpiprog.py.

def produtil.mpiprog.MPISerial.check_serial (   self)

Returns (True,False) because this is a serial program (True,) and not a parallel program (,False).

Definition at line 640 of file mpiprog.py.

def produtil.mpiprog.MPISerial.copy (   self)

Duplicates self.

Definition at line 618 of file mpiprog.py.

Referenced by produtil.prog.ImmutableRunner.runner().

def produtil.mpiprog.MPISerial.get_logger (   self)

Returns my logging.Logger that I use for log messages.

Definition at line 628 of file mpiprog.py.

def produtil.mpiprog.MPISerial.isplainexe (   self)

Returns True if the child serial program is a plain executable, False otherwise.

See produtil.prog.Runner.isplainexe() for details.

Definition at line 644 of file mpiprog.py.

def produtil.mpiprog.MPISerial.make_runners_immutable (   self)

Creates a version of self with a produtil.prog.ImmutableRunner child.

Definition at line 612 of file mpiprog.py.

def produtil.mpiprog.MPISerial.to_shell (   self)

Returns a POSIX sh version of the child serial program.

Definition at line 649 of file mpiprog.py.

def produtil.mpiprog.MPISerial.validate (   self)

Does nothing.

Definition at line 633 of file mpiprog.py.


The documentation for this class was generated from the following file: