Skip to content

Commit 66f1a62

Browse files
committed
Refactor Master -> Masked in the logic layer.
Also regards instrumentation. MasterOmpLogic -> MaskedOmpLogic onMaster -> onMasked reverseMaster -> reverseMasked MAST -> MASK
1 parent 204e992 commit 66f1a62

9 files changed

Lines changed: 24 additions & 24 deletions

File tree

include/opdi/backend/macro/macros.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,10 @@
149149
#define OPDI_MASTER(...) \
150150
OPDI_PRAGMA(omp master __VA_ARGS__) \
151151
{ \
152-
opdi::logic->onMaster(opdi::LogicInterface::ScopeEndpoint::Begin);
152+
opdi::logic->onMasked(opdi::LogicInterface::ScopeEndpoint::Begin);
153153

154154
#define OPDI_END_MASTER \
155-
opdi::logic->onMaster(opdi::LogicInterface::ScopeEndpoint::End); \
155+
opdi::logic->onMasked(opdi::LogicInterface::ScopeEndpoint::End); \
156156
}
157157
#else
158158
#define OPDI_MASTER(...) \

include/opdi/backend/ompt/masterCallbacks.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ namespace opdi {
5454
endpoint = LogicInterface::ScopeEndpoint::End;
5555
}
5656

57-
logic->onMaster(endpoint);
57+
logic->onMasked(endpoint);
5858
}
5959

6060
protected:

