Skip to content

Commit 294807b

Browse files
committed
OpDiLib release v2.0.0
Interface changes Macros - OPDI_CRITICAL_NAME macro no longer accepts arguments other than name - new OPDI_CRITICAL_NAME_ARGS macro - new OPDI_MASKED, OPDI_END_MASKED macros - new OPDI_SINGLE_COPYPRIVATE, OPDI_SINGLE_COPYPRIVATE_NOWAIT macros Layer interfaces - introduce OmpLogicInterface::beginSkippedParallelRegion, OmpLogicInterface::endSkippedParallelRegion - refactor OmpLogicInterface::resetTask -> OmpLogicInterface::resetImplicitTask - changed offset in enums OmpLogicInterface::ScopeEndpoint and OmpLogicInterface::SyncRegionKind - introduce BackendInterface::getCriticalIdentifier, BackendInterface::getReductionIdentifier, BackendInterface::getOrderedIdentifier - refactor BackendInterface::getNestedLockIdentifier -> BackendInterface::getNestLockIdentifier - refactor BackedInterface::getTaskData -> BackendInterface::getImplicitTaskData Compiler options - introduce OPDI_BACKEND_GENERATE_MASKED_EVENTS, OPDI_BACKEND_GENERATE_WORK_EVENTS, OPDI_OMPT_BACKEND_IMPLICIT_TASK_END_SOURCE, OPDI_OMPT_BACKEND_BARRIER_IMPLEMENTATION_BEHAVIOUR, OPDI_OMP_LOGIC_CLEAR_ADJOINTS, OPDI_SYNC_REGION_BARRIER_BEHAVIOUR, OPDI_SYNC_REGION_BARRIER_IMPLICIT_BEHAVIOUR, OPDI_SYNC_REGION_BARRIER_EXPLICIT_BEHAVIOUR, OPDI_SYNC_REGION_BARRIER_IMPLEMENTATION_BEHAVIOUR, OPDI_SYNC_REGION_BARRIER_REVERSE_BEHAVIOUR Instrumentation - all functions in OmpLogicInstrumentInterface receive AD data as parameters - calls to instrumentation occur under the same conditions as AD treatment, like tape activity Features - support for custom mutexes - support for masked construct - support for broadcasts via single copyprivate - provide EmptyTool as a default tool layer implementation - support for disabling OpDiLib at runtime: set opdi::tool to an instance of EmptyTool (preferred) or nullptr - endpoints of sync regions that result in reverse barriers become configurable - optionally use the implicit barriers at the end of parallel regions to produce ImplicitTaskEnd events of non-primary threads - expose mechanism to skip AD treatment of parallel regions - backend-independent solution for copy operations at the beginning of parallel regions - optionally clear adjoints as part of tape resets - the OMPT backend's implementation of opdi_* functions can be included as a default runtime implementation - syntax checking supports local enablind/disabling via // opdi-syntax-on, // opdi-syntax-off - additions to syntax definition - modernize declaration of custom reductions - faster tests, extended test suite and CI pipeline (see below) - changes of OmpLogicOutputInstrument in accordance with other changes in OpDiLib Performance improvements - implicit barriers on parallel regions do not produce reverse barriers - generating events for masked constructs and worksharing constructs becomes optional - MutexOmpLogic::onMutexReleased no longer acquires an internal mutex - reductions in the macro backend no longer require additional internal locks, address of parallel data as wait identifier - ordered constructs in the macro backend no longer share their wait identifier, use address of parallel data as wait identifier Refactoring and code quality - refactor MutexOmpLogic, more expressive names and reduced boilerplate, comments regarding thread-safety - refactor ParallelOmpLogic and ImplicitTaskOmpLogic, more expressive names and fewer void* pointers - transition from master to masked throughout OpDiLib - remove ProbeScopeStatus, resolve order of ImplicitTaskProbe and ReductionProbe via omp_get_level - dedicated header file for macros related to thread sanitizer - refactoring of further smaller aspects throughout OpDiLib - add warnings, errors, and assertions throughout OpDiLib Fixes - ensure that setAdjointAccessMode has no effect when called in the reverse pass - address compiler warnings - fix bug in application of syntax checking to a single file - fix ranges in TestExternalFunctionLocal for small data and/or many threads - fix memory leak: implicit tasks free allocated tape positions Tests Test suite - test suite moves from C++11 to C++17 - testing with strict warning levels - updated image versions - new tests: TestCriticalNameHint, TestExternalFunctionLogicCalls, TestCustomMutex, TestSingleCopyprivate, TestSingleCopyprivateNowait, TestParallelCopyin, TestParallelFirstprivate, TestParallelFirstprivate2, TestParallelForLastprivate, TestOrderedMultiple, TestOrderedNowait, TestOrderedReduction, TestLock2 - new drivers - DriverPrimal for primal computations in the presence of OpDiLib - DriverFirstOrderForward for the tapeless forward mode of AD in the presence of OpDiLib - DriverFirstOrderReverseVector for vector mode tests - drivers specify associated tests explicitly - introduce driver-specific flags - where possible, prefer OpDiLib's tool interface over direct interaction with the OO AD tool - faster tests - smaller internal data sets - default to -O1 - automatic deduction of appropriate parallelism - tests do not use atomics for reversal of serial parts - instrumentation no longer tied to debug mode - support for excluding specific tests and drivers from testing - container file for thread sanitizer tests CI pipeline - test different configurations of OpDiLib - source of ImplicitTaskEnd events - generation of events for masked constructs, worksharing constructs - automated syntax checking - tests with address sanitizer - tests with thread sanitizer Miscellaneous - parallel regions suspend recording on the encountering task's tape - barriers always produce events for both endpoints - backend layer becomes responsible for producing events for both reduction-related barriers - new newsletter address - Zenodo publication Merge branch 'develop'
2 parents 2173b3c + c56a83d commit 294807b

