-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMicroBench.h
More file actions
52 lines (39 loc) · 1.21 KB
/
Copy pathMicroBench.h
File metadata and controls
52 lines (39 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef __MICRO_BENCH_H__
#define __MICRO_BENCH_H__
#include <mpi.h>
#include "timing/ClockSync.h"
namespace CMSB {
class MicroBench {
public:
struct MicroBenchInfo {
MicroBenchInfo () :
_sendBuff (NULL),
_recvBuff (NULL),
_sendCounts (NULL),
_sendDispls (NULL),
_recvCounts (NULL),
_recvDispls (NULL) {}
double* _sendBuff;
unsigned int _sBuffLen; // In bytes
double* _recvBuff;
unsigned int _rBuffLen; // In bytes
int* _sendCounts;
int* _sendDispls;
int* _recvCounts;
int* _recvDispls;
};
MicroBench () : _worldComm (MPI_COMM_WORLD) {}
virtual ~MicroBench () {}
virtual void init (MPI_Comm worldComm, CMSB::MicroBench::MicroBenchInfo* benchInfo)
{ _worldComm = worldComm; _benchInfo = *benchInfo; }
virtual void runMicroBench (CMSB::TimeSyncInfo* syncInfo) = 0;
virtual const char* getMicroBenchName () const = 0;
virtual double getMicroBenchResult () const = 0;
virtual void writeResultToProfile () const = 0;
virtual unsigned int getMemConsumption () const = 0;
protected:
MPI_Comm _worldComm;
MicroBenchInfo _benchInfo;
};
}
#endif // __MICRO_BENCH_H__