#include <BLMPI.hh>
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 |
static void BLMPI::mainRankZero | ( | ) | [static, private] |
static void BLMPI::mainRankNonZero | ( | ) | [static, private] |
void BLMPI::init | ( | int * | argc, | |
char *** | argv | |||
) | [static] |
bool BLMPI::isMPI | ( | ) | [static] |
bool BLMPI::isRank0 | ( | ) | [static] |
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.
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().
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] |