Last change
on this file since 1661 was
1661,
checked in by yushan, 5 years ago
|
MARK: branch merged with trunk @1660. Test (test_complete, test_remap) on ADA with IntelMPI and _usingEP/_usingMPI as switch.
|
-
Property copyright set to
Software name : XIOS (Xml I/O Server) http://forge.ipsl.jussieu.fr/ioserver Creation date : January 2009 Licence : CeCCIL version2 see license file in root directory : Licence_CeCILL_V2-en.txt or http://www.cecill.info/licences/Licence_CeCILL_V2-en.html Holder : CEA/LSCE (Laboratoire des Sciences du CLimat et de l'Environnement) CNRS/IPSL (Institut Pierre Simon Laplace) Project Manager : Yann Meurdesoif yann.meurdesoif@cea.fr
-
Property svn:eol-style set to
native
|
File size:
1.8 KB
|
Rev | Line | |
---|
[347] | 1 | #include "tracer.hpp" |
---|
[1661] | 2 | |
---|
| 3 | #if defined(VTRACE) |
---|
| 4 | |
---|
[347] | 5 | #include <vt_user.h> |
---|
[1661] | 6 | |
---|
| 7 | #elif defined(SCOREP) |
---|
| 8 | |
---|
| 9 | #include <scorep/SCOREP_User.h> |
---|
| 10 | |
---|
| 11 | #elif defined(ITAC) |
---|
| 12 | |
---|
| 13 | #include <VT.h> |
---|
| 14 | |
---|
[347] | 15 | #endif |
---|
[1661] | 16 | |
---|
[347] | 17 | #include <string> |
---|
[1661] | 18 | #include <map> |
---|
| 19 | #include <iostream> |
---|
[347] | 20 | |
---|
| 21 | namespace xios |
---|
| 22 | { |
---|
| 23 | using namespace std ; |
---|
[1661] | 24 | |
---|
| 25 | std::map<std::string,int> regionId ; |
---|
| 26 | int count=0 ; |
---|
[347] | 27 | |
---|
| 28 | void traceOn(void) |
---|
| 29 | { |
---|
[1661] | 30 | #if defined(VTRACE) |
---|
[347] | 31 | VT_ON() ; |
---|
[1661] | 32 | #elif defined(SCOREP) |
---|
| 33 | SCOREP_RECORDING_ON() ; |
---|
| 34 | #elif defined(ITAC) |
---|
| 35 | VT_traceon() ; |
---|
[347] | 36 | #endif |
---|
| 37 | } |
---|
| 38 | |
---|
| 39 | void traceOff(void) |
---|
| 40 | { |
---|
[1661] | 41 | #if defined(VTRACE) |
---|
[347] | 42 | VT_OFF() ; |
---|
[1661] | 43 | #elif defined(SCOREP) |
---|
| 44 | SCOREP_RECORDING_OFF() |
---|
| 45 | #elif defined(ITAC) |
---|
| 46 | VT_traceoff() ; |
---|
[347] | 47 | #endif |
---|
| 48 | } |
---|
| 49 | |
---|
| 50 | void traceBegin(const string& name) |
---|
| 51 | { |
---|
[1661] | 52 | #if defined(VTRACE) |
---|
[347] | 53 | VT_USER_START(name.c_str()) ; |
---|
[1661] | 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 | |
---|
[347] | 71 | #endif |
---|
[1661] | 72 | |
---|
[347] | 73 | } |
---|
| 74 | |
---|
| 75 | void traceEnd(const string& name) |
---|
| 76 | { |
---|
[1661] | 77 | #if defined (VTRACE) |
---|
[347] | 78 | VT_USER_END(name.c_str()) ; |
---|
[1661] | 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 | |
---|
[347] | 94 | #endif |
---|
| 95 | } |
---|
| 96 | |
---|
[1661] | 97 | |
---|
[347] | 98 | // void marker(const string& name,const string& text) ; |
---|
| 99 | |
---|
| 100 | |
---|
| 101 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.