Skip to content

Commit ca3c4c0

Browse files
committed
Instrumentation of events follows dependency on tape activity.
1 parent 9d688d9 commit ca3c4c0

2 files changed

Lines changed: 11 additions & 10 deletions

File tree

include/opdi/logic/omp/masterOmpLogic.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,12 @@ void opdi::MasterOmpLogic::deleteFunc(void* dataPtr) {
5454
void opdi::MasterOmpLogic::onMaster(ScopeEndpoint endpoint) {
5555

5656
#if OPDI_OMP_LOGIC_INSTRUMENT
57-
for (auto& instrument : ompLogicInstruments) {
58-
instrument->onMaster(endpoint);
59-
}
60-
6157
if (tool->getThreadLocalTape() != nullptr && tool->isActive(tool->getThreadLocalTape())) {
6258

59+
for (auto& instrument : ompLogicInstruments) {
60+
instrument->onMaster(endpoint);
61+
}
62+
6363
Data* data = new Data;
6464
data->endpoint = endpoint;
6565

include/opdi/logic/omp/syncRegionOmpLogic.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,14 @@ bool opdi::SyncRegionOmpLogic::requiresReverseBarrier(SyncRegionKind kind, Scope
8282

8383
void opdi::SyncRegionOmpLogic::onSyncRegion(SyncRegionKind kind, ScopeEndpoint endpoint) {
8484

85-
#if OPDI_OMP_LOGIC_INSTRUMENT
86-
for (auto& instrument : ompLogicInstruments) {
87-
instrument->onSyncRegion(kind, endpoint);
88-
}
89-
#endif
90-
9185
if (tool->getThreadLocalTape() != nullptr && tool->isActive(tool->getThreadLocalTape())) {
86+
87+
#if OPDI_OMP_LOGIC_INSTRUMENT
88+
for (auto& instrument : ompLogicInstruments) {
89+
instrument->onSyncRegion(kind, endpoint);
90+
}
91+
#endif
92+
9293
if (requiresReverseBarrier(kind, endpoint)) {
9394
internalPushHandle(kind, endpoint);
9495
}

0 commit comments

Comments
 (0)