BLMPI Class Reference

#include <BLMPI.hh>

List of all members.


Detailed Description

class BLMPI implements MPI interface for parallelization.

BLMPI handles G4beamline-specific MPI stuff.

NOTE: No other class should call any MPI functions directly. This implies that the only include <mpi.h> should be in BLMPI.cc.

NOTE: When running in MPI mode, threads are not permitted.

When running under MPI, all BLNTuples are physically written only by the rank-0 instance; MPI is used by all other instances to send messages to rank-0 to create BLNTuple-s and to append rows to BLNTuple-s.

This entire class is static.

Static Public Member Functions

static void init (int *argc, char ***argv)
 init() will check whether or not we are running under MPI, and will initialize MPI if so. MUST be called before any other BLMPI routine. NOTE: for all but rank-0, sets stdout to /dev/null (stderr remains connected for all ranks, so G4Exception will be seen).
static bool isMPI ()
 isMPI() returns true if in MPI mode.
static bool isRank0 ()
 isRank0() returns false in non-MPI mode, and returns true if this node is rank 0 in MPI.
static bool isRank1 ()
 isRank1() returns true in non-MPI mode, and returns true if this node is rank 1 in MPI. Used for Traces and other things that should happen once per simulation, not once per node.
static void main ()
 main will perform the computation in MPI mode. In non-MPI mode this is a no-op that returns immediately. In MPI mode this determines the collective/serial mode and then performs the computation, never returning.

Static Private Member Functions

static void mainRankZero ()
static void mainRankNonZero ()

Static Private Attributes

static int rank = 1
static int nodes = 0
static int nComplete = 0
static double startupTime = 0.0
static double startupWaitTime = 0.0
static double computeTime = 0.0
static double computeWaitTime = 0.0


Member Function Documentation

static void BLMPI::mainRankZero (  )  [static, private]

static void BLMPI::mainRankNonZero (  )  [static, private]

void BLMPI::init ( int *  argc,
char ***  argv 
) [static]

init() will check whether or not we are running under MPI, and will initialize MPI if so. MUST be called before any other BLMPI routine. NOTE: for all but rank-0, sets stdout to /dev/null (stderr remains connected for all ranks, so G4Exception will be seen).

Referenced by main().

00674 {
00675 }

bool BLMPI::isMPI (  )  [static]

isMPI() returns true if in MPI mode.

Referenced by main(), and BLManager::Notify().

00678 {
00679         return false;
00680 }

bool BLMPI::isRank0 (  )  [static]

isRank0() returns false in non-MPI mode, and returns true if this node is rank 0 in MPI.

00683 {
00684         return false;
00685 }

bool BLMPI::isRank1 (  )  [static]

isRank1() returns true in non-MPI mode, and returns true if this node is rank 1 in MPI. Used for Traces and other things that should happen once per simulation, not once per node.

00688 {
00689         return true;
00690 }

void BLMPI::main (  )  [static]

main will perform the computation in MPI mode. In non-MPI mode this is a no-op that returns immediately. In MPI mode this determines the collective/serial mode and then performs the computation, never returning.

Referenced by main().

00693 {
00694 }


Member Data Documentation

int BLMPI::rank = 1 [static, private]

int BLMPI::nodes = 0 [static, private]

int BLMPI::nComplete = 0 [static, private]

double BLMPI::startupTime = 0.0 [static, private]

double BLMPI::startupWaitTime = 0.0 [static, private]

double BLMPI::computeTime = 0.0 [static, private]

double BLMPI::computeWaitTime = 0.0 [static, private]


The documentation for this class was generated from the following files:
g4beamline