-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutils.h.in
219 lines (196 loc) · 4.22 KB
/
utils.h.in
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
/*****************************************************************************\
* This source file is part of mpisee
* Copyright (C) 2024 Ioannis Vardas - [email protected]
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>
******************************************************************************/
#ifndef UTILS_H_
#define UTILS_H_
#include <cstdint>
#include <mpi.h>
#include <unistd.h>
#include <string>
#include <unordered_map>
#define NAMELEN 32
#define NUM_OF_PRIMS 76
#define MAX_ARG_STRING_SIZE 4096
#define MAX_ARGS 1024
#define MAX_ARG_SIZE 64
#define NUM_BUCKETS @NUM_BUCKETS@
#define MPISEE_MAJOR_VERSION @MPI_SEE_MAJOR_VERSION@
#define MPISEE_MINOR_VERSION @MPI_SEE_MINOR_VERSION@
const int64_t buckets[NUM_BUCKETS-1] = {@BUCKETS@};
// This is used to index the prim_names array
// Warning: This has to be in the same order as the prim_names array
enum primitives{
Send,
Recv,
Isend,
Irecv,
Sendrecv,
Isendrecv,
Ssend,
Issend,
Rsend,
Irsend,
Bsend,
Ibsend,
Waitall,
Wait,
Waitany,
Test,
Testany,
Testall,
Put,
Rput,
Get,
Rget,
Accumulate,
Raccumulate,
Fence,
Win_start,
Win_complete,
Win_post,
Win_wait,
Win_test,
Bcast,
Barrier,
Allreduce,
Allgather,
Allgatherv,
Alltoall,
Alltoallv,
Alltoallw,
Reduce,
Gather,
Gatherv,
Scan,
Exscan,
Scatter,
Scatterv,
Reduce_scatter,
Reduce_scatter_block,
Iallreduce,
Ibcast,
Ialltoall,
Iscatter,
Ibarrier,
Iallgather,
Iallgatherv,
Ialltoallv,
Ialltoallw,
Ireduce,
Igather,
Igatherv,
Iscan,
Iexscan,
Iscatterv,
Ireduce_scatter,
Ireduce_scatter_block,
Neighbor_allgather,
Neighbor_allgatherv,
Neighbor_alltoall,
Neighbor_alltoallv,
Neighbor_alltoallw,
Ineighbor_allgather,
Ineighbor_allgatherv,
Ineighbor_alltoall,
Ineighbor_alltoallv,
Ineighbor_alltoallw,
Init,
Init_thread
};
struct CommData {
std::string name;
int size;
};
struct DataEntry {
int rank;
int commId;
int operationId;
int bufferSizeMin;
int bufferSizeMax;
int calls;
double time;
uint64_t volume;
};
struct VolEntry {
int operationId;
int rank;
int commId;
uint64_t volume;
};
typedef struct profiler_attributes{
char name[NAMELEN];
int size;
int comms;
char id;
double buckets_time[NUM_OF_PRIMS][NUM_BUCKETS];
int buckets_msgs[NUM_OF_PRIMS][NUM_BUCKETS];
uint64_t volume[NUM_OF_PRIMS][NUM_BUCKETS];
}prof_attrs;
typedef struct profiler_data{
char name[NAMELEN];
int size;
double buckets_time[NUM_OF_PRIMS][NUM_BUCKETS];
int buckets_msgs[NUM_OF_PRIMS][NUM_BUCKETS];
uint64_t volume[NUM_OF_PRIMS][NUM_BUCKETS];
}prof_data;
typedef struct request_data{
MPI_Request *req;
MPI_Comm comm;
}rq;
// Metadata associated with an MPI communicator
typedef struct profiler_metadata {
char name[NAMELEN];
int size;
int comms;
char id;
} prof_metadata;
// Structure to store profiling data for a primitive and bucket
typedef struct PrimBucketInfo {
double time;
int num_messages;
uint64_t volume;
}primBucketInfo;
typedef struct comm_profiler {
std::unordered_map<int, primBucketInfo> data_map;
} comm_profiler;
typedef struct comm_data{
int comm_id;
int prim;
int bucketIndex;
double time;
int num_messages;
uint64_t volume;
} comm_data;
typedef struct comm_all{
char name[NAMELEN];
int size;
int datasize;
} comm_all;
typedef struct comm_profiler_meta_pair{
comm_profiler prof;
prof_metadata meta;
} prof_meta_pair;
/* Globals */
extern char *appname;
extern const char prim_names[][NUM_OF_PRIMS];
extern int ac;
extern char *av[MAX_ARGS];
void mcpt_abort (const char *fmt, ...);
void getProcCmdLine (int *ac, char **av);
char * get_appname(void);
void getRunCmd(int argc, char **argv);
#endif // UTILS_H_