748 files changed

Lines changed: 15061 additions & 8745 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitlab-ci.yml

Lines changed: 54 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,54 @@
11
default:
2+
timeout: 2h
23
tags:
34
- docker
45

5-
test-gcc-macro:
6-
image: ubuntu:22.04
7-
timeout: 2h
6+
gcc-macro:
7+
image: ubuntu:24.04
88
script:
99
- apt update && apt install -y build-essential binutils git
1010
- git clone --depth 1 --branch develop https://github.com/SciCompKL/CoDiPack.git
1111
- export CODI_DIR=$(pwd)/CoDiPack/include
1212
- export OPDI_DIR=$(pwd)/include
1313
- cd tests
1414
- export CXX=g++
15+
- export OMP_NUM_THREADS=$(expr $(nproc --all) / 2)
1516
- make all
1617

17-
test-clang-macro:
18-
image: fedora:39
19-
timeout: 2h
18+
clang-macro:
19+
image: fedora:42
20+
parallel:
21+
matrix:
22+
- FLAGS: ["", "-DOPDI_BACKEND_GENERATE_MASKED_EVENTS=1 -DOPDI_BACKEND_GENERATE_WORK_EVENTS=1"]
2023
script:
2124
- dnf install -y diffutils binutils clang git
2225
- git clone --depth 1 --branch develop https://github.com/SciCompKL/CoDiPack.git
2326
- export CODI_DIR=$(pwd)/CoDiPack/include
2427
- export OPDI_DIR=$(pwd)/include
2528
- cd tests
2629
- export CXX=clang++
30+
- export OMP_NUM_THREADS=$(expr $(nproc --all) / 2)
2731
- make all
2832

29-
test-clang-ompt:
30-
image: fedora:39
31-
timeout: 2h
33+
clang-ompt:
34+
image: fedora:42
35+
parallel:
36+
matrix:
37+
- FLAGS: ["-DOPDI_OMPT_BACKEND_IMPLICIT_TASK_END_SOURCE=1", "-DOPDI_OMPT_BACKEND_IMPLICIT_TASK_END_SOURCE=2", "-DOPDI_BACKEND_GENERATE_MASKED_EVENTS=1 -DOPDI_BACKEND_GENERATE_WORK_EVENTS=1"]
3238
script:
3339
- dnf install -y diffutils binutils clang git
3440
- git clone --depth 1 --branch develop https://github.com/SciCompKL/CoDiPack.git
3541
- export CODI_DIR=$(pwd)/CoDiPack/include
3642
- export OPDI_DIR=$(pwd)/include
3743
- cd tests
3844
- export CXX=clang++
45+
- export CXXFLAGS="$FLAGS"
3946
- export BACKEND=OMPT
47+
- export OMP_NUM_THREADS=$(expr $(nproc --all) / 2)
4048
- make all
4149

