Skip to content

Drop option --enable-openmp

Sergey Kosukhin requested to merge drop-openmp into master

MTIME does not use OpenMP. The --enable-openmp option was introduced as a portable workaround for Intel compiler, which would apply aggressive optimizations breaking use-cases of the library in multi-threaded applications. Building the library with the OpenMP flag (-fopenmp/-qopenmp) slightly reduces the optimization level and makes it usable within OpenMP-enabled user applications. More precise but less portable (across different compilers) alternatives to the OpenMP flag are -auto, -recursive or other flags that force the compiler to allocate variables in the stack storage area.

Declaring the problematic subprograms of the Fortran API as RECURSIVE is yet another way to address the issue, which seems to be less counter-intuitive (i.e. it is fair to assume that the project makes use of OpenMP when its configure script has the --enable-openmp option, which is, however, not the case for MTIME). This MR implements exactly that for all subprograms of the API, which seems to be doing the job (see extended tests with ICON here).

Edited by Sergey Kosukhin

Merge request reports