include/opdi/logic/logicInterface.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ namespace opdi {
7373

7474
virtual void onWork(WorksharingKind kind, ScopeEndpoint endpoint) = 0;
7575

76-
virtual void onMaster(ScopeEndpoint endpoint) = 0;
76+
virtual void onMasked(ScopeEndpoint endpoint) = 0;
7777

7878
virtual void onSyncRegion(SyncRegionKind kind, ScopeEndpoint endpoint) = 0;
7979

include/opdi/logic/omp/instrument/ompLogicInstrumentInterface.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
#include "../../logicInterface.hpp"
3232
#include "../implicitTaskOmpLogic.hpp"
33-
#include "../masterOmpLogic.hpp"
33+
#include "../maskedOmpLogic.hpp"
3434
#include "../mutexOmpLogic.hpp"
3535
#include "../parallelOmpLogic.hpp"
3636
#include "../syncRegionOmpLogic.hpp"
@@ -68,8 +68,8 @@ namespace opdi {
6868
virtual void reverseWork(WorkOmpLogic::Data* /*data*/) {}
6969
virtual void onWork(LogicInterface::WorksharingKind /*kind*/, LogicInterface::ScopeEndpoint /*endpoint*/) {}
7070

71-
virtual void reverseMaster(MasterOmpLogic::Data* /*data*/) {}
72-
virtual void onMaster(LogicInterface::ScopeEndpoint /*endpoint*/) {}
71+
virtual void reverseMasked(MaskedOmpLogic::Data* /*data*/) {}
72+
virtual void onMasked(LogicInterface::ScopeEndpoint /*endpoint*/) {}
7373

7474
virtual void onSetAdjointAccessMode(LogicInterface::AdjointAccessMode /*adjointAccess*/) {}
7575
};

include/opdi/logic/omp/instrument/ompLogicOutputInstrument.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,12 +194,12 @@ namespace opdi {
194194
TapedOutput::print("F WORK t", omp_get_thread_num(), "kind", kind, "endp", endpoint);
195195
}
196196

197-
virtual void reverseMaster(MasterOmpLogic::Data* data) {
198-
TapedOutput::print("R MAST t", omp_get_thread_num(), "endp", data->endpoint);
197+
virtual void reverseMasked(MaskedOmpLogic::Data* data) {
198+
TapedOutput::print("R MASK t", omp_get_thread_num(), "endp", data->endpoint);
199199
}
200200

201-
virtual void onMaster(LogicInterface::ScopeEndpoint endpoint) {
202-
TapedOutput::print("F MAST t", omp_get_thread_num(), "endp", endpoint);
201+
virtual void onMasked(LogicInterface::ScopeEndpoint endpoint) {
202+
TapedOutput::print("F MASK t", omp_get_thread_num(), "endp", endpoint);
203203
}
204204

205205
virtual void onSetAdjointAccessMode(LogicInterface::AdjointAccessMode adjointAccess) {
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,42 +31,42 @@
3131

3232
#include "instrument/ompLogicInstrumentInterface.hpp"
3333

34-
#include "masterOmpLogic.hpp"
34+
#include "maskedOmpLogic.hpp"
3535

36-
void opdi::MasterOmpLogic::reverseFunc(void *dataPtr) {
36+
void opdi::MaskedOmpLogic::reverseFunc(void *dataPtr) {
3737

3838
#if OPDI_OMP_LOGIC_INSTRUMENT
3939
Data* data = static_cast<Data*>(dataPtr);
4040
for (auto& instrument : ompLogicInstruments) {
41-
instrument->reverseMaster(data);
41+
instrument->reverseMasked(data);
4242
}
4343
#else
4444
OPDI_UNUSED(dataPtr);
4545
#endif
4646
}
4747

48-
void opdi::MasterOmpLogic::deleteFunc(void* dataPtr) {
48+
void opdi::MaskedOmpLogic::deleteFunc(void* dataPtr) {
4949

5050
Data* data = static_cast<Data*>(dataPtr);
5151
delete data;
5252
}
5353

54-
void opdi::MasterOmpLogic::onMaster(ScopeEndpoint endpoint) {
54+
void opdi::MaskedOmpLogic::onMasked(ScopeEndpoint endpoint) {
5555

5656
#if OPDI_OMP_LOGIC_INSTRUMENT
5757
if (tool->getThreadLocalTape() != nullptr && tool->isActive(tool->getThreadLocalTape())) {
5858

5959
for (auto& instrument : ompLogicInstruments) {
60-
instrument->onMaster(endpoint);
60+
instrument->onMasked(endpoint);
6161
}
6262

6363
Data* data = new Data;
6464
data->endpoint = endpoint;
6565

6666
Handle* handle = new Handle;
6767
handle->data = static_cast<void*>(data);
68-
handle->reverseFunc = MasterOmpLogic::reverseFunc;
69-
handle->deleteFunc = MasterOmpLogic::deleteFunc;
68+
handle->reverseFunc = MaskedOmpLogic::reverseFunc;
69+
handle->deleteFunc = MaskedOmpLogic::deleteFunc;
7070
tool->pushExternalFunction(tool->getThreadLocalTape(), handle);
7171
}
7272
#else
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
namespace opdi {
3131

32-
struct MasterOmpLogic : public virtual LogicInterface {
32+
struct MaskedOmpLogic : public virtual LogicInterface {
3333
public:
3434

3535
using LogicInterface::ScopeEndpoint;
@@ -45,6 +45,6 @@ namespace opdi {
4545

4646
public:
4747

48-
virtual void onMaster(ScopeEndpoint endpoint);
48+
virtual void onMasked(ScopeEndpoint endpoint);
4949
};
5050
}

include/opdi/logic/omp/ompLogic.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
std::list<opdi::OmpLogicInstrumentInterface*> opdi::ompLogicInstruments;
3939

4040
#include "implicitTaskOmpLogic.cpp"
41-
#include "masterOmpLogic.cpp"
41+
#include "maskedOmpLogic.cpp"
4242
#include "mutexOmpLogic.cpp"
4343
#include "parallelOmpLogic.cpp"
4444
#include "syncRegionOmpLogic.cpp"

include/opdi/logic/omp/ompLogic.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434

3535
#include "flushOmpLogic.hpp"
3636
#include "implicitTaskOmpLogic.hpp"
37-
#include "masterOmpLogic.hpp"
37+
#include "maskedOmpLogic.hpp"
3838
#include "mutexOmpLogic.hpp"
3939
#include "parallelOmpLogic.hpp"
4040
#include "syncRegionOmpLogic.hpp"
@@ -44,7 +44,7 @@ namespace opdi {
4444

4545
struct OmpLogic : public FlushOmpLogic,
4646
public ImplicitTaskOmpLogic,
47-
public MasterOmpLogic,
47+
public MaskedOmpLogic,
4848
public MutexOmpLogic,
4949
public ParallelOmpLogic,
5050
public SyncRegionOmpLogic,

0 commit comments

Comments
 (0)