OpenMPI 0.1.1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

vt_filter_trc_hdlr.h
1 /**
2 * VampirTrace
3 * http://www.tu-dresden.de/zih/vampirtrace
4 *
5 * Copyright (c) 2005-2012, ZIH, TU Dresden, Federal Republic of Germany
6 *
7 * Copyright (c) 1998-2005, Forschungszentrum Juelich, Juelich Supercomputing
8 * Centre, Federal Republic of Germany
9 *
10 * See the file COPYING in the package base directory for details
11 **/
12
13 #ifndef _VT_FILTER_TRC_HDLR_H_
14 #define _VT_FILTER_TRC_HDLR_H_
15
16 #include "vt_filter_trc.h"
17
18 #include "otf.h"
19
20 #include <stack>
21
22 //
23 // data structure for first argument of definition handlers
24 // (base)
25 //
26 struct FiltTrc__DefHandler_FirstArg_BaseS
27 {
28 // constructor
29 FiltTrc__DefHandler_FirstArg_BaseS( int _mode )
30 {
31 mode = static_cast<mode_e>( _mode );
32 }
33
34 // check whether handler mode is reading
35 inline bool isReading( void ) { return ( mode == READING ); }
36
37 // check whether handler mode is writing
38 inline bool isWriting( void ) { return ( mode == WRITING ); }
39
40 // handler mode (reading or writing)
41 enum mode_e { READING, WRITING } mode;
42
43 };
44
45 //
46 // data structure for first argument of definition handlers
47 // (reading)
48 //
49 struct FiltTrc__DefHandler_FirstArg_ReadS
50 : public FiltTrc__DefHandler_FirstArg_BaseS
51 {
52 // constructor
53 FiltTrc__DefHandler_FirstArg_ReadS(
54 std::vector<std::pair<uint32_t, uint32_t> >& _procs,
55 std::map<uint32_t, std::string>& _funcs )
56 : FiltTrc__DefHandler_FirstArg_BaseS( READING ),
57 procs( _procs ), funcs( _funcs ) {}
58
59 // add process/parent id to vector
60 inline void addProc( const uint32_t& proc, const uint32_t& parent )
61 {
62 procs.push_back( std::make_pair( proc, parent ) );
63 }
64
65 // add function id/name to map
66 inline void addFunc( const uint32_t& func, const std::string& name )
67 {
68 funcs.insert( std::make_pair( func, name ) );
69 }
70
71 // vector of process/parent ids
72 std::vector<std::pair<uint32_t, uint32_t> >& procs;
73
74 // map of function ids/names
75 std::map<uint32_t, std::string>& funcs;
76
77 };
78
79 //
80 // data structure for first argument of definition handlers
81 // (writing)
82 //
83 struct FiltTrc__DefHandler_FirstArg_WriteS
84 : public FiltTrc__DefHandler_FirstArg_BaseS
85 {
86 // constructor
87 FiltTrc__DefHandler_FirstArg_WriteS( OTF_WStream*& _wstream,
88 const FilterTraceC::FilterS& _filter )
89 : FiltTrc__DefHandler_FirstArg_BaseS( WRITING ),
90 wstream( _wstream ), filter( _filter ) {}
91
92 // OTF writer stream
93 OTF_WStream*& wstream;
94
95 // filter rules
96 const FilterTraceC::FilterS& filter;
97
98 };
99
100 //
101 // data structure for first argument of event handlers
102 //
103 struct FiltTrc__EventHandler_FirstArgS
104 {
105 // constructor
106 FiltTrc__EventHandler_FirstArgS( OTF_WStream*& _wstream,
107 FilterTraceC::FilterS& _filter,
108 std::map<uint32_t, std::stack<int32_t> >& _stack )
109 : wstream( _wstream ), filter( _filter ), stack( _stack ) {}
110
111 // decrement function's call limit and push it to call stack
112 // returns true, if call limit > 0
113 inline bool stackPush( const uint32_t& proc, const uint32_t& func );
114
115 // pop call stack
116 // returns false, if a stack underflow occurred
117 inline bool stackPop( const uint32_t& proc );
118
119 // returns true, if call limit on call stack's top > 0
120 inline bool stackTop( const uint32_t& proc );
121
122 // OTF writer stream
123 OTF_WStream*& wstream;
124
125 // filter rules
126 FilterTraceC::FilterS& filter;
127
128 // map for call stack of each process
129 std::map<uint32_t, std::stack<int32_t> >& stack;
130
131 };
132
133 // record handler declarations
134 //
135
136 int FiltTrc__Handle_DefProcess(
137 FiltTrc__DefHandler_FirstArg_BaseS* farg, uint32_t streamid,
138 uint32_t deftoken, const char* name, uint32_t parent,
139 OTF_KeyValueList* list );
140
141 int FiltTrc__Handle_DefProcessGroup(
142 FiltTrc__DefHandler_FirstArg_BaseS* farg, uint32_t streamid,
143 uint32_t deftoken, const char* name, uint32_t n, const uint32_t* array,
144 OTF_KeyValueList* list );
145
146 int FiltTrc__Handle_DefFunction(
147 FiltTrc__DefHandler_FirstArg_BaseS* farg, uint32_t streamid,
148 uint32_t deftoken, const char* name, uint32_t group, uint32_t scltoken,
149 OTF_KeyValueList* list );
150
151 int FiltTrc__Handle_BeginCollectiveOperation(
152 FiltTrc__EventHandler_FirstArgS* farg, uint64_t time, uint32_t proc,
153 uint32_t collOp, uint64_t matchingId, uint32_t procGroup,
154 uint32_t rootProc, uint64_t sent, uint64_t received, uint32_t scltoken,
155 OTF_KeyValueList* list );
156
157 int FiltTrc__Handle_BeginFileOperation(
158 FiltTrc__EventHandler_FirstArgS* farg, uint64_t time, uint32_t proc,
159 uint64_t matchingId, uint32_t scltoken, OTF_KeyValueList* list );
160
161 int FiltTrc__Handle_CollectiveOperation(
162 FiltTrc__EventHandler_FirstArgS* farg, uint64_t time, uint32_t proc,
163 uint32_t func, uint32_t communicator, uint32_t rootproc, uint32_t sent,
164 uint32_t received, uint64_t duration, uint32_t scltoken,
165 OTF_KeyValueList* list );
166
167 int FiltTrc__Handle_Counter(
168 FiltTrc__EventHandler_FirstArgS* farg, uint64_t time, uint32_t proc,
169 uint32_t cnttoken, uint64_t value, OTF_KeyValueList* list );
170
171 int FiltTrc__Handle_EndCollectiveOperation(
172 FiltTrc__EventHandler_FirstArgS* farg, uint64_t time, uint32_t proc,
173 uint64_t matchingId, OTF_KeyValueList* list );
174
175 int FiltTrc__Handle_Enter(
176 FiltTrc__EventHandler_FirstArgS* farg, uint64_t time, uint32_t func,
177 uint32_t proc, uint32_t scltoken, OTF_KeyValueList* list );
178
179 int FiltTrc__Handle_EndFileOperation(
180 FiltTrc__EventHandler_FirstArgS* farg, uint64_t time, uint32_t proc,
181 uint32_t fileid, uint64_t matchingId, uint64_t handleId,
182 uint32_t operation, uint64_t bytes, uint32_t scltoken,
183 OTF_KeyValueList* list );
184
185 int FiltTrc__Handle_FileOperation(
186 FiltTrc__EventHandler_FirstArgS* farg, uint64_t time, uint32_t fileid,
187 uint32_t proc, uint64_t handleid, uint32_t operation, uint64_t bytes,
188 uint64_t duration, uint32_t source, OTF_KeyValueList* list );
189
190 int FiltTrc__Handle_Leave( FiltTrc__EventHandler_FirstArgS* farg, uint64_t time,
191 uint32_t func, uint32_t proc, uint32_t scltoken, OTF_KeyValueList* list );
192
193 int FiltTrc__Handle_RecvMsg(
194 FiltTrc__EventHandler_FirstArgS* farg, uint64_t time, uint32_t receiver,
195 uint32_t sender, uint32_t communicator, uint32_t msgtype,
196 uint32_t msglength, uint32_t scltoken, OTF_KeyValueList* list );
197
198 int FiltTrc__Handle_RMAEnd(
199 FiltTrc__EventHandler_FirstArgS* farg, uint64_t time, uint32_t proc,
200 uint32_t remote, uint32_t communicator, uint32_t tag, uint32_t scltoken,
201 OTF_KeyValueList* list );
202
203 int FiltTrc__Handle_RMAGet(
204 FiltTrc__EventHandler_FirstArgS* farg, uint64_t time, uint32_t proc,
205 uint32_t origin, uint32_t target, uint32_t communicator, uint32_t tag,
206 uint64_t bytes, uint32_t scltoken, OTF_KeyValueList* list );
207
208 int FiltTrc__Handle_RMAPut(
209 FiltTrc__EventHandler_FirstArgS* farg, uint64_t time, uint32_t proc,
210 uint32_t origin, uint32_t target, uint32_t communicator, uint32_t tag,
211 uint64_t bytes, uint32_t scltoken, OTF_KeyValueList* list );
212
213 int FiltTrc__Handle_RMAPutRemoteEnd(
214 FiltTrc__EventHandler_FirstArgS* farg, uint64_t time, uint32_t proc,
215 uint32_t origin, uint32_t target, uint32_t communicator, uint32_t tag,
216 uint64_t bytes, uint32_t scltoken, OTF_KeyValueList* list );
217
218 int FiltTrc__Handle_SendMsg(
219 FiltTrc__EventHandler_FirstArgS* farg, uint64_t time, uint32_t sender,
220 uint32_t receiver, uint32_t communicator, uint32_t msgtype,
221 uint32_t msglength, uint32_t scltoken, OTF_KeyValueList* list );
222
223 #endif // _VT_FILTER_TRC_HDLR_H_
FiltTrc__DefHandler_FirstArg_BaseS
VampirTrace http://www.tu-dresden.de/zih/vampirtrace.
Definition: vt_filter_trc_hdlr.h:26
FiltTrc__EventHandler_FirstArgS::stackPush
bool stackPush(const uint32_t &proc, const uint32_t &func)
VampirTrace http://www.tu-dresden.de/zih/vampirtrace.
Definition: vt_filter_trc_hdlr.cc:26
FiltTrc__DefHandler_FirstArg_ReadS
Definition: vt_filter_trc_hdlr.h:49
otf.h
Main include file for applications using OTF.
FiltTrc__DefHandler_FirstArg_WriteS
Definition: vt_filter_trc_hdlr.h:83
FiltTrc__EventHandler_FirstArgS
Definition: vt_filter_trc_hdlr.h:103
struct_OTF_WStream
Definition: OTF_WStream.h:95
OTF_KeyValueList
struct OTF_KeyValueList_struct OTF_KeyValueList
Object type which holds a key-value list.
Definition: OTF_KeyValue.h:242
FilterTraceC::FilterS
Definition: vt_filter_trc.h:33