Ignore:
Timestamp:
05/15/19 17:19:08 (5 years ago)
Author:
yushan
Message:

MARK: branch merged with trunk @1660. Test (test_complete, test_remap) on ADA with IntelMPI and _usingEP/_usingMPI as switch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_trunk_omp/src/tracer.cpp

    r501 r1661  
    11#include "tracer.hpp" 
    2 #ifdef VTRACE 
     2 
     3#if defined(VTRACE) 
     4 
    35#include <vt_user.h> 
     6 
     7#elif defined(SCOREP) 
     8 
     9#include <scorep/SCOREP_User.h> 
     10 
     11#elif defined(ITAC) 
     12 
     13#include <VT.h> 
     14 
    415#endif 
     16 
    517#include <string> 
     18#include <map> 
     19#include <iostream> 
    620 
    721namespace xios 
    822{ 
    923  using namespace std ; 
     24 
     25  std::map<std::string,int> regionId ; 
     26  int count=0 ; 
    1027   
    1128  void traceOn(void) 
    1229  { 
    13 #ifdef VTRACE 
     30#if defined(VTRACE) 
    1431    VT_ON() ; 
     32#elif defined(SCOREP) 
     33    SCOREP_RECORDING_ON() ; 
     34#elif defined(ITAC) 
     35    VT_traceon() ; 
    1536#endif 
    1637  } 
     
    1839  void traceOff(void)  
    1940  { 
    20 #ifdef VTRACE 
     41#if defined(VTRACE) 
    2142    VT_OFF() ; 
     43#elif defined(SCOREP) 
     44    SCOREP_RECORDING_OFF() 
     45#elif defined(ITAC) 
     46    VT_traceoff()   ;   
    2247#endif 
    2348  } 
     
    2550  void traceBegin(const string& name) 
    2651  { 
    27 #ifdef VTRACE 
     52#if defined(VTRACE) 
    2853    VT_USER_START(name.c_str()) ; 
     54#elif defined(SCOREP) 
     55    SCOREP_USER_REGION_BY_NAME_BEGIN(name.c_str(),SCOREP_USER_REGION_TYPE_COMMON) 
     56 
     57#elif defined(ITAC) 
     58    int classhandle ; 
     59    auto it = regionId.find(name); 
     60    if (it==regionId.end()) 
     61    { 
     62      classhandle=count ; 
     63      count++ ; 
     64      VT_symdef (classhandle, name.c_str(), "XIOS") ; 
     65      regionId[name]=classhandle; 
     66    } 
     67    else classhandle = it->second ; 
     68    VT_begin(classhandle) ; 
     69    cout<<"VT_begin "<<name<<"  "<<classhandle<<endl ; 
     70 
    2971#endif 
     72 
    3073  } 
    3174   
    3275  void traceEnd(const string& name) 
    3376  { 
    34 #ifdef VTRACE 
     77#if defined (VTRACE) 
    3578    VT_USER_END(name.c_str()) ; 
     79#elif defined(SCOREP) 
     80    SCOREP_USER_REGION_BY_NAME_END(name.c_str()) 
     81#elif defined(ITAC) 
     82    int classhandle ; 
     83    auto it = regionId.find(name); 
     84    if (it==regionId.end()) 
     85    { 
     86      return ; 
     87      VT_classdef (name.c_str(), &classhandle) ; 
     88      regionId[name]=classhandle; 
     89    } 
     90    else classhandle = it->second ; 
     91    VT_end(classhandle) ;     
     92    cout<<"VT_end "<<name<<"  "<<classhandle<<endl ; 
     93 
    3694#endif 
    3795  } 
    3896   
     97    
    3998//  void marker(const string& name,const string& text) ; 
    4099   
Note: See TracChangeset for help on using the changeset viewer.