Core.
Any shared memory implementation has to provide a singleton Core. Its full qualified name is tarch::multicore::Core. If no shared memory variant is switched on, Peano provides a default Core implementation that does nothing.
If you don't configure the core explicitly, it will try to use some meaningful default.
- See also
- configure()
- Author
- Tobias Weinzierl
Definition at line 50 of file Core.h.
Configure the whole node, i.e.
all cores available on a node. If numberOfThreads equals the default, the routine will use the hardware concurrency to determine the number of threads that should be used. On SLURM-based HPC platforms, this will be wrong if multiple MPI ranks are placed on one node. It is also a bad choice if hyperthreading should not/can not be used. Use the helper function getNumberOfUnmaskedThreads().
- Parameters
-
| numberOfThreads | Number of threads that shall be used. This parameter either is greater than zero (which defines the number of threads) or it equals DefaultNumberOfThreads which means that the code should use the default number of threads. |
References UseDefaultNumberOfThreads.
| void tarch::multicore::Core::yield |
( |
| ) |
|
Wrapper around backend-specific yield.
For most backends, this should not really be a yield(). It should interrupt the current task, not the current thread, and tell the runtime to continue with another task.
Besides the yield, we should process pending fused tasks.
| int tarch::multicore::Core::UseDefaultNumberOfThreads = 0 |
|
staticconstexpr |
The default is what the system management typically gives you.
So if you run four ranks on a 24 core node, then each MPI rank will get 6 threads if you choose this constant.
Multiply with two to exploit hyperthreading.
Definition at line 69 of file Core.h.
Referenced by configure().