Skip to content

Commit 547265b

Browse files
committed
Suspend recording on encountering task's tape.
1 parent 5cf7c84 commit 547265b

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

include/opdi/logic/omp/implicitTaskOmpLogic.cpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ void* opdi::ImplicitTaskOmpLogic::onImplicitTaskBegin(bool initialImplicitTask,
7070
void* newTape = this->tapePool.getTape(parallelData->parentTape, index);
7171

7272
if (parallelData->activeParallelRegion) {
73+
//most recent tape activity change *per thread* reflects the current activity
74+
if (index == 0) {
75+
tool->setActive(data->oldTape, false); // suspend recording on encountering task's tape
76+
}
7377
tool->setActive(newTape, true);
7478
}
7579

@@ -127,12 +131,12 @@ void opdi::ImplicitTaskOmpLogic::onImplicitTaskEnd(void* dataPtr) {
127131
"be differentiated correctly.");
128132
}
129133
}
130-
131-
tool->setActive(data->tape, false);
132-
133-
// ensure that the most recent activity change *per thread* reflects the current activity
134-
if (data->oldTape == data->parallelData->parentTape && data->parallelData->activeParallelRegion) {
135-
tool->setActive(data->oldTape, true);
134+
else {
135+
//most recent tape activity change *per thread* reflects the current activity
136+
tool->setActive(data->tape, false);
137+
if (data->index == 0) {
138+
tool->setActive(data->oldTape, true); // resume recording on encountering task's tape
139+
}
136140
}
137141

138142
// do not delete data, it is deleted as part of parallel regions

0 commit comments

Comments
 (0)