Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Unable to compile with OpenMP #199

Open
jAnirudh opened this issue Oct 17, 2021 · 3 comments
Open

Unable to compile with OpenMP #199

jAnirudh opened this issue Oct 17, 2021 · 3 comments

Comments

@jAnirudh
Copy link

jAnirudh commented Oct 17, 2021

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!

@drummerdoc
Copy link
Contributor

Try USE_OMP=TRUE

@jAnirudh
Copy link
Author

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.

@esclapez
Copy link
Contributor

It looks like an issue down in PelePhysics. I'll try that to reproduce the issue and fix that.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants