Skip to content

Commit af7e508

Browse files
committed
Refactoring.
master -> encounteringTaskTape TaskProbe -> ImplicitTaskProbe
1 parent b80e55e commit af7e508

4 files changed

Lines changed: 14 additions & 14 deletions

File tree

include/opdi/backend/macro/macros.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
#define OPDI_PARALLEL(...) \
4141
{ \
4242
void* opdiInternalParallelData = opdi::logic->onParallelBegin(opdi::DataTools::getTaskData(), omp_get_max_threads()); \
43-
opdi::TaskProbe opdiInternalTaskProbe(opdiInternalParallelData); \
44-
OPDI_PRAGMA(omp parallel __VA_ARGS__ firstprivate(opdiInternalTaskProbe))
43+
opdi::ImplicitTaskProbe opdiInternalImplicitTaskProbe(opdiInternalParallelData); \
44+
OPDI_PRAGMA(omp parallel __VA_ARGS__ firstprivate(opdiInternalImplicitTaskProbe))
4545

4646
#define OPDI_END_PARALLEL \
4747
opdi::logic->onParallelEnd(opdiInternalParallelData); \

include/opdi/backend/macro/probes.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,18 @@
3535

3636
namespace opdi {
3737

38-
struct TaskProbe {
38+
struct ImplicitTaskProbe {
3939
public:
4040

4141
void* parallelData;
4242
void* taskData;
4343
bool needsAction;
4444

45-
TaskProbe() : parallelData(nullptr), taskData(nullptr), needsAction(false) {}
45+
ImplicitTaskProbe() : parallelData(nullptr), taskData(nullptr), needsAction(false) {}
4646

47-
TaskProbe(void* parallelData) : parallelData(parallelData), taskData(nullptr), needsAction(false) {}
47+
ImplicitTaskProbe(void* parallelData) : parallelData(parallelData), taskData(nullptr), needsAction(false) {}
4848

49-
TaskProbe(TaskProbe const& other) : parallelData(other.parallelData), needsAction(true) {
49+
ImplicitTaskProbe(ImplicitTaskProbe const& other) : parallelData(other.parallelData), needsAction(true) {
5050

5151
DataTools::pushParallelData(this->parallelData);
5252
this->taskData = logic->onImplicitTaskBegin(false, omp_get_num_threads(), omp_get_thread_num(),
@@ -56,7 +56,7 @@ namespace opdi {
5656
assert(ReductionTools::implicitTaskNestingDepth <= omp_get_level());
5757

5858
if (ReductionTools::implicitTaskNestingDepth != omp_get_level()) {
59-
/* TaskProbe constructor before ReductionProbe constructor (if any) */
59+
/* ImplicitTaskProbe constructor before ReductionProbe constructor (if any) */
6060
do {
6161
++ReductionTools::implicitTaskNestingDepth;
6262
} while (ReductionTools::implicitTaskNestingDepth != omp_get_level());
@@ -65,7 +65,7 @@ namespace opdi {
6565
}
6666
}
6767

68-
~TaskProbe() {
68+
~ImplicitTaskProbe() {
6969
if (needsAction) {
7070
assert(ReductionTools::implicitTaskNestingDepth == omp_get_level());
7171

@@ -122,7 +122,7 @@ namespace opdi {
122122

123123
if (ReductionTools::implicitTaskNestingDepth != omp_get_level()) {
124124
/* this condition can only be satisfied by probes on a parallel construct */
125-
/* ReductionProbe constructor before TaskProbe constructor */
125+
/* ReductionProbe constructor before ImplicitTaskProbe constructor */
126126
do {
127127
++ReductionTools::implicitTaskNestingDepth;
128128
} while (ReductionTools::implicitTaskNestingDepth != omp_get_level());

include/opdi/backend/macro/reductionTools.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ namespace opdi {
5959
static std::stack<bool> needsBarrierAfterReductions;
6060
#pragma omp threadprivate(needsBarrierAfterReductions)
6161

62-
/* resolves ordering issues between TaskProbe and ReductionProbe constructors */
62+
/* resolves ordering issues between ImplicitTaskProbe and ReductionProbe constructors */
6363
static int implicitTaskNestingDepth;
6464
#pragma omp threadprivate(implicitTaskNestingDepth)
6565

include/opdi/misc/tapePool.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,16 @@ namespace opdi {
5959
return &this->lock;
6060
}
6161

62-
void* getTape(void* master, int index) {
62+
void* getTape(void* encounteringTaskTape, int index) {
6363
omp_set_lock(&this->lock);
6464

65-
if (this->tapes[master].find(index) == this->tapes[master].end()) {
65+
if (this->tapes[encounteringTaskTape].find(index) == this->tapes[encounteringTaskTape].end()) {
6666
void* newTape = tool->createTape();
67-
this->tapes[master][index] = newTape;
67+
this->tapes[encounteringTaskTape][index] = newTape;
6868
this->createdTapes.insert(newTape);
6969
}
7070

71-
void* result = this->tapes[master][index];
71+
void* result = this->tapes[encounteringTaskTape][index];
7272
omp_unset_lock(&this->lock);
7373
return result;
7474
}

0 commit comments

Comments
 (0)