Go to the documentation of this file.
51 #define hit_clockSynchronize(lay) MPI_Barrier((lay).topo.pTopology->comm)
55 #define hit_clockSynchronizeAll() MPI_Barrier( MPI_COMM_WORLD );
70 #define HIT_CLOCK_RUNNING 0
72 #define HIT_CLOCK_STOPPED 1
78 #define hit_clockReset(c) { \
80 c.state = HIT_CLOCK_STOPPED; \
87 #define hit_clockStart(c) { \
88 c.seconds= MPI_Wtime(); \
89 c.state = HIT_CLOCK_RUNNING; \
98 #define hit_clockMaxReduce(topo, c) { \
99 MPI_Reduce( &c.seconds, &c.buffer, 1, MPI_DOUBLE, \
100 MPI_MAX, 0, (topo).pTopology->comm ); \
101 c.seconds = c.buffer; \
109 #define hit_clockStop(c) { \
110 c.seconds= MPI_Wtime() - c.seconds; \
111 c.state = HIT_CLOCK_STOPPED; \
121 #define hit_clockContinue(c) { \
122 c.seconds = MPI_Wtime() - c.seconds; \
123 c.state = HIT_CLOCK_RUNNING; \
130 #define hit_clockIsRunning(c) ( c.state == HIT_CLOCK_RUNNING )
139 #define hit_clockReduce(lay, c) { \
140 MPI_Reduce( &c.seconds, &c.buffer, 1, MPI_DOUBLE, \
141 MPI_MAX, 0, (lay).pTopology[0]->comm ); \
143 MPI_Reduce( &c.seconds, &c.buffer, 1, MPI_DOUBLE, \
144 MPI_MIN, 0, (lay).pTopology[0]->comm ); \
146 MPI_Reduce( &c.seconds, &c.buffer, 1, MPI_DOUBLE, \
147 MPI_SUM, 0, (lay).pTopology[0]->comm ); \
148 c.avg = c.buffer / hit_layNumActives( lay ); \
156 #define hit_clockWorldReduce(c) { \
157 MPI_Reduce( &c.seconds, &c.buffer, 1, MPI_DOUBLE, \
158 MPI_MAX, 0, MPI_COMM_WORLD ); \
160 MPI_Reduce( &c.seconds, &c.buffer, 1, MPI_DOUBLE, \
161 MPI_MIN, 0, MPI_COMM_WORLD ); \
163 MPI_Reduce( &c.seconds, &c.buffer, 1, MPI_DOUBLE, \
164 MPI_SUM, 0, MPI_COMM_WORLD ); \
165 c.avg = c.buffer / hit_NProcs; \
172 #define hit_clockPrint(c) { \
173 if (hit_Rank==0) printf("HitClock_%s: %14.6lf\n", #c, c.seconds); \
175 #define hit_clockPrintMax(c) { \
176 if (hit_Rank==0) printf("HitClock_%s Max: %14.6lf\n", #c, c.max); \
178 #define hit_clockPrintMin(c) { \
179 if (hit_Rank==0) printf("HitClock_%s Min: %14.6lf\n", #c, c.min); \
181 #define hit_clockPrintAvg(c) { \
182 if (hit_Rank==0) printf("HitClock_%s Avg: %14.6lf\n", #c, c.avg); \
190 #define hit_clockGetSeconds(c) (c.seconds)
191 #define hit_clockGetMaxSeconds(c) (c.max)
192 #define hit_clockGetMinSeconds(c) (c.min)
193 #define hit_clockGetAvgSeconds(c) (c.avg)
214 #define hit_counterValue(c) ((c).value)
220 #define hit_counterReset(c) (c).value = 0
227 #define hit_counterAdd(c,value) (c).value += (value)
233 #define hit_counterInc(c) (c).value++
239 #define hit_counterDec(c) (c).value--
248 #define hit_counterReduce(lay, c) { \
249 MPI_Reduce( &c.value, &c.buffer, 1, MPI_INT, \
250 MPI_MAX, 0, (lay).pTopology[0]->comm ); \
252 MPI_Reduce( &c.value, &c.buffer, 1, MPI_INT, \
253 MPI_MIN, 0, (lay).pTopology[0]->comm ); \
255 MPI_Reduce( &c.value, &c.buffer, 1, MPI_INT, \
256 MPI_SUM, 0, (lay).pTopology[0]->comm ); \
258 c.avg = c.buffer / hit_layNumActives( lay ); \
266 #define hit_counterWorldReduce(c) { \
267 MPI_Reduce( &c.value, &c.buffer, 1, MPI_INT, \
268 MPI_MAX, 0, MPI_COMM_WORLD ); \
270 MPI_Reduce( &c.value, &c.buffer, 1, MPI_INT, \
271 MPI_MIN, 0, MPI_COMM_WORLD ); \
273 MPI_Reduce( &c.value, &c.buffer, 1, MPI_INT, \
274 MPI_SUM, 0, MPI_COMM_WORLD ); \
276 c.avg = c.buffer / hit_NProcs; \
283 #define hit_counterPrint(c) { \
284 if (hit_Rank==0) printf("HitCounter_%s: %010d\n", #c, c.value); \
286 #define hit_counterPrintMax(c) { \
287 if (hit_Rank==0) printf("HitCounter_%s Max: %010d\n", #c, c.max); \
289 #define hit_counterPrintMin(c) { \
290 if (hit_Rank==0) printf("HitCounter_%s Min: %010d\n", #c, c.min); \
292 #define hit_counterPrintSum(c) { \
293 if (hit_Rank==0) printf("HitCounter_%s Sum: %010d\n", #c, c.sum); \
295 #define hit_counterPrintAvg(c) { \
296 if (hit_Rank==0) printf("HitCounter_%s Avg: %010d\n", #c, c.avg); \
304 #define hit_counterMax(c) (c.max)
305 #define hit_counterMin(c) (c.min)
306 #define hit_counterSum(c) (c.sum)
307 #define hit_counterAvg(c) (c.avg)