Ignore:
Timestamp:
10/18/19 14:30:54 (5 years ago)
Author:
ymipsl
Message:

Improve timer and tracing functionnalities

YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_ym/XIOS_ONE_SIDED/src/tracer.cpp

    r1657 r1750  
    2525  std::map<std::string,int> regionId ; 
    2626  int count=0 ; 
     27  bool traceIsOn=true ; 
     28  int stackOnOffdeep=0 ; 
    2729   
    2830  void traceOn(void) 
    2931  { 
     32    stackOnOffdeep-- ; 
     33    if (stackOnOffdeep!=0) return ; 
     34    traceIsOn=true;  
     35 
    3036#if defined(VTRACE) 
    3137    VT_ON() ; 
     
    3945  void traceOff(void)  
    4046  { 
     47    stackOnOffdeep++ ; 
     48    if (stackOnOffdeep!=1) return ; 
     49    traceIsOn=false;  
    4150#if defined(VTRACE) 
    4251    VT_OFF() ; 
     
    5160  { 
    5261#if defined(VTRACE) 
    53     VT_USER_START(name.c_str()) ; 
     62     
     63    if (traceIsOn) VT_USER_START(name.c_str()) ; 
    5464#elif defined(SCOREP) 
    5565    SCOREP_USER_REGION_BY_NAME_BEGIN(name.c_str(),SCOREP_USER_REGION_TYPE_COMMON) 
     
    7686  { 
    7787#if defined (VTRACE) 
    78     VT_USER_END(name.c_str()) ; 
     88    if (traceIsOn) VT_USER_END(name.c_str()) ; 
    7989#elif defined(SCOREP) 
    8090    SCOREP_USER_REGION_BY_NAME_END(name.c_str()) 
Note: See TracChangeset for help on using the changeset viewer.