25 #ifndef GEOSX_COMMON_TIMINGMACROS_HPP_ 26 #define GEOSX_COMMON_TIMINGMACROS_HPP_ 31 #ifdef GEOSX_USE_CALIPER 32 #include <caliper/cali.h> 37 namespace timingHelpers
39 inline std::string stripPF(
char const * prettyFunction )
42 std::string::size_type
const end = input.find_first_of(
'(' );
43 std::string::size_type
const beg = input.find_last_of(
' ', end)+1;
44 return input.substr( beg, end-beg );
49 #define GEOSX_MARK_SCOPE(name) cali::Function __cali_ann##__LINE__(STRINGIZE_NX(name)) 52 #define GEOSX_MARK_FUNCTION cali::Function __cali_ann##__func__(timingHelpers::stripPF(__PRETTY_FUNCTION__).c_str()) 55 #define GEOSX_MARK_BEGIN(name) CALI_MARK_BEGIN(STRINGIZE(name)) 58 #define GEOSX_MARK_END(name) CALI_MARK_END(STRINGIZE(name)) 61 #define GEOSX_MARK_FUNCTION_BEGIN CALI_MARK_FUNCTION_BEGIN 64 #define GEOSX_MARK_FUNCTION_END CALI_MARK_FUNCTION_END 66 #else // GEOSX_USE_CALIPER 69 #define GEOSX_MARK_SCOPE(name) 70 #define GEOSX_MARK_FUNCTION_SCOPED 71 #define GEOSX_MARK_FUNCTION 73 #define GEOSX_MARK_BEGIN(name) 74 #define GEOSX_MARK_END(name) 76 #define GEOSX_MARK_FUNCTION_BEGIN 77 #define GEOSX_MARK_FUNCTION_END 80 #endif // GEOSX_USE_CALIPER 83 #ifdef GEOSX_USE_TIMERS 84 #define GEOSX_GET_TIME( time ) \ 89 gettimeofday(&tim, nullptr); \ 90 time = tim.tv_sec + (tim.tv_usec / 1000000.0); \ 93 #define GEOSX_GET_TIME( time ) 96 #endif // GEOSX_COMMON_TIMINGMACROS_HPP_
std::string string
String type.