42-
test-output:
43-
image: ubuntu:22.04
44-
timeout: 2h
50+
output:
51+
image: ubuntu:24.04
4552
script:
4653
- apt update && apt install -y build-essential binutils git
4754
- git clone --depth 1 --branch develop https://github.com/SciCompKL/CoDiPack.git
@@ -51,4 +58,39 @@ test-output:
5158
- export CXX=g++
5259
- export OUTPUT_INSTRUMENT=yes
5360
- export STDERR_OUTPUT_IS_ERROR=no
61+
- export OMP_NUM_THREADS=$(expr $(nproc --all) / 2)
62+
- make all
63+
64+
syntax:
65+
image: ubuntu:24.04
66+
script:
67+
- apt update
68+
- DEBIAN_FRONTEND=noninteractive apt install -y tzdata
69+
- apt install -y python3
70+
- python3 syntax/check.py -r syntax/opdi.syntax.json tests macroexample.cpp omptexample.cpp
71+
72+
address-sanitizer:
73+
image: ubuntu:24.04
74+
script:
75+
- apt update && apt install -y build-essential binutils git clang libomp-dev
76+
- git clone --depth 1 --branch develop https://github.com/SciCompKL/CoDiPack.git
77+
- export CODI_DIR=$(pwd)/CoDiPack/include
78+
- export OPDI_DIR=$(pwd)/include
79+
- cd tests
80+
- export CXX=clang++
81+
- export CXXFLAGS="-g -fsanitize=address -fno-omit-frame-pointer"
82+
- export OMP_NUM_THREADS=$(expr $(nproc --all) / 2)
83+
- make all
84+
85+
thread-sanitizer:
86+
image: $CI_REGISTRY/$CI_PROJECT_NAMESPACE/opdilib/opdi-tsan
87+
script:
88+
- git clone --depth 1 --branch develop https://github.com/SciCompKL/CoDiPack.git
89+
- export CODI_DIR=$(pwd)/CoDiPack/include
90+
- export OPDI_DIR=$(pwd)/include
91+
- cd tests
92+
- export CXX=g++
93+
- export CXXFLAGS="$CXXFLAGS -g"
94+
- export EXCLUDE_TESTS="CriticalLock CriticalName CriticalNameHint OrderedNowait ParallelNested PreaccumulationLocal SectionsNowait"
95+
- export OMP_NUM_THREADS=$(expr $(nproc --all) / 2)
5496
- make all

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@
55
It makes use of modern OpenMP features around OMPT to deduce a parallel reverse pass without any additional modifications of the parallel source code. Additionally, we provide a second mode of operation that works via replacement macros for OpenMP's directives and clauses as well as replacements for OpenMP's runtime functions. This mode of operation can also be used with compilers that do not support OMPT. There are no restrictions on data access patterns so that a first differentiated parallel code is obtained with little to no effort. As a next step, the parallel performance of the reverse pass can be optimized with various tools. One important aspect is disabling atomic updates on adjoint variables where appropriate. If the underlying AD tool is capable of differentiating MPI, for example via the add-on [MeDiPack](https://scicomp.rptu.de/software/medi/), OpDiLib can also be employed for a differentiation of OpenMP-MPI hybrid parallel codes.
66

77
The [Scientific Computing Group](https://scicomp.rptu.de) at the University of Kaiserslautern-Landau (RPTU) develops OpDiLib and will enhance and extend OpDiLib in the future.
8-
There is a newsletter available at [opdi-info@scicomp.uni-kl.de](https://lists.uni-kl.de/scicomp/subscribe/opdi-info).
8+
There is a newsletter available at [scicomp-opdi-info@lists.rptu.de](https://lists.rptu.de/wws/subscribe/scicomp-opdi-info).
99
If you want to contact us, please write a mail to [opdi@scicomp.uni-kl.de](mailto:opdi@scicomp.uni-kl.de).
1010

11+
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.17553572.svg)](https://doi.org/10.5281/zenodo.17553572)
12+
1113
## OpenMP Support
1214

13-
OpDiLib supports all directives, clauses and runtime functions of the OpenMP 2.5 specification with the exception of
15+
OpDiLib supports all directives, clauses and runtime functions of the OpenMP 2.5 specification, in the way they are reflected in recent versions of OpenMP. Exceptions are
1416

1517
- `atomic` directives,
1618
- `flush` directives.
@@ -132,8 +134,8 @@ int main(int nargs, char** args) {
132134
y.setGradient(1.0);
133135
134136
opdi::logic->prepareEvaluate(); // prepare OpDiLib for evaluation
135-
136137
tape.evaluate();
138+
opdi::logic->postEvaluate(); // OpDiLib-specific postprocessing
137139
138140
std::cout << "f(" << x << ") = " << y << std::endl;
139141
std::cout << "df/dx(" << x << ") = " << x.getGradient() << std::endl;
@@ -156,7 +158,7 @@ int main(int nargs, char** args) {
156158
The following command can be used to compile the code.
157159

158160
~~~~{.txt}
159-
clang++ -I<path to codi>/include -I<path to opdi>/include -DCODI_EnableOpenMP -DCODI_EnableOpDiLib --std=c++11 -fopenmp -o omptexample omptexample.cpp
161+
clang++ -I<path to codi>/include -I<path to opdi>/include -DCODI_EnableOpenMP -DCODI_EnableOpDiLib --std=c++17 -fopenmp -o omptexample omptexample.cpp
160162
~~~~
161163

162164
### Macro Backend
@@ -222,8 +224,8 @@ int main(int nargs, char** args) {
222224
y.setGradient(1.0);
223225
224226
opdi::logic->prepareEvaluate(); // prepare OpDiLib for evaluation
225-
226227
tape.evaluate();
228+
opdi::logic->postEvaluate(); // OpDiLib-specific postprocessing
227229
228230
std::cout << "f(" << x << ") = " << y << std::endl;
229231
std::cout << "df/dx(" << x << ") = " << x.getGradient() << std::endl;
@@ -247,6 +249,6 @@ int main(int nargs, char** args) {
247249
The following command can be used to compile the code.
248250

249251
~~~~{.txt}
250-
clang++ -I<path to codi>/include -I<path to opdi>/include -DCODI_EnableOpenMP -DCODI_EnableOpDiLib --std=c++11 -fopenmp -o macroexample macroexample.cpp
252+
clang++ -I<path to codi>/include -I<path to opdi>/include -DCODI_EnableOpenMP -DCODI_EnableOpDiLib --std=c++17 -fopenmp -o macroexample macroexample.cpp
251253
~~~~
252254

containers/Dockerfile.opdi.tsan

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
FROM ubuntu:24.04
2+
3+
RUN DEBIAN_FRONTEND=noninteractive apt update && apt install -y build-essential binutils git curl flex
4+
5+
RUN \
6+
cd / \
7+
&& git clone --depth 1 --branch releases/gcc-15.2.0 git://gcc.gnu.org/git/gcc.git gcc_sources \
8+
&& cd gcc_sources \
9+
&& ./contrib/download_prerequisites \
10+
&& cd / \
11+
&& mkdir gcc_objdir \
12+
&& cd gcc_objdir \
13+
&& /gcc_sources/configure --prefix=/gcc_install --enable-languages=c,c++ --disable-linux-futex --disable-multilib \
14+
&& make -j $(nproc --all) \
15+
&& make install \
16+
&& cd / \
17+
&& rm -rf gcc_sources \
18+
&& rm -rf gcc_objdir
19+
20+
ENV LD_LIBRARY_PATH=/gcc_install/lib64:$LD_LIBRARY_PATH
21+
ENV CXXFLAGS="-I/gcc_install/include/c++/15.2.0 -I/gcc_install/include/c++/15.2.0/x86_64-pc-linux-gnu -fsanitize=thread"
22+
ENV CFLAGS="-I/gcc_install/include/c++/15.2.0 -I/gcc_install/include/c++/15.2.0/x86_64-pc-linux-gnu -fsanitize=thread"
23+
ENV LDFLAGS="-L/gcc_install/lib64 -fsanitize=thread"
24+
ENV PATH=/gcc_install/bin:$PATH
25+
ENV TSAN_OPTIONS="history_size=7 halt_on_error=1"

include/opdi/backend/backendInterface.hpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,13 @@ namespace opdi {
3939
virtual void finalize() = 0;
4040

4141
virtual std::size_t getLockIdentifier(omp_lock_t* lock) = 0;
42-
virtual std::size_t getNestedLockIdentifier(omp_nest_lock_t* lock) = 0;
42+
virtual std::size_t getNestLockIdentifier(omp_nest_lock_t* lock) = 0;
43+
virtual std::size_t getCriticalIdentifier(std::string const& name) = 0;
44+
virtual std::size_t getReductionIdentifier() = 0;
45+
virtual std::size_t getOrderedIdentifier() = 0;
4346

4447
virtual void* getParallelData() = 0;
45-
virtual void* getTaskData() = 0;
48+
virtual void* getImplicitTaskData() = 0;
4649

4750
virtual void setInitialImplicitTaskData(void* data) = 0;
4851
};

include/opdi/backend/macro/dataTools.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ namespace opdi {
3434
static std::stack<void*> parallelData;
3535
#pragma omp threadprivate(parallelData)
3636

37-
static std::stack<void*> taskData;
38-
#pragma omp threadprivate(taskData)
37+
static std::stack<void*> implicitTaskData;
38+
#pragma omp threadprivate(implicitTaskData)
3939

4040
public:
4141
static void pushParallelData(void* parallelData) {
@@ -54,20 +54,20 @@ namespace opdi {
5454
return DataTools::parallelData.top();
5555
}
5656

57-
static void pushTaskData(void* taskData) {
58-
DataTools::taskData.push(taskData);
57+
static void pushTaskData(void* implicitTaskData) {
58+
DataTools::implicitTaskData.push(implicitTaskData);
5959
}
6060

6161
static void popTaskData() {
62-
DataTools::taskData.pop();
62+
DataTools::implicitTaskData.pop();
6363
}
6464

65-
static void* getTaskData() {
66-
if (DataTools::taskData.empty()) {
65+
static void* getImplicitTaskData() {
66+
if (DataTools::implicitTaskData.empty()) {
6767
return nullptr;
6868
}
6969

70-
return DataTools::taskData.top();
70+
return DataTools::implicitTaskData.top();
7171
}
7272
};
7373
}

include/opdi/backend/macro/implicitBarrierTools.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ namespace opdi {
4848
if (ImplicitBarrierTools::implicitBarrierStack.top()) {
4949
logic->onSyncRegion(LogicInterface::SyncRegionKind::BarrierImplicit,
5050
LogicInterface::ScopeEndpoint::Begin);
51+
logic->onSyncRegion(LogicInterface::SyncRegionKind::BarrierImplicit,
52+
LogicInterface::ScopeEndpoint::End);
5153
ImplicitBarrierTools::implicitBarrierStack.pop();
5254
}
5355
}

include/opdi/backend/macro/macroBackend.cpp

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,17 @@
3030
// static macro backend members
3131

3232
std::stack<void*> opdi::DataTools::parallelData;
33-
std::stack<void*> opdi::DataTools::taskData;
33+
std::stack<void*> opdi::DataTools::implicitTaskData;
3434

3535
std::stack<bool> opdi::ImplicitBarrierTools::implicitBarrierStack;
3636

37-
omp_lock_t opdi::ReductionTools::globalReducerLock;
38-
std::list<omp_nest_lock_t*> opdi::ReductionTools::individualReducerLocks;
39-
std::stack<bool> opdi::ReductionTools::reductionBarrierStack;
37+
std::stack<bool> opdi::ReductionTools::hasReductions;
38+
std::stack<bool> opdi::ReductionTools::needsBarrierBeforeReductions;
39+
std::stack<bool> opdi::ReductionTools::needsBarrierAfterReductions;
40+
int opdi::ReductionTools::implicitTaskNestingDepth = 0;
4041

41-
template<typename Type, int identifier>
42-
omp_nest_lock_t opdi::Reducer<Type, identifier>::reduceLock;
43-
44-
template<typename Type, int identifier>
45-
bool opdi::Reducer<Type, identifier>::isInitialized = false;
46-
47-
std::stack<opdi::ProbeScopeStatus::Status> opdi::ProbeScopeStatus::statusStack;
42+
template<typename Type>
43+
size_t opdi::Reducer<Type>::nConstructorCalls = 0;
4844

4945
// global macro backend variables
5046

@@ -69,8 +65,8 @@ namespace opdi {
6965

7066
void opdi_destroy_nest_lock(omp_nest_lock_t* lock) {
7167
omp_destroy_nest_lock(lock);
72-
opdi::logic->onMutexDestroyed(LogicInterface::MutexKind::NestedLock,
73-
opdi::backend->getNestedLockIdentifier(lock));
68+
opdi::logic->onMutexDestroyed(LogicInterface::MutexKind::NestLock,
69+
opdi::backend->getNestLockIdentifier(lock));
7470
}
7571

7672
void opdi_set_lock(omp_lock_t* lock) {
@@ -82,8 +78,8 @@ namespace opdi {
8278
omp_set_nest_lock(lock);
8379
int lockCount = omp_test_nest_lock(lock); // user triggered locks plus lock caused by test
8480
if (lockCount == 2) {
85-
opdi::logic->onMutexAcquired(LogicInterface::MutexKind::NestedLock,
86-
opdi::backend->getNestedLockIdentifier(lock));
81+
opdi::logic->onMutexAcquired(LogicInterface::MutexKind::NestLock,
82+
opdi::backend->getNestLockIdentifier(lock));
8783
}
8884
omp_unset_nest_lock(lock); // revert lock caused by test
8985
}
@@ -96,8 +92,8 @@ namespace opdi {
9692
void opdi_unset_nest_lock(omp_nest_lock_t* lock) {
9793
int lockCount = omp_test_nest_lock(lock); // user triggered locks plus lock caused by test
9894
if (lockCount == 2) {
99-
opdi::logic->onMutexReleased(LogicInterface::MutexKind::NestedLock,
100-
opdi::backend->getNestedLockIdentifier(lock));
95+
opdi::logic->onMutexReleased(LogicInterface::MutexKind::NestLock,
96+
opdi::backend->getNestLockIdentifier(lock));
10197
}
10298
omp_unset_nest_lock(lock); // revert lock caused by test
10399
omp_unset_nest_lock(lock); // user triggered unlock
@@ -114,8 +110,8 @@ namespace opdi {
114110
int opdi_test_nest_lock(omp_nest_lock_t* lock) {
115111
int lockCount = omp_test_nest_lock(lock);
116112
if (lockCount == 1) {
117-
opdi::logic->onMutexAcquired(LogicInterface::MutexKind::NestedLock,
118-
opdi::backend->getNestedLockIdentifier(lock));
113+
opdi::logic->onMutexAcquired(LogicInterface::MutexKind::NestLock,
114+
opdi::backend->getNestLockIdentifier(lock));
119115
}
120116
return lockCount;
121117
}

include/opdi/backend/macro/macroBackend.hpp

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
#include "macros.hpp"
4646
#include "mutexIdentifiers.hpp"
4747
#include "probes.hpp"
48-
#include "probeTools.hpp"
4948
#include "reductionTools.hpp"
5049

5150
namespace opdi {
@@ -58,37 +57,25 @@ namespace opdi {
5857
// remaining functions from backend interface
5958

6059
void init() {
61-
opdi_init_lock(&ReductionTools::globalReducerLock);
62-
6360
// task data for initial implicit task is created in the logic layer
6461
}
6562

6663
void finalize() {
6764
// pop task data associated with initial implicit task
6865
DataTools::popTaskData();
69-
assert(DataTools::getTaskData() == nullptr);
70-
71-
opdi_set_lock(&ReductionTools::globalReducerLock);
72-
73-
for (auto lock : ReductionTools::individualReducerLocks) {
74-
opdi_destroy_nest_lock(lock);
75-
}
76-
77-
opdi_unset_lock(&ReductionTools::globalReducerLock);
78-
79-
opdi_destroy_lock(&ReductionTools::globalReducerLock);
66+
assert(DataTools::getImplicitTaskData() == nullptr);
8067
}
8168

8269
void* getParallelData() {
8370
return DataTools::getParallelData();
8471
}
8572

86-
void* getTaskData() {
87-
return DataTools::getTaskData();
73+
void* getImplicitTaskData() {
74+
return DataTools::getImplicitTaskData();
8875
}
8976

9077
void setInitialImplicitTaskData(void* data) {
91-
assert(DataTools::getTaskData() == nullptr);
78+
assert(DataTools::getImplicitTaskData() == nullptr);
9279
DataTools::pushTaskData(data);
9380
}
9481
};

0 commit comments

Comments
 (0)