Skip to content

Commit 3d8f4ab

Browse files
committed
Merge branch 'gitlab_ci' into develop
Add Gitlab CI pipeline to OpDiLib.
2 parents 5ea721b + 31fa9e0 commit 3d8f4ab

4 files changed

Lines changed: 66 additions & 15 deletions

File tree

.gitlab-ci.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
default:
2+
tags:
3+
- docker
4+
5+
test-gcc-macro:
6+
image: ubuntu:22.04
7+
timeout: 2h
8+
script:
9+
- apt update && apt install -y build-essential binutils git
10+
- git clone --depth 1 --branch develop https://github.com/SciCompKL/CoDiPack.git
11+
- export CODI_DIR=$(pwd)/CoDiPack/include
12+
- export OPDI_DIR=$(pwd)/include
13+
- cd tests
14+
- export CXX=g++
15+
- make all
16+
17+
test-clang-macro:
18+
image: fedora:39
19+
timeout: 2h
20+
script:
21+
- dnf install -y diffutils binutils clang git
22+
- git clone --depth 1 --branch develop https://github.com/SciCompKL/CoDiPack.git
23+
- export CODI_DIR=$(pwd)/CoDiPack/include
24+
- export OPDI_DIR=$(pwd)/include
25+
- cd tests
26+
- export CXX=clang++
27+
- make all
28+
29+
test-clang-ompt:
30+
image: fedora:39
31+
timeout: 2h
32+
script:
33+
- dnf install -y diffutils binutils clang git
34+
- git clone --depth 1 --branch develop https://github.com/SciCompKL/CoDiPack.git
35+
- export CODI_DIR=$(pwd)/CoDiPack/include
36+
- export OPDI_DIR=$(pwd)/include
37+
- cd tests
38+
- export CXX=clang++
39+
- export BACKEND=OMPT
40+
- make all
41+

include/opdi/backend/macro/reductionTools.hpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,9 @@ namespace opdi {
5757
}
5858
ReductionTools::reductionBarrierStack.pop();
5959
if (ProbeScopeStatus::insideImplicitTaskProbeScope()) {
60-
#if defined(__GNUC__) && !defined(__clang__)
61-
opdi_set_lock(&globalReducerLock);
62-
opdi_unset_lock(&globalReducerLock);
63-
#else
64-
logic->onSyncRegion(LogicInterface::SyncRegionKind::BarrierImplementation,
65-
LogicInterface::ScopeEndpoint::End);
66-
#endif
60+
#pragma omp barrier
61+
logic->onSyncRegion(LogicInterface::SyncRegionKind::BarrierImplementation,
62+
LogicInterface::ScopeEndpoint::End);
6763
}
6864
}
6965

tests/Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,14 @@ link:
148148
$(patsubst %,run%,$(DRIVERS)): DRIVER_TESTS = $(call getDriverTests, $(subst run,,$@))
149149
$(patsubst %,run%,$(DRIVERS)): DRIVER = $(subst run,,$@)
150150
$(patsubst %,run%,$(DRIVERS)):
151-
@ for test in ${DRIVER_TESTS}; \
151+
@rm -f testresults; \
152+
for test in ${DRIVER_TESTS}; \
152153
do \
153154
bash run.sh ${DRIVER} $$test $(MODE) $(EXPLICIT_PREPROCESSOR); \
154-
done;
155+
done; \
156+
if grep -q 1 testresults; then \
157+
exit 1; \
158+
fi;
155159

156160
# execute all tests
157161
.PHONY: run
@@ -169,3 +173,4 @@ clean:
169173
rm -r -f build
170174
rm -f tempmakefile
171175
rm -f results/*.out
176+
rm -f testresults

tests/run.sh

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,23 @@ fi
3737

3838
case "$MODE" in
3939
"RUN")
40-
./$BUILD_DIR/$LAUNCH_NAME 1> $RESULT_DIR/$DRIVER$TEST.out
41-
if cmp -s $RESULT_DIR/$DRIVER$TEST.ref $RESULT_DIR/$DRIVER$TEST.out;
40+
timeout 5m ./$BUILD_DIR/$LAUNCH_NAME 1> $RESULT_DIR/$DRIVER$TEST.out;
41+
ret=$?
42+
if [[ $ret -ne 0 ]];
4243
then
43-
echo -e $DRIVER$TEST "\e[0;32mOK\e[0m";
44+
echo -e $DRIVER$TEST "\e[0;31mTIMEOUT\e[0m";
45+
echo "1" >> testresults;
4446
else
45-
echo -e $DRIVER$TEST "\e[0;31mFAILED\e[0m";
46-
diff $RESULT_DIR/$DRIVER$TEST.ref $RESULT_DIR/$DRIVER$TEST.out;
47-
fi;
47+
if cmp -s $RESULT_DIR/$DRIVER$TEST.ref $RESULT_DIR/$DRIVER$TEST.out;
48+
then
49+
echo -e $DRIVER$TEST "\e[0;32mOK\e[0m";
50+
echo "0" >> testresults;
51+
else
52+
echo -e $DRIVER$TEST "\e[0;31mFAILED\e[0m";
53+
diff $RESULT_DIR/$DRIVER$TEST.ref $RESULT_DIR/$DRIVER$TEST.out;
54+
echo "1" >> testresults;
55+
fi;
56+
fi;
4857
;;
4958
"REF")
5059
./$BUILD_DIR/$LAUNCH_NAME > $RESULT_DIR/$DRIVER$TEST.ref

0 commit comments

Comments
 (0)