To activate OpenMP you have to set the corresponding environment variable (see 3.6) before calling the configure script like
This will insert the corresponding compiler switch (e.g.
-mp,...confer the following sections) into the compiler calls in the
makefile (see Sect. 3.6).
The calls to the timing routines that would be executed in parallel are removed by (not) setting the appropriate compiler macros (see Sect. 3.7).
In addition, the switch
rhd_shortrad_dir_l02 (see 3.7)
might be set, according to experience about performance enhancements.
The user has to find optimum values for the parameters
n_hydcellsperchunk (for the Roe solver module,
see Sect. 5.3.7)
n_viscellsperchunk (for the tensor viscosity module,
see Sect. 5.3.8)
to optimize the size of the chunk given to one thread per time.
So far, only for the SHORTrad module the enironment variable
can be set (before running CO5BOLD) to
control its OpenMP scheduling behaviour.
Important parallel loops in the SHORTrad module have a
modifier that allows this external control.
The old default is achieved by not defining the variable or by setting
On some machines (e.g. Intel Xeon with Linux and PGI compiler) a dynamic scheduling activated with
is advantageous. The size of the individual chunks might be set to larger values
than 1 (in the examples above).
The optimal value has to be found empirically. A good starting point
gives for a model with grid points on a 4-processor machine
The behaviour of the other modules is not affected.
The number of threads should equal the number of available
processors and has to be set at run-time with the environment variable