Ice Sheet System Model  4.18
Code documentation
Profiler.h
Go to the documentation of this file.
1 
5 #ifndef _PROFILER_H_
6 #define _PROFILER_H_
7 
8 /*Headers:*/
9 #include "../shared/shared.h"
10 #include "../datastructures/datastructures.h"
11 
12 /*Macros*/
13 #define TOTAL 0 /*Profiling Total time */
14 #define MPROCESSOR 1 /*Profiling Model processor*/
15 #define CORE 2 /*Profiling solution */
16 #define SOLVER 3 /*Profiling solution */
17 #define ADCORE 4 /*Profiling AD */
18 #define THERMALCORE 5 /*Profiling THERMAL */
19 #define HYDROLOGYCORE 6 /*Profiling HYDROLOGY */
20 #define STRESSBALANCECORE 7 /*Profiling STRESSBALANCE */
21 #define DAMAGECORE 8 /*Profiling DAMAGE */
22 #define MOVINGFRONTCORE 9 /*Profiling MOVINGFRONT */
23 #define MASSTRANSPORTCORE 10 /*Profiling MASSTRANSPORT */
24 #define SMBCORE 11 /*Profiling SMB */
25 #define GROUNDINGLINECORE 12 /*Profiling GROUDINGLINE MIGRATION */
26 #define GIACORE 13 /*Profiling GIA */
27 #define ESACORE 14 /*Profiling ESA */
28 #define SLRCORE 15 /*Profiling SLR */
29 #define MPISERIAL 16 /*Profiling MPISerial */
30 #define MAXPROFSIZE 17 /*Used to initialize static arrays*/
31 
32 
33 class Profiler: public Object{
34 
35  public:
44 
45  /*Profiler constructors, destructors */
46  Profiler();
47  ~Profiler();
48 
49  /*Object virtual functions definitions*/
50  Object *copy();
51  void DeepEcho();
52  void Echo();
53  int Id();
54  void Marshall(char** pmarshalled_data,int* pmarshalled_data_size, int marshall_direction);
55  int ObjectEnum();
56 
57  /*Profiler routines*/
58  IssmPDouble TotalFlops(int tag);
59  IssmPDouble TotalTime(int tag);
60  int TotalTimeModHour(int tag);
61  int TotalTimeModMin(int tag);
62  int TotalTimeModSec(int tag);
63  IssmPDouble Memory(int tag);
64  void Start(int tagenum,bool dontmpisync=true); /*Do not call MPI barrier by default to save some ms*/
65  void Stop(int tagenum, bool dontmpisync=true); /*Do not call MPI barrier by default to save some ms*/
66  bool Used(int tagenum);
67 };
68 
69 #endif /* _PROFILER_H_ */
Profiler::TotalTimeModSec
int TotalTimeModSec(int tag)
Definition: Profiler.cpp:123
Profiler::memory_start
IssmPDouble memory_start[MAXPROFSIZE]
Definition: Profiler.h:39
Profiler::Memory
IssmPDouble Memory(int tag)
Definition: Profiler.cpp:129
Profiler::TotalFlops
IssmPDouble TotalFlops(int tag)
Definition: Profiler.cpp:87
Profiler::time_start
IssmPDouble time_start[MAXPROFSIZE]
Definition: Profiler.h:41
Profiler::Marshall
void Marshall(char **pmarshalled_data, int *pmarshalled_data_size, int marshall_direction)
Definition: Profiler.cpp:66
Profiler::memory
IssmPDouble memory[MAXPROFSIZE]
Definition: Profiler.h:38
Profiler::time
IssmPDouble time[MAXPROFSIZE]
Definition: Profiler.h:40
Object
Definition: Object.h:13
Profiler::ObjectEnum
int ObjectEnum()
Definition: Profiler.cpp:82
Profiler
Definition: Profiler.h:33
Profiler::Id
int Id()
Definition: Profiler.cpp:62
MAXPROFSIZE
#define MAXPROFSIZE
Definition: Profiler.h:30
Profiler::flops
IssmPDouble flops[MAXPROFSIZE]
Definition: Profiler.h:36
Profiler::used
bool used[MAXPROFSIZE]
Definition: Profiler.h:43
Profiler::Stop
void Stop(int tagenum, bool dontmpisync=true)
Definition: Profiler.cpp:179
Profiler::Used
bool Used(int tagenum)
Definition: Profiler.cpp:218
Profiler::~Profiler
~Profiler()
Definition: Profiler.cpp:28
Profiler::Profiler
Profiler()
Definition: Profiler.cpp:16
Profiler::Start
void Start(int tagenum, bool dontmpisync=true)
Definition: Profiler.cpp:139
Profiler::flops_start
IssmPDouble flops_start[MAXPROFSIZE]
Definition: Profiler.h:37
Profiler::TotalTimeModHour
int TotalTimeModHour(int tag)
Definition: Profiler.cpp:110
Profiler::running
bool running[MAXPROFSIZE]
Definition: Profiler.h:42
Profiler::TotalTimeModMin
int TotalTimeModMin(int tag)
Definition: Profiler.cpp:117
Profiler::DeepEcho
void DeepEcho()
Definition: Profiler.cpp:46
Profiler::Echo
void Echo()
Definition: Profiler.cpp:49
IssmPDouble
IssmDouble IssmPDouble
Definition: types.h:38
Profiler::TotalTime
IssmPDouble TotalTime(int tag)
Definition: Profiler.cpp:96
Profiler::copy
Object * copy()
Definition: Profiler.cpp:31