OPM / opm-simulators

Simulator programs and utilities for automatic differentiation.
http://www.opm-project.org
GNU General Public License v3.0
111 stars 121 forks source link

unknown-pragmas compiler warnings #1511

Open andlaus opened 6 years ago

andlaus commented 6 years ago

when compiling the legacy simulators without openMP compiler flags, GCC produces quite a few warnings:

> make
[...]
[ 71%] Building CXX object CMakeFiles/flow_sequential.dir/examples/flow_sequential.cpp.o
In file included from /home/and/src/opm-simulators/opm/autodiff/BlackoilModelBase.hpp:580:0,
                 from /home/and/src/opm-simulators/opm/autodiff/BlackoilModel.hpp:26,
                 from /home/and/src/opm-simulators/opm/autodiff/SimulatorBase.hpp:32,
                 from /home/and/src/opm-simulators/opm/autodiff/SimulatorSequentialBlackoil.hpp:24,
                 from /home/and/src/opm-simulators/examples/flow_sequential.cpp:26:
/home/and/src/opm-simulators/opm/autodiff/BlackoilModelBase_impl.hpp:872:0: warning: ignoring #pragma omp parallel [-Wunknown-pragmas]
 #pragma omp parallel for schedule(static)
andlaus commented 6 years ago

actually this does not only apply for the legacy simulators themselves but also for some legacy source files that are part of libopmsimulators.

atgeirr commented 6 years ago

I think these are long-ignored experiments, and the OpenMP usage there should be removed. (Not sure why I have not seen the warning, I thought it was because I disabled the -Wunknown-pragmas, but I do not...)

I think that disabling that warning when compiling without OpenMP is the only reasonable thing to do though.

Edit: I think the flow-legacy parts should be removed (it's on my list to do), but there are other, fairly well tested parts where it has been used successfully, in opm-upscaling.