8.4. TRun
The TRun sub-classes deals with the use of computer resources. Three modes are available:
TSequentialRun: evaluations are computed sequentially on a single computer core.TThreadedRun: evaluations are computed using the computer multi-core resources. It uses the pthread library with the shared memory paradigm. Using this runner prevents from using some assessor, as one should take care of memory conflict.TMpiRun: evaluations are computed using a network of computers (usually multi-core) It uses the message passing interface (MPI) library with a distributed memory paradigm.
If you run on a single node, you can use MPI or threads. MPI parallelisation is more expensive, but more generic (no thread safe problem).
Warning
Disregarding the chosen solution to distribute the computation as long as it is parallelised (meaning
whether one is choosing thread or MPI) the number of allocated ressources (in the constructor or
specify to the mpirun command) should always be strickly greater than 1. CPU number 1 will always
be the “master” that is dealing with the distribution to its “slaves” and the gathering of all
results.
The runner class hierarchy is smaller than the assessor one, as can be seen in
Figure 8.3. It starts with the TRun class, which is a pure virtual one in which
few methods are given along with an integer to describe the number of CPUs.
Figure 8.3 Hierarchy of classes and structures for the runner part of the
Relauncher module.