Skip to content

Commit 9f34de6

Browse files
committed
Make behaviour of OMPT backend configurable.
1 parent 007f750 commit 9f34de6

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

include/opdi/backend/ompt/syncRegionCallbacks.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,12 @@ namespace opdi {
8080
logic->onSyncRegion(LogicInterface::SyncRegionKind::BarrierExplicit, endpoint);
8181
break;
8282
case ompt_sync_region_barrier_implementation:
83+
#if OPDI_OMPT_BACKEND_BARRIER_IMPLEMENTATION_BEHAVIOUR == OPDI_PAIR_OF_AD_EVENTS_PER_ENDPOINT
8384
logic->onSyncRegion(LogicInterface::SyncRegionKind::BarrierImplementation, LogicInterface::ScopeEndpoint::Begin);
8485
logic->onSyncRegion(LogicInterface::SyncRegionKind::BarrierImplementation, LogicInterface::ScopeEndpoint::End);
86+
#else
87+
logic->onSyncRegion(LogicInterface::SyncRegionKind::BarrierImplementation, endpoint);
88+
#endif
8589
break;
8690
#if _OPENMP >= 202011
8791
case ompt_sync_region_barrier_implicit_parallel:

include/opdi/config.hpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@
2727

2828
/* ------------------ constants ------------------ */
2929

30-
/* backends */
31-
3230
#define OPDI_MACRO_BACKEND 1
3331
#define OPDI_OMPT_BACKEND 2
3432

@@ -42,6 +40,9 @@
4240
#define OPDI_OMPT_IMPLICIT_TASK_END 1
4341
#define OPDI_OMPT_SYNC_REGION_END 2
4442

43+
#define OPDI_PAIR_OF_AD_EVENTS_PER_ENDPOINT 1
44+
#define OPDI_SINGLE_AD_EVENT_PER_ENDPOINT 2
45+
4546
/* ------------------ configuration ------------------ */
4647

4748
/* ----- backend configuration ----- */
@@ -61,6 +62,12 @@
6162
static_assert(0 < OPDI_OMPT_BACKEND_IMPLICIT_TASK_END_SOURCE);
6263
static_assert(OPDI_OMPT_BACKEND_IMPLICIT_TASK_END_SOURCE <= 2);
6364

65+
#ifndef OPDI_OMPT_BACKEND_BARRIER_IMPLEMENTATION_BEHAVIOUR
66+
#define OPDI_OMPT_BACKEND_BARRIER_IMPLEMENTATION_BEHAVIOUR OPDI_PAIR_OF_AD_EVENTS_PER_ENDPOINT
67+
#endif
68+
69+
static_assert(0 < OPDI_OMPT_BACKEND_BARRIER_IMPLEMENTATION_BEHAVIOUR);
70+
static_assert(OPDI_OMPT_BACKEND_BARRIER_IMPLEMENTATION_BEHAVIOUR <= 2);
6471

6572
/* ----- logic configuration ----- */
6673

0 commit comments

Comments
 (0)