disable optimization of cputime function for MSVC++ to avoid bogus 0s reports

This commit is contained in:
Axel Kohlmeyer
2021-10-02 17:29:05 -04:00
parent 2dcaa47b0e
commit c6bdab8b4c

View File

@ -112,6 +112,8 @@ using namespace LAMMPS_NS;
// clang compilers are optimizing this function too aggressively returning always 0 // clang compilers are optimizing this function too aggressively returning always 0
#if defined(__clang__) #if defined(__clang__)
[[clang::optnone]] [[clang::optnone]]
#elif defined(_MSC_VER)
#pragma optimize("",off)
#endif #endif
double platform::cputime() double platform::cputime()
// clang-format on // clang-format on
@ -143,6 +145,9 @@ double platform::cputime()
return rv; return rv;
} }
#if defined(_MSC_VER)
#pragma optimize("",on)
#endif
/* ---------------------------------------------------------------------- /* ----------------------------------------------------------------------
get wall time get wall time