HPCToolkit
ga-overrides.c
Go to the documentation of this file.
1 // -*-Mode: C++;-*- // technically C99
2 
3 // * BeginRiceCopyright *****************************************************
4 //
5 // $HeadURL$
6 // $Id$
7 //
8 // --------------------------------------------------------------------------
9 // Part of HPCToolkit (hpctoolkit.org)
10 //
11 // Information about sources of support for research and development of
12 // HPCToolkit is at 'hpctoolkit.org' and in 'README.Acknowledgments'.
13 // --------------------------------------------------------------------------
14 //
15 // Copyright ((c)) 2002-2019, Rice University
16 // All rights reserved.
17 //
18 // Redistribution and use in source and binary forms, with or without
19 // modification, are permitted provided that the following conditions are
20 // met:
21 //
22 // * Redistributions of source code must retain the above copyright
23 // notice, this list of conditions and the following disclaimer.
24 //
25 // * Redistributions in binary form must reproduce the above copyright
26 // notice, this list of conditions and the following disclaimer in the
27 // documentation and/or other materials provided with the distribution.
28 //
29 // * Neither the name of Rice University (RICE) nor the names of its
30 // contributors may be used to endorse or promote products derived from
31 // this software without specific prior written permission.
32 //
33 // This software is provided by RICE and contributors "as is" and any
34 // express or implied warranties, including, but not limited to, the
35 // implied warranties of merchantability and fitness for a particular
36 // purpose are disclaimed. In no event shall RICE or contributors be
37 // liable for any direct, indirect, incidental, special, exemplary, or
38 // consequential damages (including, but not limited to, procurement of
39 // substitute goods or services; loss of use, data, or profits; or
40 // business interruption) however caused and on any theory of liability,
41 // whether in contract, strict liability, or tort (including negligence
42 // or otherwise) arising in any way out of the use of this software, even
43 // if advised of the possibility of such damage.
44 //
45 // ******************************************************* EndRiceCopyright *
46 
47 //***************************************************************************
48 //
49 // File:
50 // $HeadURL$
51 //
52 // Purpose:
53 // GA sampling source.
54 //
55 // Note: Using the GA profiling interface would be nice. However, it
56 // would require overriding weak symbols, which is not generally
57 // possible.
58 //
59 //***************************************************************************
60 
61 //***************************************************************************
62 // system includes
63 //***************************************************************************
64 
65 #include <sys/types.h>
66 #include <stdio.h>
67 #include <ucontext.h>
68 #include <unistd.h>
69 #include <limits.h>
70 
71 
72 //***************************************************************************
73 // local includes
74 //***************************************************************************
75 
76 #include <main.h>
77 #include <metrics.h>
78 #include <safe-sampling.h>
79 #include <sample_event.h>
80 #include <thread_data.h>
81 #include <trace.h>
82 
83 #include <messages/messages.h>
85 #include <sample-sources/ga.h>
86 
87 #include <lib/support-lean/timer.h>
88 
89 
90 //***************************************************************************
91 // type definitions
92 //***************************************************************************
93 
94 // FIXME: temporarily import GA 5.2 declarations. Unfortunately, some
95 // of these declarations are only in the source tree (as opposed to
96 // the installation), so currently there is no clean solution.
97 
98 // Need: field for a profiler
99 
100 // ${GA-install}/include/typesf2c.h
101 // ${GA-build}/gaf2c/typesf2c.h
102 // ${GA-src}/gaf2c/typesf2c.h.in [F2C_INTEGER_C_TYPE]
103 typedef int Integer; // integer size
104 typedef Integer logical;
105 
106 // ${GA-install}/include/armci.h
107 // ${GA-src}/armci/src/include/armci.h
108 typedef long armci_size_t;
109 
110 // ${GA-install}/include/gacommon.h
111 // ${GA-src}/global/src/gacommon.h
112 #define GA_MAX_DIM 7
113 
114 // ${GA-src}/global/src/gaconfig.h
115 #define MAXDIM GA_MAX_DIM
116 
117 // ${GA-src}/global/src/globalp.h
118 #define GA_OFFSET 1000
119 
120 // ${GA-src}/global/src/base.h
121 #define FNAM 31 /* length of array names */
122 
125 
126 typedef struct {
127  short int ndim; /* number of dimensions */
128  short int irreg; /* 0-regular; 1-irregular distribution */
129  int type; /* data type in array */
130  int actv; /* activity status, GA is allocated */
131  int actv_handle; /* handle is created */
132  C_Long size; /* size of local data in bytes */
133  int elemsize; /* sizeof(datatype) */
134  int ghosts; /* flag indicating presence of ghosts */
135  long lock; /* lock */
136  long id; /* ID of shmem region / MA handle */
137  C_Integer dims[MAXDIM]; /* global array dimensions */
138  C_Integer chunk[MAXDIM]; /* chunking */
139  int nblock[MAXDIM]; /* number of blocks per dimension */
140  C_Integer width[MAXDIM]; /* boundary cells per dimension */
141  C_Integer first[MAXDIM]; /* (Mirrored only) first local element */
142  C_Integer last[MAXDIM]; /* (Mirrored only) last local element */
143  C_Long shm_length; /* (Mirrored only) local shmem length */
144  C_Integer lo[MAXDIM]; /* top/left corner in local patch */
145  double scale[MAXDIM]; /* nblock/dim (precomputed) */
146  char **ptr; /* arrays of pointers to remote data */
147  C_Integer *mapc; /* block distribution map */
148  char name[FNAM+1]; /* array name */
149  int p_handle; /* pointer to processor list for array */
150  double *cache; /* store for frequently accessed ptrs */
151  int corner_flag; /* flag for updating corner ghost cells */
152  int block_flag; /* flag to indicate block-cyclic data */
153  int block_sl_flag; /* flag to indicate block-cyclic data */
154  /* using ScaLAPACK format */
155  C_Integer block_dims[MAXDIM];/* array of block dimensions */
156  C_Integer num_blocks[MAXDIM];/* number of blocks in each dimension */
157  C_Integer block_total; /* total number of blocks in array */
158  /* using restricted arrays */
159  C_Integer *rstrctd_list; /* list of processors with data */
160  C_Integer num_rstrctd; /* number of processors with data */
161  C_Integer has_data; /* flag that processor has data */
162  C_Integer rstrctd_id; /* rank of processor in restricted list */
163  C_Integer *rank_rstrctd; /* ranks of processors with data */
164 
165 #ifdef ENABLE_CHECKPOINT
166  int record_id; /* record id for writing ga to disk */
167 #endif
169 
170 extern global_array_t *GA;
171 
172 #define gam_CountElems(ndim, lo, hi, pelems){ \
173  int _d; \
174  for(_d=0,*pelems=1; _d< ndim;_d++) *pelems *= hi[_d]-lo[_d]+1; \
175 }
176 
177 // tallent
178 #define G_A_NULL (INT_MAX - GA_OFFSET)
179 
180 
181 //***************************************************************************
182 // macros
183 //***************************************************************************
184 
185 #define def_isSampled_blocking() \
186  def_isSampled(); \
187  def_timeBeg(isSampled);
188 
189 
190 #define def_isSampled_nonblocking() \
191  def_isSampled(); \
192  def_timeBeg(isSampled);
193 
194 
195 #define def_isSampled() \
196  bool isSampled = false; \
197  thread_data_t* threadData = hpcrun_get_thread_data(); \
198  { \
199  lushPthr_t* xxx = &threadData->pthr_metrics; \
200  xxx->doIdlenessCnt++; \
201  if (xxx->doIdlenessCnt == hpcrun_ga_period) { \
202  xxx->doIdlenessCnt = 0; \
203  isSampled = true; \
204  } \
205  }
206 
207 
208 #define def_timeBeg(isSampled) \
209  uint64_t timeBeg = 0; \
210  if (isSampled) { \
211  timeBeg = time_getTSC(); /* cycles */ \
212  }
213 
214 
215 //***************************************************************************
216 
217 #define doSample_1sided_blocking(g_a, lo, hi) \
218  if (isSampled) { \
219  double latency = timeElapsed(timeBeg); \
220  uint64_t nbytes = bytesXfr(g_a, lo, hi); \
221  \
222  doSample(g_a, \
223  doMetric(hpcrun_ga_metricId_onesidedOp, 1, i), \
224  doMetric(hpcrun_ga_metricId_latency, latency, r), \
225  doMetric(hpcrun_ga_metricId_bytesXfr, nbytes, i), \
226  doMetric(dataMetricId, nbytes, i)); \
227  }
228 
229 
230 #define doSample_1sided_nonblocking(g_a, lo, hi) \
231  if (isSampled) { \
232  double latency = timeElapsed(timeBeg); \
233  uint64_t nbytes = bytesXfr(g_a, lo, hi); \
234  \
235  /* record time, cctNode, metricVec in nbhandle */ \
236  /* complete in: wait or sync */ \
237  \
238  doSample(g_a, \
239  doMetric(hpcrun_ga_metricId_onesidedOp, 1, i), \
240  doMetric(hpcrun_ga_metricId_latency, latency, r), \
241  doMetric(hpcrun_ga_metricId_bytesXfr, nbytes, i), \
242  doMetric(dataMetricId, nbytes, i)); \
243  }
244 
245 
246 #define doSample_collective_blocking() \
247  if (isSampled) { \
248  double latency = timeElapsed(timeBeg); \
249  \
250  doSample(G_A_NULL, \
251  doMetric(hpcrun_ga_metricId_collectiveOp, 1, i), \
252  doMetric(hpcrun_ga_metricId_latency, latency, r), \
253  do0(), \
254  do0()); \
255  }
256 
257 
258 #define doSample(g_a, do1, do2, do3, do4) \
259 { \
260  bool safe = false; \
261  if ((safe = hpcrun_safe_enter())) { \
262  ucontext_t uc; \
263  getcontext(&uc); \
264  \
265  hpcrun_ga_metricId_dataDesc_t* ga_desc = NULL; \
266  uint dataMetricId = HPCRUN_FMT_MetricId_NULL; \
267  \
268  if (g_a != G_A_NULL) { \
269  int idx = ga_getDataIdx(g_a); \
270  if (hpcrun_ga_dataIdx_isValid(idx)) { \
271  ga_desc = hpcrun_ga_metricId_dataTbl_find(idx); \
272  dataMetricId = ga_desc->metricId; \
273  } \
274  } \
275  \
276  /* N.B.: when tracing, this call generates a trace record */ \
277  /* TODO: should return a 'metric_set_t*' */ \
278  sample_val_t smplVal = \
279  hpcrun_sample_callpath(&uc, dataMetricId, \
280  (hpcrun_metricVal_t) {.i=0}, \
281  0/*skipInner*/, 1/*isSync*/, NULL); \
282  \
283  /* namespace: g_a, ga_desc, dataMetricId, smplVal, metricVec */ \
284  metric_set_t* metricVec = \
285  metricVec = hpcrun_get_metric_set(smplVal.sample_node); \
286  do1; \
287  do2; \
288  do3; \
289  do4; \
290  \
291  if (safe) hpcrun_safe_exit(); \
292  } \
293 }
294 
295 
296 #define doMetric(metricIdExpr, metricIncr, type) \
297 { \
298  int mId = (metricIdExpr); /* eval only once */ \
299  if (mId >= 0 && mId != HPCRUN_FMT_MetricId_NULL) { \
300  /*TMSG(GA, "doMetric: %d", nbytes); */ \
301  hpcrun_metric_std_inc(mId, metricVec, \
302  (cct_metric_data_t){.type = metricIncr * hpcrun_ga_period}); \
303  } \
304 }
305 
306 
307 #define do0() {}
308 
309 
310 //***************************************************************************
311 
312 // timeElapsed: returns time in us but with ns resolution
313 static inline double
314 timeElapsed(uint64_t timeBeg)
315 {
316  const double mhz = 2100; // FIXME;
317  uint64_t timeEnd = time_getTSC();
318  return ((double)(timeEnd - timeBeg) / mhz);
319 }
320 
321 
322 static inline uint
324 {
325  // TODO: can this information be communicated from the runtime
326  // rather than being (re?)computed here?
327  Integer ga_hndl = GA_OFFSET + g_a;
328  uint ga_ndim = GA[ga_hndl].ndim;
329  uint ga_elemsize = GA[ga_hndl].elemsize;
330  Integer num_elems = 0;
331  gam_CountElems(ga_ndim, lo, hi, &num_elems);
332  uint num_bytes = num_elems * ga_elemsize;
333  return num_bytes;
334 }
335 
336 
337 static inline int
339 {
340  // FIXME: use a profiling slot rather than 'lock'
341  Integer ga_hndl = GA_OFFSET + g_a;
342  return (int) GA[ga_hndl].lock;
343 }
344 
345 
346 static inline void
347 ga_setDataIdx(Integer g_a, int idx)
348 {
349  Integer ga_hndl = GA_OFFSET + g_a;
350  GA[ga_hndl].lock = idx;
351 }
352 
353 
354 //***************************************************************************
355 // bookkeeping
356 //***************************************************************************
357 
358 // There are two basic interface:
359 // 1. pnga_create()
360 // 2. pnga_create_handle()
361 // pnga_set_array_name() [optional]
362 // pnga_set_*
363 // pnga_allocate()
364 
366  Integer *dims, char* name,
367  Integer *chunk, Integer *g_a);
368 
370 
371 logical
373  Integer *dims, char* name,
374  Integer *chunk, Integer *g_a)
375 {
376  MONITOR_EXT_GET_NAME_WRAP(real_pnga_create, pnga_create);
377 
378  // collective
379  logical ret = real_pnga_create(type, ndim, dims, name, chunk, g_a);
380 
381  int idx = -1;
382 #if (GA_DataCentric_Prototype)
383  idx = hpcrun_ga_dataIdx_new(name);
384 #endif
385 
386  ga_setDataIdx(*g_a, idx);
387 
388  return ret;
389 }
390 
391 
393 
394 MONITOR_EXT_DECLARE_REAL_FN(ga_create_handle_fn_t, real_pnga_create_handle);
395 
396 Integer
398 {
399  MONITOR_EXT_GET_NAME_WRAP(real_pnga_create_handle, pnga_create_handle);
400 
401  // collective
402  Integer g_a = real_pnga_create_handle();
403 
404  int idx = -1;
405 #if (GA_DataCentric_Prototype)
406  char* name = "(unknown)";
407  idx = hpcrun_ga_dataIdx_new(name);
408 #endif
409 
410  ga_setDataIdx(g_a, idx);
411 
412  return g_a;
413 }
414 
415 // TODO: void pnga_set_array_name(Integer g_a, char *array_name);
416 
417 
418 // ga_destroy
419 
420 // ga_pgroup_create, ga_pgroup_destroy, ga_pgroup_get_default, ga_pgroup_set_default, ga_nodeid, ga_cluster_proc_nodeid
421 // ga_release / ga_release_update
422 // ga_error
423 
424 // ga_read_inc
425 
426 
427 //***************************************************************************
428 // blocking get, put, acc, ...
429 //***************************************************************************
430 
431 typedef void ga_getput_fn_t(Integer g_a, Integer* lo, Integer* hi, void* buf, Integer* ld);
432 
433 typedef void ga_acc_fn_t(Integer g_a, Integer *lo, Integer *hi, void *buf, Integer *ld, void *alpha);
434 
435 
437 
438 void
440 {
441  MONITOR_EXT_GET_NAME_WRAP(real_pnga_get, pnga_get);
442 
444 
445  real_pnga_get(g_a, lo, hi, buf, ld);
446 
447  doSample_1sided_blocking(g_a, lo, hi);
448 }
449 
450 
452 
453 void
455 {
456  MONITOR_EXT_GET_NAME_WRAP(real_pnga_put, pnga_put);
457 
459 
460  real_pnga_put(g_a, lo, hi, buf, ld);
461 
462  doSample_1sided_blocking(g_a, lo, hi);
463 }
464 
465 
467 
468 void
469 MONITOR_EXT_WRAP_NAME(pnga_acc)(Integer g_a, Integer *lo, Integer *hi, void *buf, Integer *ld, void *alpha)
470 {
471  MONITOR_EXT_GET_NAME_WRAP(real_pnga_acc, pnga_acc);
472 
474 
475  real_pnga_acc(g_a, lo, hi, buf, ld, alpha);
476 
477  doSample_1sided_blocking(g_a, lo, hi);
478 }
479 
480 
481 // ngai_get_common: (pnga_get, pnga_nbget, pnga_get_field, pnga_nbget_field)
482 
483 
484 //***************************************************************************
485 // non-blocking get, put, acc, ...
486 //***************************************************************************
487 
488 typedef void ga_nbgetput_fn_t(Integer g_a, Integer *lo, Integer *hi, void *buf, Integer *ld, Integer *nbhandle);
489 
490 typedef void ga_nbacc_fn_t(Integer g_a, Integer *lo, Integer *hi, void *buf, Integer *ld, void *alpha, Integer *nbhandle);
491 
492 typedef void ga_nbwait_fn_t(Integer *nbhandle);
493 
494 
496 
497 void
499 {
500  MONITOR_EXT_GET_NAME_WRAP(real_pnga_nbget, pnga_nbget);
501 
503 
504  real_pnga_nbget(g_a, lo, hi, buf, ld, nbhandle);
505 
506  doSample_1sided_nonblocking(g_a, lo, hi);
507 }
508 
509 
511 
512 void
514 {
515  MONITOR_EXT_GET_NAME_WRAP(real_pnga_nbput, pnga_nbput);
516 
518 
519  real_pnga_nbput(g_a, lo, hi, buf, ld, nbhandle);
520 
521  doSample_1sided_nonblocking(g_a, lo, hi);
522 }
523 
524 
526 
527 void
528 MONITOR_EXT_WRAP_NAME(pnga_nbacc)(Integer g_a, Integer *lo, Integer *hi, void *buf, Integer *ld, void *alpha, Integer *nbhandle)
529 {
530  MONITOR_EXT_GET_NAME_WRAP(real_pnga_nbacc, pnga_nbacc);
531 
533 
534  real_pnga_nbacc(g_a, lo, hi, buf, ld, alpha, nbhandle);
535 
536  doSample_1sided_nonblocking(g_a, lo, hi);
537 }
538 
539 
541 
542 void
544 {
545  MONITOR_EXT_GET_NAME_WRAP(real_pnga_nbwait, pnga_nbwait);
546 
547  // FIXME: measure only if tagged
548  def_isSampled();
549  def_timeBeg(isSampled);
550 
551  real_pnga_nbwait(nbhandle);
552 
553  if (isSampled) {
554  double latency = timeElapsed(timeBeg);
557  do0(), do0(), do0());
558  }
559 }
560 
561 
562 //***************************************************************************
563 // collectives: brdcst
564 //***************************************************************************
565 
566 typedef void ga_brdcst_fn_t(Integer type, void *buf, Integer len, Integer originator);
567 
569 
570 void
572 {
573  MONITOR_EXT_GET_NAME_WRAP(real_pnga_brdcst, pnga_brdcst);
574 
576 
577  real_pnga_brdcst(type, buf, len, originator);
578 
580 }
581 
582 
583 typedef void ga_gop_fn_t(Integer type, void *x, Integer n, char *op);
584 
586 
587 void
588 MONITOR_EXT_WRAP_NAME(pnga_gop)(Integer type, void *x, Integer n, char *op)
589 {
590  MONITOR_EXT_GET_NAME_WRAP(real_pnga_gop, pnga_gop);
591 
593 
594  real_pnga_gop(type, x, n, op);
595 
597 }
598 
599 
600 typedef void ga_sync_fn_t();
601 
603 
604 void
606 {
607  MONITOR_EXT_GET_NAME_WRAP(real_pnga_sync, pnga_sync);
608 
610 
611  real_pnga_sync();
612 
614 }
615 
616 
617 // TODO: ga_pgroup_sync
618 typedef void ga_pgroup_sync_fn_t(Integer grp_id);
619 
620 
621 // TODO: ga_pgroup_dgop
622 typedef void ga_pgroup_gop_fn_t(Integer p_grp, Integer type, void *x, Integer n, char *op);
623 
624 
625 //***************************************************************************
C_Integer rstrctd_id
Definition: ga-overrides.c:162
static int ga_getDataIdx(Integer g_a)
Definition: ga-overrides.c:338
void MONITOR_EXT_WRAP_NAME() pnga_nbput(Integer g_a, Integer *lo, Integer *hi, void *buf, Integer *ld, Integer *nbhandle)
Definition: ga-overrides.c:513
void MONITOR_EXT_WRAP_NAME() pnga_get(Integer g_a, Integer *lo, Integer *hi, void *buf, Integer *ld)
Definition: ga-overrides.c:439
armci_size_t C_Long
Definition: ga-overrides.c:124
double * cache
Definition: ga-overrides.c:150
void ga_getput_fn_t(Integer g_a, Integer *lo, Integer *hi, void *buf, Integer *ld)
Definition: ga-overrides.c:431
#define doSample_1sided_blocking(g_a, lo, hi)
Definition: ga-overrides.c:217
#define GA_OFFSET
Definition: ga-overrides.c:118
static void ga_setDataIdx(Integer g_a, int idx)
Definition: ga-overrides.c:347
Integer MONITOR_EXT_WRAP_NAME() pnga_create_handle()
Definition: ga-overrides.c:397
static uint bytesXfr(Integer g_a, Integer *lo, Integer *hi)
Definition: ga-overrides.c:323
#define def_isSampled_nonblocking()
Definition: ga-overrides.c:190
void ga_gop_fn_t(Integer type, void *x, Integer n, char *op)
Definition: ga-overrides.c:583
#define G_A_NULL
Definition: ga-overrides.c:178
#define FNAM
Definition: ga-overrides.c:121
void MONITOR_EXT_WRAP_NAME() pnga_nbwait(Integer *nbhandle)
Definition: ga-overrides.c:543
MONITOR_EXT_DECLARE_REAL_FN(ga_create_fn_t, real_pnga_create)
void ga_nbgetput_fn_t(Integer g_a, Integer *lo, Integer *hi, void *buf, Integer *ld, Integer *nbhandle)
Definition: ga-overrides.c:488
#define MONITOR_EXT_WRAP_NAME(name)
Definition: monitor_ext.h:92
int Integer
Definition: ga-overrides.c:103
short int irreg
Definition: ga-overrides.c:128
void MONITOR_EXT_WRAP_NAME() pnga_acc(Integer g_a, Integer *lo, Integer *hi, void *buf, Integer *ld, void *alpha)
Definition: ga-overrides.c:469
Definition: fmt.c:108
static uint64_t time_getTSC()
Definition: timer.h:155
#define def_timeBeg(isSampled)
Definition: ga-overrides.c:208
void MONITOR_EXT_WRAP_NAME() pnga_gop(Integer type, void *x, Integer n, char *op)
Definition: ga-overrides.c:588
void MONITOR_EXT_WRAP_NAME() pnga_put(Integer g_a, Integer *lo, Integer *hi, void *buf, Integer *ld)
Definition: ga-overrides.c:454
#define gam_CountElems(ndim, lo, hi, pelems)
Definition: ga-overrides.c:172
#define doSample_1sided_nonblocking(g_a, lo, hi)
Definition: ga-overrides.c:230
#define doMetric(metricIdExpr, metricIncr, type)
Definition: ga-overrides.c:296
#define doSample_collective_blocking()
Definition: ga-overrides.c:246
C_Integer * rstrctd_list
Definition: ga-overrides.c:159
void ga_nbacc_fn_t(Integer g_a, Integer *lo, Integer *hi, void *buf, Integer *ld, void *alpha, Integer *nbhandle)
Definition: ga-overrides.c:490
long armci_size_t
Definition: ga-overrides.c:108
void ga_nbwait_fn_t(Integer *nbhandle)
Definition: ga-overrides.c:492
unsigned int uint
Definition: uint.h:124
logical MONITOR_EXT_WRAP_NAME() pnga_create(Integer type, Integer ndim, Integer *dims, char *name, Integer *chunk, Integer *g_a)
Definition: ga-overrides.c:372
#define MONITOR_EXT_GET_NAME_WRAP(var, name)
Definition: monitor_ext.h:94
void ga_pgroup_sync_fn_t(Integer grp_id)
Definition: ga-overrides.c:618
void MONITOR_EXT_WRAP_NAME() pnga_nbacc(Integer g_a, Integer *lo, Integer *hi, void *buf, Integer *ld, void *alpha, Integer *nbhandle)
Definition: ga-overrides.c:528
#define def_isSampled_blocking()
Definition: ga-overrides.c:185
short int ndim
Definition: ga-overrides.c:127
C_Integer has_data
Definition: ga-overrides.c:161
static char buf[32]
Definition: StrUtil.cpp:240
global_array_t * GA
void MONITOR_EXT_WRAP_NAME() pnga_sync()
Definition: ga-overrides.c:605
#define MAXDIM
Definition: ga-overrides.c:115
C_Integer * mapc
Definition: ga-overrides.c:147
Integer C_Integer
Definition: ga-overrides.c:123
#define doSample(g_a, do1, do2, do3, do4)
Definition: ga-overrides.c:258
void MONITOR_EXT_WRAP_NAME() pnga_brdcst(Integer type, void *buf, Integer len, Integer originator)
Definition: ga-overrides.c:571
void ga_pgroup_gop_fn_t(Integer p_grp, Integer type, void *x, Integer n, char *op)
Definition: ga-overrides.c:622
void MONITOR_EXT_WRAP_NAME() pnga_nbget(Integer g_a, Integer *lo, Integer *hi, void *buf, Integer *ld, Integer *nbhandle)
Definition: ga-overrides.c:498
static double timeElapsed(uint64_t timeBeg)
Definition: ga-overrides.c:314
int hpcrun_ga_dataIdx_new(const char *name)
void ga_sync_fn_t()
Definition: ga-overrides.c:600
int hpcrun_ga_metricId_latency
Definition: ga.c:81
#define do0()
Definition: ga-overrides.c:307
logical ga_create_fn_t(Integer type, Integer ndim, Integer *dims, char *name, Integer *chunk, Integer *g_a)
Definition: ga-overrides.c:365
C_Integer block_total
Definition: ga-overrides.c:157
<!-- ********************************************************************--> n<!-- HPCToolkit Experiment DTD --> n<!-- Version 2.1 --> n<!-- ********************************************************************--> n<!ELEMENT HPCToolkitExperiment(Header,(SecCallPathProfile|SecFlatProfile) *)> n<!ATTLIST HPCToolkitExperiment\n version CDATA #REQUIRED > n n<!-- ******************************************************************--> n n<!-- Info/NV:flexible name-value pairs:(n) ame;(t) ype;(v) alue --> n<!ELEMENT Info(NV *)> n<!ATTLIST Info\n n CDATA #IMPLIED > n<!ELEMENT NV EMPTY > n<!ATTLIST NV\n n CDATA #REQUIRED\n t CDATA #IMPLIED\n v CDATA #REQUIRED > n n<!-- ******************************************************************--> n<!-- Header --> n<!-- ******************************************************************--> n<!ELEMENT Header(Info *)> n<!ATTLIST Header\n n CDATA #REQUIRED > n n<!-- ******************************************************************--> n<!-- Section Header --> n<!-- ******************************************************************--> n<!ELEMENT SecHeader(MetricTable?, MetricDBTable?, TraceDBTable?, LoadModuleTable?, FileTable?, ProcedureTable?, Info *)> n n<!-- MetricTable:--> n<!ELEMENT MetricTable(Metric) * > n n<!-- Metric:(i) d;(n) ame --> n<!--(v) alue-type:transient type of values --> n<!--(t) ype:persistent type of metric --> n<!-- fmt:format;show;--> n<!ELEMENT Metric(MetricFormula *, Info?)> n<!ATTLIST Metric\n i CDATA #REQUIRED\n n CDATA #REQUIRED\n es CDATA #IMPLIED\n em CDATA #IMPLIED\n ep CDATA #IMPLIED\n v(raw|final|derived-incr|derived) \"raw\\ t (inclusive|exclusive|nil) \nil\\ partner CDATA #IMPLIED\ fmt CDATA #IMPLIED\ show (1|0) \1\\ show-percent (1|0) \1> n n<!-- MetricFormula represents derived metrics: (t)ype; (frm): formula --> n<!ELEMENT MetricFormula (Info?)> n<!ATTLIST MetricFormula\ t (combine|finalize) \finalize\\ i CDATA #IMPLIED\ frm CDATA #REQUIRED> n n<!-- Metric data, used in sections: (n)ame [from Metric]; (v)alue --> n<!ELEMENT M EMPTY> n<!ATTLIST M\ n CDATA #REQUIRED\ v CDATA #REQUIRED> n n<!-- MetricDBTable: --> n<!ELEMENT MetricDBTable (MetricDB)*> n n<!-- MetricDB: (i)d; (n)ame --> n<!-- (t)ype: persistent type of metric --> n<!-- db-glob: file glob describing files in metric db --> n<!-- db-id: id within metric db --> n<!-- db-num-metrics: number of metrics in db --> n<!-- db-header-sz: size (in bytes) of a db file header --> n<!ELEMENT MetricDB EMPTY> n<!ATTLIST MetricDB\ i CDATA #REQUIRED\ n CDATA #REQUIRED\ t (inclusive|exclusive|nil) \nil\\ partner CDATA #IMPLIED\ db-glob CDATA #IMPLIED\ db-id CDATA #IMPLIED\ db-num-metrics CDATA #IMPLIED\ db-header-sz CDATA #IMPLIED> n n<!-- TraceDBTable: --> n<!ELEMENT TraceDBTable (TraceDB)> n n<!-- TraceDB: (i)d --> n<!-- db-min-time: min beginning time stamp (global) --> n<!-- db-max-time: max ending time stamp (global) --> n<!ELEMENT TraceDB EMPTY> n<!ATTLIST TraceDB\ i CDATA #REQUIRED\ db-glob CDATA #IMPLIED\ db-min-time CDATA #IMPLIED\ db-max-time CDATA #IMPLIED\ db-header-sz CDATA #IMPLIED> n n<!-- LoadModuleTable assigns a short name to a load module --> n<!ELEMENT LoadModuleTable (LoadModule)*> n n<!ELEMENT LoadModule (Info?)> n<!ATTLIST LoadModule\ i CDATA #REQUIRED\ n CDATA #REQUIRED> n n<!-- FileTable assigns a short name to a file --> n<!ELEMENT FileTable (File)*> n n<!ELEMENT File (Info?)> n<!ATTLIST File\ i CDATA #REQUIRED\ n CDATA #REQUIRED> n n<!-- ProcedureTable assigns a short name to a procedure --> n<!ELEMENT ProcedureTable (Procedure)*> n n<!-- Info/NV: flexible name-value pairs: (n)ame; (t)ype; (v)alue --> n<!-- f: family of the procedure (fake, root, ...)--> n<!ELEMENT Procedure (Info?)> n<!ATTLIST Procedure\ i CDATA #REQUIRED\ n CDATA #REQUIRED\ f CDATA #IMPLIED> n n<!-- ****************************************************************** --> n<!-- Section: Call path profile --> n<!-- ****************************************************************** --> n<!ELEMENT SecCallPathProfile (SecHeader, SecCallPathProfileData)> n<!ATTLIST SecCallPathProfile\ i CDATA #REQUIRED\ n CDATA #REQUIRED> n n<!ELEMENT SecCallPathProfileData (PF|M)*> n<!-- Procedure frame --> n<!-- (i)d: unique identifier for cross referencing --> n<!-- (s)tatic scope id --> n<!-- (n)ame: a string or an id in ProcedureTable --> n<!-- (lm) load module: a string or an id in LoadModuleTable --> n<!-- (f)ile name: a string or an id in LoadModuleTable --> n<!-- (l)ine range: \beg-end\ (inclusive range) --> n<!-- (a)lien: whether frame is alien to enclosing P --> n<!-- (str)uct: hpcstruct node id --> n<!-- (t)ype: hpcrun node type: memory access, variable declaration, ... --> n<!-- (v)ma-range-set: \{[beg-end), [beg-end)...}\ --> n<!ELEMENT PF (PF|Pr|L|C|S|M)*> n<!ATTLIST PF\ i CDATA #IMPLIED\ s CDATA #IMPLIED\ n CDATA #REQUIRED\ lm CDATA #IMPLIED\ f CDATA #IMPLIED\ l CDATA #IMPLIED\ str CDATA #IMPLIED\ v CDATA #IMPLIED> n<!-- Procedure (static): GOAL: replace with 'P' --> n<!ELEMENT Pr (Pr|L|C|S|M)*> n<!ATTLIST Pr\ i CDATA #IMPLIED\ s CDATA #IMPLIED\ n CDATA #REQUIRED\ lm CDATA #IMPLIED\ f CDATA #IMPLIED\ l CDATA #IMPLIED\ a (1|0) \0\\ str CDATA #IMPLIED\ v CDATA #IMPLIED> n<!-- Callsite (a special StatementRange) --> n<!ELEMENT C (PF|M)*> n<!ATTLIST C\ i CDATA #IMPLIED\ s CDATA #IMPLIED\ l CDATA #IMPLIED\ str CDATA #IMPLIED\ v CDATA #IMPLIED> n n<!-- ****************************************************************** --> n<!-- Section: Flat profile --> n<!-- ****************************************************************** --> n<!ELEMENT SecFlatProfile (SecHeader, SecFlatProfileData)> n<!ATTLIST SecFlatProfile\ i CDATA #REQUIRED\ n CDATA #REQUIRED> n n<!ELEMENT SecFlatProfileData (LM|M)*> n<!-- Load module: (i)d; (n)ame; (v)ma-range-set --> n<!ELEMENT LM (F|P|M)*> n<!ATTLIST LM\ i CDATA #IMPLIED\ n CDATA #REQUIRED\ v CDATA #IMPLIED> n<!-- File --> n<!ELEMENT F (P|L|S|M)*> n<!ATTLIST F\ i CDATA #IMPLIED\ n CDATA #REQUIRED> n<!-- Procedure (Note 1) --> n<!ELEMENT P (P|A|L|S|C|M)*> n<!ATTLIST P\ i CDATA #IMPLIED\ n CDATA #REQUIRED\ l CDATA #IMPLIED\ str CDATA #IMPLIED\ v CDATA #IMPLIED> n<!-- Alien (Note 1) --> n<!ELEMENT A (A|L|S|C|M)*> n<!ATTLIST A\ i CDATA #IMPLIED\ f CDATA #IMPLIED\ n CDATA #IMPLIED\ l CDATA #IMPLIED\ str CDATA #IMPLIED\ v CDATA #IMPLIED> n<!-- Loop (Note 1,2) --> n<!ELEMENT L (A|Pr|L|S|C|M)*> n<!ATTLIST L\ i CDATA #IMPLIED\ s CDATA #IMPLIED\ l CDATA #IMPLIED\ f CDATA #IMPLIED\ str CDATA #IMPLIED\ v CDATA #IMPLIED> n<!-- Statement (Note 2) --> n<!-- (it): trace record identifier --> n<!ELEMENT S (S|M)*> n<!ATTLIST S\ i CDATA #IMPLIED\ it CDATA #IMPLIED\ s CDATA #IMPLIED\ l CDATA #IMPLIED\ str CDATA #IMPLIED\ v CDATA #IMPLIED> n<!-- Note 1: Contained Cs may not contain PFs --> n<!-- Note 2: The 's' attribute is not used for flat profiles --> n
static char * last
Definition: tokenize.c:65
#define def_isSampled()
Definition: ga-overrides.c:195
void ga_brdcst_fn_t(Integer type, void *buf, Integer len, Integer originator)
Definition: ga-overrides.c:566
void ga_acc_fn_t(Integer g_a, Integer *lo, Integer *hi, void *buf, Integer *ld, void *alpha)
Definition: ga-overrides.c:433
C_Integer num_rstrctd
Definition: ga-overrides.c:160
Integer ga_create_handle_fn_t()
Definition: ga-overrides.c:392
C_Integer * rank_rstrctd
Definition: ga-overrides.c:163
Integer logical
Definition: ga-overrides.c:104