
#include <Parallel.h>
Static Public Member Functions | |
| void | init (int &argc, char **&argv) |
| void | finalize () |
| bool | initialized () |
| bool | finalized () |
| bool | ok () |
| int | getId () |
| int | getMasterId () |
| int | getNum () |
| int | getAvailableId () |
| int | getAvailableNum () |
| bool | isParallel () |
| bool | iAmMaster () |
| bool | iAmSlave () |
| ParallelType | getMode () |
| void | setMode (ParallelType mode) |
| bool | isDynamic () |
| int | getPipeSize () |
| void | setPipeSize (int n) |
| bool | isBarrier () |
| void | setBarrier (bool b) |
| int | getMaxPackages () |
| void | setMaxPackages (int n) |
| void | bcast (Vector3DBlock *coords) |
| void | bcast (int &n) |
| void | distribute (ScalarStructure *energy, Vector3DBlock *coords) |
| void | reduce (ScalarStructure *energy, Vector3DBlock *coords) |
| void | reduceSlaves (Real *begin, Real *end) |
| void | bcastSlaves (Real *begin, Real *end) |
| void | sync () |
| void | syncSlave () |
| unsigned int | getNumberOfPackages (unsigned int n) |
| bool | next () |
| void | resetNext () |
| void | resetNext (const std::vector< int > &blocks) |
Static Public Attributes | |
| const bool | isMPI = false |
Private Types | |
| enum | WorkState { DONE, SEQUENTIAL, STATIC, SLAVE, MASTER } |
Private Member Functions | |
| Parallel () | |
| ~Parallel () | |
| Parallel (const Parallel &) | |
| Parallel & | operator= (const Parallel &) |
Static Private Member Functions | |
| void | kill () |
| Parallel & | instance () |
| bool | ok (const std::string &err) |
| WorkState | getWorkState () |
| void | nextMaster () |
Static Private Attributes | |
| bool | myInitialized = false |
| bool | myFinalized = false |
| int | myId = 0 |
| int | myMasterId = master |
| int | myNum = 1 |
| int | myAvailableId = 0 |
| int | myAvailableNum = 1 |
| bool | myIsParallel = Parallel::isMPI |
| bool | myIAmMaster = true |
| bool | myIAmSlave = true |
| ParallelType | myMode = ParallelType::STATIC |
| WorkState | myWorkState = Parallel::SEQUENTIAL |
| int | myPipeSize = 1 |
| bool | myUseBarrier = false |
| int | myMaxPackages = -1 |
| int * | myBuffer = NULL |
| int | myNext = 0 |
| int | myNextRange [2] = {0,0} |
| std::vector< int > | myDone |
| std::vector< int > | myBlockList |
| int | myRecv |
| int | myI |
| int | myP |
| Parallel * | obj = NULL |
|
|
< Enum specifing the actual working state of the node
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Broadcast a Vector3DBlock from the master to the rest. Handles also the case if the receiving nodes have an emty (other size) Vector3DBlock. |
|
||||||||||||
|
Broadcast over all nodes, exluding the master if running master-slave.
|
|
||||||||||||
|
Does the preprocessing, clearing the energies and forces for all nodes except the master. |
|
|
MPI_Finialize.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns the number of packages over all forces.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||
|
MPI_Init and sets id and number of process.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
true if the actual work package should computed, false skip it
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||
|
Does a reduction and a broadcast, such that all nodes have the correct summed energies and forces locally. |
|
||||||||||||
|
Reduction over all nodes, exluding the master if running master-slave.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Syncronize all nodes.
|
|
|
Syncronize all slaves, exluding the master if running master-slave.
|
|
|
|
|
|
Actual master-slave id, -1 for the master.
|
|
|
Available number of nodes for computation.
|
|
|
List of of the force partitioning.
|
|
|
Bsend buffer.
|
|
|
Master, keeps track of slave have got already their work.
|
|
|
|
|
|
Index of the actual work package (only master).
|
|
|
If this node is master.
|
|
|
If this node is slave/worker.
|
|
|
Actual id of the node, [0,1,...,N-1].
|
|
|
If Parallel is initialized.
|
|
|
If environment has more that 1 node.
|
|
|
Id of the master.
|
|
|
Number of max. packages per node per force.
|
|
|
Parallelization scheme.
|
|
|
Counter of next() calls.
|
|
|
Actual work package to work on [from,to].
|
|
|
Number of nodes, N.
|
|
|
Node number.
|
|
|
Number of add. work packages to push to slaves.
|
|
|
Number of outstanding receives.
|
|
|
Flag to signal usage of MPI_Barrier.
|
|
|
Actual work state.
|
|
|
Instance.
|