00001
00005
00006 #ifndef __TRACE_COMMON_H__
00007 #define __TRACE_COMMON_H__
00008
00009
00010 #include <stdlib.h>
00011 #if defined(_WIN32)
00012 #include <direct.h>
00013 #define CHDIR _chdir
00014 #define GETCWD _getcwd
00015 #define PATHSEP '\\'
00016 #define PATHSEPSTR "\\"
00017 #else
00018 #include <unistd.h>
00019 #define CHDIR chdir
00020 #define GETCWD getcwd
00021 #define PATHSEP '/'
00022 #define PATHSEPSTR "/"
00023 #endif
00024
00025
00026 #define CREATION 1
00027 #define BEGIN_PROCESSING 2
00028 #define END_PROCESSING 3
00029 #define ENQUEUE 4
00030 #define DEQUEUE 5
00031 #define BEGIN_COMPUTATION 6
00032 #define END_COMPUTATION 7
00033 #define BEGIN_INTERRUPT 8
00034 #define END_INTERRUPT 9
00035 #define MESSAGE_RECV 10
00036 #define BEGIN_TRACE 11
00037 #define END_TRACE 12
00038 #define USER_EVENT 13
00039 #define BEGIN_IDLE 14
00040 #define END_IDLE 15
00041 #define BEGIN_PACK 16
00042 #define END_PACK 17
00043 #define BEGIN_UNPACK 18
00044 #define END_UNPACK 19
00045 #define CREATION_BCAST 20
00046
00047 #define CREATION_MULTICAST 21
00048
00049
00050 #define MEMORY_MALLOC 24
00051 #define MEMORY_FREE 25
00052
00053
00054 #define USER_SUPPLIED 26
00055
00056
00057 #define MEMORY_USAGE_CURRENT 27
00058
00059
00060 #define USER_SUPPLIED_NOTE 28
00061
00062
00063 #define USER_SUPPLIED_BRACKETED_NOTE 29
00064
00065
00066 #define END_PHASE 30
00067 #define SURROGATE_BLOCK 31
00068
00069
00070 #define USER_STAT 32
00071
00072 #define BEGIN_USER_EVENT_PAIR 98
00073 #define END_USER_EVENT_PAIR 99
00074 #define USER_EVENT_PAIR 100
00075
00076 CkpvExtern(CmiInt8, CtrLogBufSize);
00077 CkpvExtern(char*, traceRoot);
00078 CkpvExtern(char*, partitionRoot);
00079 CkpvExtern(int, traceRootBaseLength);
00080 CkpvExtern(char*, selective);
00081 CkpvExtern(bool, verbose);
00082 CkpvExtern(double, traceInitTime);
00083 CkpvExtern(double, traceInitCpuTime);
00084
00085 #if CMK_BIGSIM_CHARM
00086 #define TRACE_TIMER BgGetTime
00087 #define TRACE_CPUTIMER BgGetTime
00088 inline double TraceTimer() { return TRACE_TIMER(); }
00089 inline double TraceTimer(double t) { return t; }
00090 inline double TraceCpuTimer() { return TRACE_TIMER(); }
00091 inline double TraceCpuTimer(double t) { return t; }
00092 #else
00093 #define TRACE_TIMER CmiWallTimer
00094 #define TRACE_CPUTIMER CmiCpuTimer
00095 inline double TraceTimer() { return TRACE_TIMER() - CkpvAccess(traceInitTime); }
00096 inline double TraceTimer(double t) { return t - CkpvAccess(traceInitTime); }
00097 inline double TraceCpuTimer() { return TRACE_CPUTIMER() - CkpvAccess(traceInitCpuTime); }
00098 inline double TraceCpuTimer(double t) { return t - CkpvAccess(traceInitCpuTime); }
00099 #endif
00100
00101 double TraceTimerCommon();
00102
00103 #define TRACE_WARN(msg) if (CkpvAccess(verbose)) CmiPrintf(msg)
00104
00105 extern bool outlierAutomatic;
00106 extern bool findOutliers;
00107 extern int numKSeeds;
00108 extern int peNumKeep;
00109 extern bool outlierUsePhases;
00110 extern double entryThreshold;
00111
00113 extern int _threadMsg, _threadChare, _threadEP;
00114 extern int _packMsg, _packChare, _packEP;
00115 extern int _unpackMsg, _unpackChare, _unpackEP;
00116 extern int _sdagMsg, _sdagChare, _sdagEP;
00117
00119 extern void traceWriteSTS(FILE *stsfp,int nUserEvents);
00120 void (*registerMachineUserEvents())();
00121
00122 #if CMK_HAS_COUNTER_PAPI
00123 #include <papi.h>
00124 #ifdef USE_SPP_PAPI
00125 #define NUMPAPIEVENTS 6
00126 #else
00127 #define NUMPAPIEVENTS 4
00128 #endif
00129 CkpvExtern(int, papiEventSet);
00130 CkpvExtern(LONG_LONG_PAPI*, papiValues);
00131 CkpvExtern(int, papiStarted);
00132 CkpvExtern(int, papiStopped);
00133 extern int papiEvents[NUMPAPIEVENTS];
00134 void initPAPI();
00135 #endif
00136
00137 #endif
00138