@@ -36,34 +36,48 @@ namespace opdi {
3636
3737 virtual ~OmpLogicOutputInstrument () {}
3838
39- virtual void reverseFlush () {
40- TapedOutput::print (" R FLSH l" , omp_get_level (), " t" , omp_get_thread_num ());
41- }
42-
43- virtual void reverseImplicitTaskBegin (ImplicitTaskData* data) {
44- assert (tool != nullptr );
45- TapedOutput::print (" R IMTB l" , data->level ,
46- " t" , data->indexInTeam ,
47- " tape" , data->newTape ,
48- " pos" , tool->positionToString (data->positions .back ()));
49- }
39+ /* instrumentation of forward actions */
5040
51- virtual void reverseImplicitTaskEnd (ImplicitTaskData* data) {
52- assert (tool != nullptr );
53- TapedOutput::print (" R IMTE l" , data->level ,
54- " t" , data->indexInTeam ,
55- " tape" , data->newTape ,
56- " pos" , tool->positionToString (data->positions .front ()));
41+ virtual void onParallelBegin (ParallelData* data) {
42+ if (data == nullptr ) {
43+ TapedOutput::print (" F PARB l" , omp_get_level (),
44+ " t" , omp_get_thread_num (),
45+ " (skipped)" );
46+ }
47+ else if (!data->isActiveParallelRegion ) {
48+ TapedOutput::print (" F PARB l" , omp_get_level (),
49+ " t" , omp_get_thread_num (),
50+ " parent" , data->encounteringTaskTape ,
51+ " mode" , data->encounteringTaskAdjointAccessMode ,
52+ " (passive)" );
53+ }
54+ else {
55+ TapedOutput::print (" F PARB l" , omp_get_level (),
56+ " t" , omp_get_thread_num (),
57+ " parent" , data->encounteringTaskTape ,
58+ " mode" , data->encounteringTaskAdjointAccessMode );
59+ }
5760 }
5861
59- virtual void reverseImplicitTaskPart (ImplicitTaskData* data, std::size_t part) {
60- assert (tool != nullptr );
61- TapedOutput::print (" R IMTP l" , data->level ,
62- " t" , data->indexInTeam ,
63- " tape" , data->newTape ,
64- " start" , tool->positionToString (data->positions [part]),
65- " end" , tool->positionToString (data->positions [part - 1 ]),
66- " mode" , data->adjointAccessModes [part - 1 ]);
62+ virtual void onParallelEnd (ParallelData* data) {
63+ if (data == nullptr ) {
64+ TapedOutput::print (" F PARE l" , omp_get_level (),
65+ " t" , omp_get_thread_num (),
66+ " (skipped)" );
67+ }
68+ else if (!data->isActiveParallelRegion ) {
69+ TapedOutput::print (" F PARE l" , omp_get_level (),
70+ " t" , omp_get_thread_num (),
71+ " parent" , data->encounteringTaskTape ,
72+ " mode" , data->encounteringTaskAdjointAccessMode ,
73+ " (passive)" );
74+ }
75+ else {
76+ TapedOutput::print (" F PARE l" , omp_get_level (),
77+ " t" , omp_get_thread_num (),
78+ " parent" , data->encounteringTaskTape ,
79+ " mode" , data->encounteringTaskAdjointAccessMode );
80+ }
6781 }
6882
6983 virtual void onImplicitTaskBegin (ImplicitTaskData* data) {
@@ -94,41 +108,40 @@ namespace opdi {
94108 }
95109 }
96110
97- virtual void reverseMutexWait (MutexOmpLogic::Data* data) {
98- TapedOutput::print (" R MWAI l" , omp_get_level (),
99- " t" , omp_get_thread_num (),
111+ virtual void onMutexAcquired (MutexOmpLogic::Data* data) {
112+ TapedOutput::print (" F MACQ t" , omp_get_thread_num (),
100113 " kind" , data->mutexKind ,
101114 " id" , data->waitId ,
102- " until " , data->counter );
115+ " at " , data->counter );
103116 }
104117
105- virtual void reverseMutexDecrement (MutexOmpLogic::Data* data) {
106- TapedOutput::print (" R MDEC t" , omp_get_thread_num (),
118+ virtual void onMutexReleased (MutexOmpLogic::Data* data) {
119+ TapedOutput::print (" F MREL t" , omp_get_thread_num (),
107120 " kind" , data->mutexKind ,
108121 " id" , data->waitId ,
109- " to " , data->counter );
122+ " at " , data->counter );
110123 }
111124
112- virtual void onMutexDestroyed (LogicInterface::MutexKind kind, std:: size_t waitId ) {
125+ virtual void onMutexDestroyed (MutexOmpLogic::Data* data ) {
113126 TapedOutput::print (" F MDES t" , omp_get_thread_num (),
114- " kind" , kind ,
115- " id" , waitId);
127+ " kind" , data-> mutexKind ,
128+ " id" , data-> waitId );
116129 }
117130
118- virtual void onMutexAcquired (MutexOmpLogic::Data* data) {
119- TapedOutput::print (" F MACQ t" , omp_get_thread_num (),
120- " kind" , data->mutexKind ,
121- " id" , data->waitId ,
122- " at" , data->counter );
131+ virtual void onSyncRegion (SyncRegionOmpLogic::Data* data) {
132+ TapedOutput::print (" F SYNC t" , omp_get_thread_num (), " kind" , data->kind , " endp" , data->endpoint );
123133 }
124134
125- virtual void onMutexReleased (MutexOmpLogic::Data* data) {
126- TapedOutput::print (" F MREL t" , omp_get_thread_num (),
127- " kind" , data->mutexKind ,
128- " id" , data->waitId ,
129- " at" , data->counter );
135+ virtual void onMasked (MaskedOmpLogic::Data* data) {
136+ TapedOutput::print (" F MASK t" , omp_get_thread_num (), " endp" , data->endpoint );
137+ }
138+
139+ virtual void onWork (WorkOmpLogic::Data* data) {
140+ TapedOutput::print (" F WORK t" , omp_get_thread_num (), " kind" , data->kind , " endp" , data->endpoint );
130141 }
131142
143+ /* instrumentation of reverse actions */
144+
132145 virtual void reverseParallelBegin (ParallelData* data) {
133146 TapedOutput::print (" R PARB l" , omp_get_level (),
134147 " t" , omp_get_thread_num (),
@@ -141,72 +154,65 @@ namespace opdi {
141154 " parent" , data->encounteringTaskTape );
142155 }
143156
144- virtual void onParallelBegin (ParallelData* data) {
145- if (data == nullptr ) {
146- TapedOutput::print (" F PARB l" , omp_get_level (),
147- " t" , omp_get_thread_num (),
148- " (skipped)" );
149- }
150- else if (!data->isActiveParallelRegion ) {
151- TapedOutput::print (" F PARB l" , omp_get_level (),
152- " t" , omp_get_thread_num (),
153- " parent" , data->encounteringTaskTape ,
154- " mode" , data->encounteringTaskAdjointAccessMode ,
155- " (passive)" );
156- }
157- else {
158- TapedOutput::print (" F PARB l" , omp_get_level (),
159- " t" , omp_get_thread_num (),
160- " parent" , data->encounteringTaskTape ,
161- " mode" , data->encounteringTaskAdjointAccessMode );
162- }
157+ virtual void reverseImplicitTaskBegin (ImplicitTaskData* data) {
158+ assert (tool != nullptr );
159+ TapedOutput::print (" R IMTB l" , data->level ,
160+ " t" , data->indexInTeam ,
161+ " tape" , data->newTape ,
162+ " pos" , tool->positionToString (data->positions .back ()));
163163 }
164164
165- virtual void onParallelEnd (ParallelData* data) {
166- if (data == nullptr ) {
167- TapedOutput::print (" F PARE l" , omp_get_level (),
168- " t" , omp_get_thread_num (),
169- " (skipped)" );
170- }
171- else if (!data->isActiveParallelRegion ) {
172- TapedOutput::print (" F PARE l" , omp_get_level (),
173- " t" , omp_get_thread_num (),
174- " parent" , data->encounteringTaskTape ,
175- " mode" , data->encounteringTaskAdjointAccessMode ,
176- " (passive)" );
177- }
178- else {
179- TapedOutput::print (" F PARE l" , omp_get_level (),
180- " t" , omp_get_thread_num (),
181- " parent" , data->encounteringTaskTape ,
182- " mode" , data->encounteringTaskAdjointAccessMode );
183- }
165+ virtual void reverseImplicitTaskEnd (ImplicitTaskData* data) {
166+ assert (tool != nullptr );
167+ TapedOutput::print (" R IMTE l" , data->level ,
168+ " t" , data->indexInTeam ,
169+ " tape" , data->newTape ,
170+ " pos" , tool->positionToString (data->positions .front ()));
184171 }
185172
186- virtual void reverseSyncRegion (SyncRegionOmpLogic::Data* data) {
187- TapedOutput::print (" R SYNC l" , omp_get_level (), " t" , omp_get_thread_num (), " kind" , data->kind , " endp" , data->endpoint );
173+ virtual void reverseImplicitTaskPart (ImplicitTaskData* data, std::size_t part) {
174+ assert (tool != nullptr );
175+ TapedOutput::print (" R IMTP l" , data->level ,
176+ " t" , data->indexInTeam ,
177+ " tape" , data->newTape ,
178+ " start" , tool->positionToString (data->positions [part]),
179+ " end" , tool->positionToString (data->positions [part - 1 ]),
180+ " mode" , data->adjointAccessModes [part - 1 ]);
188181 }
189182
190- virtual void onSyncRegion (LogicInterface::SyncRegionKind kind, LogicInterface::ScopeEndpoint endpoint) {
191- TapedOutput::print (" F SYNC t" , omp_get_thread_num (), " kind" , kind, " endp" , endpoint);
183+ virtual void reverseMutexWait (MutexOmpLogic::Data* data) {
184+ TapedOutput::print (" R MWAI l" , omp_get_level (),
185+ " t" , omp_get_thread_num (),
186+ " kind" , data->mutexKind ,
187+ " id" , data->waitId ,
188+ " until" , data->counter );
192189 }
193190
194- virtual void reverseWork (WorkOmpLogic::Data* data) {
195- TapedOutput::print (" R WORK t" , omp_get_thread_num (), " kind" , data->kind , " endp" , data->endpoint );
191+ virtual void reverseMutexDecrement (MutexOmpLogic::Data* data) {
192+ TapedOutput::print (" R MDEC t" , omp_get_thread_num (),
193+ " kind" , data->mutexKind ,
194+ " id" , data->waitId ,
195+ " to" , data->counter );
196196 }
197197
198- virtual void onWork (LogicInterface::WorksharingKind kind, LogicInterface::ScopeEndpoint endpoint ) {
199- TapedOutput::print (" F WORK t" , omp_get_thread_num (), " kind" , kind, " endp" , endpoint);
198+ virtual void reverseSyncRegion (SyncRegionOmpLogic::Data* data ) {
199+ TapedOutput::print (" R SYNC l " , omp_get_level (), " t" , omp_get_thread_num (), " kind" , data-> kind , " endp" , data-> endpoint );
200200 }
201201
202202 virtual void reverseMasked (MaskedOmpLogic::Data* data) {
203203 TapedOutput::print (" R MASK t" , omp_get_thread_num (), " endp" , data->endpoint );
204204 }
205205
206- virtual void onMasked (LogicInterface::ScopeEndpoint endpoint) {
207- TapedOutput::print (" F MASK t" , omp_get_thread_num (), " endp" , endpoint);
206+ virtual void reverseWork (WorkOmpLogic::Data* data) {
207+ TapedOutput::print (" R WORK t" , omp_get_thread_num (), " kind" , data->kind , " endp" , data->endpoint );
208+ }
209+
210+ virtual void reverseFlush () {
211+ TapedOutput::print (" R FLSH l" , omp_get_level (), " t" , omp_get_thread_num ());
208212 }
209213
214+ /* instrumentation of other functionality */
215+
210216 virtual void onSetAdjointAccessMode (LogicInterface::AdjointAccessMode adjointAccess) {
211217 TapedOutput::print (" F SAAM t" , omp_get_thread_num (), " mode" , adjointAccess);
212218 }
0 commit comments