SENSEI
A frame work for generic in situ analytics
MemoryProfiler.h
1 #ifndef sensei_MemoryProfiler_h
2 #define sensei_MemoryProfiler_h
3 
4 #include "senseiConfig.h"
5 #include <mpi.h>
6 #include <string>
7 
8 extern "C" void *profile(void *argp);
9 
10 namespace sensei
11 {
12 
13 // MemoryProfiler - A sampling memory use profiler
14 /**
15 The class samples process memory usage at the specified interval
16 given in seconds. For each sample the time is aquired. Calling
17 Initialize starts profiling, and Finalize ends it. During
18 Finaliziation the buffers are written using MPI-I/O to the
19 file name provided
20 */
21 class SENSEI_EXPORT MemoryProfiler
22 {
23 public:
25  ~MemoryProfiler();
26 
27  MemoryProfiler(const MemoryProfiler &) = delete;
28  void operator=(const MemoryProfiler &) = delete;
29 
30  // start and stop the profiler
31  int Initialize();
32  int Finalize();
33 
34  // Set the interval in seconds between querrying
35  // the processes memory use.
36  void SetInterval(double interval);
37  double GetInterval() const;
38 
39  // Set the comunicator for parallel I/O
40  void SetCommunicator(MPI_Comm comm);
41 
42  // Set the file name to write the data to
43  void SetFilename(const std::string &filename);
44  const char *GetFilename() const;
45 
46  friend void *::profile(void *argp);
47 
48 private:
49  struct InternalsType;
50  InternalsType *Internals;
51 };
52 
53 }
54 #endif
int Initialize(MPI_Comm comm, const std::string &fileName, InTransitDataAdaptor *&dataAdaptor)
Creates a sensei::ConfigurableAnalysis adaptor and sensei::InTransitDataAdaptor based on a SENSEI XML...
The class samples process memory usage at the specified interval given in seconds.
Definition: MemoryProfiler.h:21
SENSEI.
Definition: ADIOS2AnalysisAdaptor.h:27