1 #ifndef sensei_Profiler_h 2 #define sensei_Profiler_h 4 #include "senseiConfig.h" 40 static int Finalize();
50 static void SetCommunicator(MPI_Comm comm);
55 static void SetTimerLogFile(
const std::string &fileName);
60 static void SetMemProfLogFile(
const std::string &fileName);
64 static void SetMemProfInterval(
int interval);
69 static void Enable(
int arg = 0x03);
70 static void Disable();
73 static bool Enabled();
80 static int StartEvent(
const char *eventname,
long long nbytes=-1ll);
86 static int EndEvent(
const char *eventname,
long long nbytes=-1ll);
89 static int WriteCStdio(
const char *fileName,
const char *mode,
90 const std::string &str);
94 static int WriteMpiIo(MPI_Comm comm,
const char *fileName,
95 const std::string &str);
99 static int Validate();
102 static int ToStream(std::ostream &os);
109 template <
int bufferSize>
116 const char *method,
int port) : Eventname(Buffer)
118 snprintf(Buffer, bufferSize,
"%s::%s port=%d",
119 className, method, port);
120 Profiler::StartEvent(Eventname);
126 int nThreads,
int nReqs) : Eventname(Buffer)
128 snprintf(Buffer, bufferSize,
129 "%s threadPool process nThreads=%d nReqs=%d",
130 className, nThreads, nReqs);
131 Profiler::StartEvent(Eventname);
138 const char *method) : Eventname(Buffer)
141 strcat(Buffer, className);
142 strcat(Buffer, method);
143 Profiler::StartEvent(Eventname);
148 TimeEvent(
const char *name) : Eventname(name)
149 { Profiler::StartEvent(name); }
152 { Profiler::EndEvent(this->Eventname); }
155 char Buffer[bufferSize];
156 const char *Eventname;
int Initialize(MPI_Comm comm, const std::string &fileName, InTransitDataAdaptor *&dataAdaptor)
Creates a sensei::ConfigurableAnalysis adaptor and sensei::InTransitDataAdaptor based on a SENSEI XML...
Definition: Profiler.h:110
Definition: Profiler.h:18
SENSEI.
Definition: ADIOS2AnalysisAdaptor.h:27