PeleLM
PeleLM copied to clipboard
Unable to compile with OpenMP
Hi, I was trying to compile FlameSheet with USE_OMP = True
but got the following error while compling AMReX_FABUTIL_2D.F
Compiling AMReX_FABUTIL_2D.F ...
In file included from /home/amrex/Src/Base/AMReX_REAL.H:4,
from /home/amrex/Src/Extern/amrdata/AMReX_FABUTIL_2D.F:9:
tmp_build_dir/s/2d.gnu.OMP.EXE/AMReX_Config.H:57:2: error: #error libamrex was built with OpenMP
57 | #error libamrex was built with OpenMP
| ^~~~~
Any leads on what might be causing this? I was able to the compile and run the case using with mpi. Thanks!
Try USE_OMP=TRUE
Hi!
The same error persists with USE_OMP=TRUE
as well.
I was mucking about and noticed the following:
Lines 56-58 of the config file AMReX_Config.H
read:
#if defined(AMREX_USE_OMP) && !defined(_OPENMP)
#error libamrex was built with OpenMP
#endif
The variable AMREX_USE_OMP
is defined at line 6 in AMReX_Config.H
but there is no definition of _OPENMP
.
I tried the very dumb thing of simply commenting out the lines
print("#if defined(AMREX_USE_OMP) && !defined(_OPENMP)")
print('#error libamrex was built with OpenMP')
print("#endif")
in the amrex/Tools/libamrex/mkconfig.py
script. This got rid of the compilation error but when running the executable I got a segfault:
~/PeleLM/Exec/RegTests/FlameSheet$ ./PeleLM2d.gnu.OMP.ex inputs.2d-regt
OMP initialized with 4 OMP threads
AMReX (21.10-34-gbe5294eefb20-dirty) initialized
Successfully read inputs file ...
Creating ReactorBase instance: ReactorCvode
free(): double free detected in tcache 2
SIGABRT
Segfault
Segmentation fault (core dumped)
I'm guessing there is possibly some issue in the OpenMP directives somewhere.
It looks like an issue down in PelePhysics. I'll try that to reproduce the issue and fix that.