OpenMPI  0.1.1
rfg_regions.h
1 #ifndef _RFG_REGIONS_H
2 #define _RFG_REGIONS_H
3 
4 #include "rfg_filter.h"
5 #include "rfg_groups.h"
6 
7 #include "vt_inttypes.h"
8 #include <stdarg.h>
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif /* __cplusplus */
13 
14 typedef struct RFG_Regions_struct RFG_Regions;
15 
16 /* data structure for hash node (mapping of region id/info) */
17 
18 typedef struct RFG_RegionInfo_struct
19 {
20  uint32_t regionId; /* region id */
21  char* groupName; /* group name */
22  char* regionName; /* region name */
23  int32_t callLimit; /* call limit */
24  int32_t callLimitCD; /* call limit count down */
25  struct RFG_RegionInfo_struct* next;
27 
28 /* initalizes RFG regions object */
29 RFG_Regions* RFG_Regions_init( void );
30 
31 /* cleanup RFG regions object */
32 int RFG_Regions_free( RFG_Regions* regions );
33 
34 /* sets region filter definition file */
35 int RFG_Regions_setFilterDefFile( RFG_Regions* regions, const char* deffile );
36 
37 /* sets region grouping definition file */
38 int RFG_Regions_setGroupsDefFile( RFG_Regions* regions, const char* deffile );
39 
40 /* reads region filter definition file
41  if rank != -1, read file with MPI-rank specific entries,
42  if ( 0 != rank_off ) after the call, then tracing should be disabled
43  completely for the current rank, existing information should be discarded. */
44 int RFG_Regions_readFilterDefFile( RFG_Regions* regions,
45  int rank, uint8_t* rank_off );
46 
47 /* reads region grouping definition file */
48 int RFG_Regions_readGroupsDefFile( RFG_Regions* regions );
49 
50 /* sets default call limit */
51 int RFG_Regions_setDefaultCallLimit( RFG_Regions* regions,
52  const uint32_t limit );
53 
54 /* adds group assignment */
55 int RFG_Regions_addGroupAssign( RFG_Regions* regions,
56  const char* gname, int n, ... );
57 
58 /* gets list of regions, whose call limit are reached */
59 int RFG_Regions_getFilteredRegions( RFG_Regions* regions,
60  uint32_t* r_nrinfs, RFG_RegionInfo*** r_rinfs );
61 
62 /* dump filtered regions to file */
63 int RFG_Regions_dumpFilteredRegions( RFG_Regions* regions,
64  char* filename );
65 
66 /* function that should be called if a region enter event invoked */
67 int RFG_Regions_stackPush( RFG_Regions* regions,
68  const uint32_t rid, const uint8_t decr,
69  RFG_RegionInfo** r_rinf );
70 
71 /* function that should be called if a region leave event invoked */
72 int RFG_Regions_stackPop( RFG_Regions* regions,
73  RFG_RegionInfo** r_rinf, int32_t* r_climitbypush );
74 
75 /* adds region */
76 RFG_RegionInfo* RFG_Regions_add( RFG_Regions* regions,
77  const char* rname, uint32_t rid );
78 
79 /* gets region informations by region id */
80 RFG_RegionInfo* RFG_Regions_get( RFG_Regions* regions,
81  const uint32_t rid );
82 
83 #ifdef __cplusplus
84 }
85 #endif /* __cplusplus */
86 
87 #endif /* _RFG_REGIONS_H */
Definition: rfg_regions.c:37
Definition: rfg_regions.h:18