Commit 41f3fa0c authored by Paal Kvamme's avatar Paal Kvamme
Browse files

Support the ancient 2002 OpenMP version that Microsoft uses.

parent 4624fcb9
......@@ -53,6 +53,16 @@
#undef HAVE_GETOPT
#endif
/*
* OpenMP note:
* Most of the Linux configs I am currently building have OpenMP 2015.11.
* Ubuntu Xenial is stuck at 2013.07, as is devtoolset-4 that I use when
* building SDAPI for CentOS 7. The latest Windows compilers use 2002.03.
* Linux check: g++ -fopenmp -dM -E -x c++ - < /dev/null | grep _OPENMP
* The call omp_set_max_active_levels was introduced in 3.0 (2008.05).
* There may be other problems with using the ancient Windows version.
*/
using InternalZGY::SummaryPrintingTimerEx;
using InternalZGY::SimpleTimerEx;
using InternalZGY::Environment;
......@@ -849,7 +859,11 @@ copy(const Options& opt, SummaryPrintingTimerEx& rtimer, SummaryPrintingTimerEx&
// and for that reason refuse to parallelize the upload to cloud. Or maybe
// OpenZGY is smart enough to see the "ordered" clause and understand that
// this part can be further parallelized?
#if _OPENMP >= 200805
omp_set_max_active_levels(2);
#else
omp_set_nested(true);
#endif
#pragma omp parallel num_threads(opt.threads) if (opt.threads > 1)
{
if (opt.verbose >= 3 && omp_get_thread_num() == 0)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment