File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2727
2828#include < omp.h>
2929
30+ #include " ../../config.hpp"
3031#include " ../../helpers/macros.hpp"
3132
3233#include " implicitBarrierTools.hpp"
144145
145146#define OPDI_END_SECTION
146147
147- #define OPDI_MASTER (...) \
148- OPDI_PRAGMA (omp master __VA_ARGS__) \
149- { \
150- opdi::logic->onMaster (opdi::LogicInterface::ScopeEndpoint::Begin);
148+ #if OPDI_BACKEND_GENERATE_MASTER_EVENTS
149+ #define OPDI_MASTER (...) \
150+ OPDI_PRAGMA (omp master __VA_ARGS__) \
151+ { \
152+ opdi::logic->onMaster (opdi::LogicInterface::ScopeEndpoint::Begin);
151153
152- #define OPDI_END_MASTER \
153- opdi::logic->onMaster (opdi::LogicInterface::ScopeEndpoint::End); \
154- }
154+ #define OPDI_END_MASTER \
155+ opdi::logic->onMaster (opdi::LogicInterface::ScopeEndpoint::End); \
156+ }
157+ #else
158+ #define OPDI_MASTER (...) \
159+ OPDI_PRAGMA (omp master __VA_ARGS__) \
160+
161+ #define OPDI_END_MASTER /* empty */
162+ #endif
155163
156164// standalone macros
157165
Original file line number Diff line number Diff line change 2525
2626#pragma once
2727
28+ #include " ../../config.hpp"
2829#include " ../../helpers/exceptions.hpp"
2930#include " ../../helpers/macros.hpp"
3031#include " ../../logic/logicInterface.hpp"
Original file line number Diff line number Diff line change @@ -105,7 +105,9 @@ namespace opdi {
105105 SyncRegionCallbacks::init ();
106106 MutexCallbacks::init ();
107107 ReductionCallbacks::init ();
108- MasterCallbacks::init ();
108+ #if OPDI_BACKEND_GENERATE_MASTER_EVENTS
109+ MasterCallbacks::init ();
110+ #endif
109111
110112 return 1 ; // success
111113 }
@@ -115,7 +117,9 @@ namespace opdi {
115117 OPDI_UNUSED (toolData);
116118
117119 // finalize callback structures
118- MasterCallbacks::finalize ();
120+ #if OPDI_BACKEND_GENERATE_MASTER_EVENTS
121+ MasterCallbacks::finalize ();
122+ #endif
119123 ReductionCallbacks::finalize ();
120124 MutexCallbacks::finalize ();
121125 SyncRegionCallbacks::finalize ();
Original file line number Diff line number Diff line change 4646
4747/* ----- backend configuration ----- */
4848
49+ #ifndef OPDI_BACKEND_GENERATE_MASTER_EVENTS
50+ #define OPDI_BACKEND_GENERATE_MASTER_EVENTS 0
51+ #endif
52+
4953#ifndef OPDI_OMPT_BACKEND_IMPLICIT_TASK_END_SOURCE
5054 #define OPDI_OMPT_BACKEND_IMPLICIT_TASK_END_SOURCE OPDI_OMPT_IMPLICIT_TASK_END
5155#endif
You can’t perform that action at this time.
0 commit comments