Skip to content

Commit 7f370aa

Browse files
authored
enable cuda tests (#14)
* update base images. reenable ubuntu cuda ci * finished unit test cuda enablement * fix issue with constexpr capture...moved to static constexpr variables
1 parent 61a8c9f commit 7f370aa

35 files changed

+836
-486
lines changed

.github/workflows/continuousIntegration.yml

Lines changed: 85 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,18 @@ concurrency:
1313
jobs:
1414

1515
get_docker_image_tag_hash:
16-
runs-on: ubuntu-22.04
16+
runs-on: ubuntu-24.04
1717
outputs:
1818
DOCKER_IMAGE_TAG_HASH: ${{ steps.extract_docker_image_tag_hash.outputs.DOCKER_IMAGE_TAG_HASH }}
1919
steps:
2020
- name: Extract docker image tag hash
2121
id: extract_docker_image_tag_hash
2222
run: |
23-
echo "DOCKER_IMAGE_TAG_HASH=b838c3153fadcfd4cd37e4859a4b172581e08417" >> "$GITHUB_OUTPUT"
23+
echo "DOCKER_IMAGE_TAG_HASH=8222ff90b7e0083101204ce7f2c476ec23785a03" >> "$GITHUB_OUTPUT"
2424
2525
# code_style:
2626
# needs: [check_pull_request_is_not_a_draft]
27-
# runs-on: ubuntu-22.04
27+
# runs-on: ubuntu-24.04
2828
# steps:
2929
# - name: Checkout Repository
3030
# uses: actions/[email protected]
@@ -39,7 +39,7 @@ jobs:
3939
# run: ./scripts/ci_build_and_test.sh
4040

4141
doxygen_check:
42-
runs-on: ubuntu-22.04
42+
runs-on: ubuntu-24.04
4343
needs:
4444
- get_docker_image_tag_hash
4545
steps:
@@ -50,7 +50,7 @@ jobs:
5050
lfs: false
5151
- name: Check doxygen
5252
env:
53-
DOCKER_REPOSITORY: geosx/ubuntu:22.04-${{ needs.get_docker_image_tag_hash.outputs.DOCKER_IMAGE_TAG_HASH }}
53+
DOCKER_REPOSITORY: geosx/ubuntu:24.04-clang-${{ needs.get_docker_image_tag_hash.outputs.DOCKER_IMAGE_TAG_HASH }}
5454
HOST_CONFIG: hostconfigs/environment.cmake
5555
CMAKE_CXX_COMPILER: /usr/bin/clang++
5656
CMAKE_C_COMPILER: /usr/bin/clang
@@ -60,7 +60,7 @@ jobs:
6060

6161

6262
code_checks:
63-
runs-on: ubuntu-22.04
63+
runs-on: ubuntu-24.04
6464
needs:
6565
- get_docker_image_tag_hash
6666
steps:
@@ -71,7 +71,7 @@ jobs:
7171
lfs: false
7272
- name: code_checks
7373
env:
74-
DOCKER_REPOSITORY: geosx/ubuntu:22.04-${{ needs.get_docker_image_tag_hash.outputs.DOCKER_IMAGE_TAG_HASH }}
74+
DOCKER_REPOSITORY: geosx/ubuntu:24.04-clang-${{ needs.get_docker_image_tag_hash.outputs.DOCKER_IMAGE_TAG_HASH }}
7575
HOST_CONFIG: hostconfigs/environment.cmake
7676
CMAKE_CXX_COMPILER: /usr/bin/clang++
7777
CMAKE_C_COMPILER: /usr/bin/clang
@@ -89,127 +89,105 @@ jobs:
8989
fail-fast: false
9090
matrix:
9191
include:
92-
# - name: RHEL8.10-clang17-dbg (ubi8.10, clang-17.0.6, Debug)
93-
# DOCKER_REPOSITORY: geosx/ubi:8.10
94-
# RUNS_ON: ubuntu-22.04
95-
# CMAKE_CXX_COMPILER: clang++
96-
# CMAKE_C_COMPILER: clang
97-
# CMAKE_BUILD_TYPE: Debug
92+
- name: rocky-gcc-dbg (rockylinux8, gcc 14, Release)
93+
DOCKER_REPOSITORY: geosx/rockylinux:8-gcc
94+
RUNS_ON: ubuntu-24.04
95+
CMAKE_CXX_COMPILER: /opt/rh/gcc-toolset-13/root/usr/bin/g++
96+
CMAKE_C_COMPILER: /opt/rh/gcc-toolset-13/root/usr/bin/gcc
97+
CMAKE_BUILD_TYPE: Debug
9898

99-
# - name: RHEL8.10-clang17-rel (ubi8.10, clang-17.0.6, Release)
100-
# DOCKER_REPOSITORY: geosx/ubi:8.10
101-
# RUNS_ON: ubuntu-22.04
102-
# CMAKE_CXX_COMPILER: clang++
103-
# CMAKE_C_COMPILER: clang
104-
# CMAKE_BUILD_TYPE: Release
99+
- name: rocky-gcc-rel (rockylinux8, gcc 14, Release)
100+
DOCKER_REPOSITORY: geosx/rockylinux:8-gcc
101+
RUNS_ON: ubuntu-24.04
102+
CMAKE_CXX_COMPILER: /opt/rh/gcc-toolset-13/root/usr/bin/g++
103+
CMAKE_C_COMPILER: /opt/rh/gcc-toolset-13/root/usr/bin/gcc
104+
CMAKE_BUILD_TYPE: Release
105105

106-
# - name: RHEL8.10-gcc13-dbg (ubi8.10, gcc 13.2.1, Debug)
107-
# DOCKER_REPOSITORY: geosx/ubi:8.10
108-
# RUNS_ON: ubuntu-22.04
109-
# CMAKE_CXX_COMPILER: /opt/rh/gcc-toolset-13/root/bin/g++
110-
# CMAKE_C_COMPILER: /opt/rh/gcc-toolset-13/root/bin/gcc
111-
# CMAKE_BUILD_TYPE: Debug
106+
- name: rocky-clang-dbg (rockylinux8, clang-15, Debug)
107+
DOCKER_REPOSITORY: geosx/rockylinux:8-clang
108+
RUNS_ON: ubuntu-24.04
109+
CMAKE_CXX_COMPILER: /usr/bin/clang++
110+
CMAKE_C_COMPILER: /usr/bin/clang
111+
CMAKE_BUILD_TYPE: Debug
112112

113-
# - name: RHEL8.10-gcc13-rel (ubi8.10, gcc 13.2.1, Release)
114-
# DOCKER_REPOSITORY: geosx/ubi:8.10
115-
# RUNS_ON: ubuntu-22.04
116-
# CMAKE_CXX_COMPILER: /opt/rh/gcc-toolset-13/root/bin/g++
117-
# CMAKE_C_COMPILER: /opt/rh/gcc-toolset-13/root/bin/gcc
118-
# CMAKE_BUILD_TYPE: Release
113+
- name: rocky-clang-rel (rockylinux8, clang-15, Release)
114+
DOCKER_REPOSITORY: geosx/rockylinux:8-clang
115+
RUNS_ON: ubuntu-24.04
116+
CMAKE_CXX_COMPILER: /usr/bin/clang++
117+
CMAKE_C_COMPILER: /usr/bin/clang
118+
CMAKE_BUILD_TYPE: Release
119119

120-
- name: ubuntu22-gcc11-dbg (ubuntu-22, gcc 11.4.0, Release)
121-
DOCKER_REPOSITORY: geosx/ubuntu:22.04
122-
RUNS_ON: ubuntu-22.04
120+
- name: ubuntu24-gcc11-dbg (ubuntu-24, gcc 11.4.0, Release)
121+
DOCKER_REPOSITORY: geosx/ubuntu:24.04-gcc
122+
RUNS_ON: ubuntu-24.04
123123
CMAKE_CXX_COMPILER: /usr/bin/g++
124124
CMAKE_C_COMPILER: /usr/bin/gcc
125125
CMAKE_BUILD_TYPE: Debug
126126

127-
- name: ubuntu22-gcc11-rel (ubuntu-22, gcc 11.4.0, Release)
128-
DOCKER_REPOSITORY: geosx/ubuntu:22.04
129-
RUNS_ON: ubuntu-22.04
127+
- name: ubuntu24-gcc11-rel (ubuntu-24, gcc 11.4.0, Release)
128+
DOCKER_REPOSITORY: geosx/ubuntu:24.04-gcc
129+
RUNS_ON: ubuntu-24.04
130130
CMAKE_CXX_COMPILER: /usr/bin/g++
131131
CMAKE_C_COMPILER: /usr/bin/gcc
132132
CMAKE_BUILD_TYPE: Release
133133

134-
- name: ubuntu22-clang14-dbg (ubuntu-22, clang-14.0.0, Debug)
135-
DOCKER_REPOSITORY: geosx/ubuntu:22.04
136-
RUNS_ON: ubuntu-22.04
134+
- name: ubuntu24-clang18-dbg (ubuntu-24, clang-18.0.0, Debug)
135+
DOCKER_REPOSITORY: geosx/ubuntu:24.04-clang
136+
RUNS_ON: ubuntu-24.04
137137
CMAKE_CXX_COMPILER: /usr/bin/clang++
138138
CMAKE_C_COMPILER: /usr/bin/clang
139139
CMAKE_BUILD_TYPE: Debug
140140

141-
- name: ubuntu22-clang14-rel (ubuntu-22, clang-14.0.0, Release)
142-
DOCKER_REPOSITORY: geosx/ubuntu:22.04
143-
RUNS_ON: ubuntu-22.04
141+
- name: ubuntu24-clang18-rel (ubuntu-24, clang-18.0.0, Release)
142+
DOCKER_REPOSITORY: geosx/ubuntu:24.04-clang
143+
RUNS_ON: ubuntu-24.04
144144
CMAKE_CXX_COMPILER: /usr/bin/clang++
145145
CMAKE_C_COMPILER: /usr/bin/clang
146146
CMAKE_BUILD_TYPE: Release
147147

148-
# - name: ubuntu22-gcc11-cuda11-rel (ubuntu-22, gcc 11.4.0, cuda-11.8.0, Release)
149-
# DOCKER_REPOSITORY: geosx/ubuntu:22.04-cuda11.8
150-
# RUNS_ON: streak2
151-
# CMAKE_CXX_COMPILER: /usr/bin/g++
152-
# CMAKE_C_COMPILER: /usr/bin/gcc
153-
# CMAKE_BUILD_TYPE: Release
154-
# ENABLE_CUDA: ON
155-
# CMAKE_CUDA_ARCHITECTURES: "86"
156-
# NPROC: 4
157-
# DOCKER_RUN_ARGS: "--cpus=4 --memory=64g --runtime=nvidia --gpus all"
158-
159-
# - name: ubuntu22-gcc11-cuda11-dbg (ubuntu-22, gcc 11.4.0, cuda-11.8.0, Debug)
160-
# DOCKER_REPOSITORY: geosx/ubuntu:22.04-cuda11.8
161-
# RUNS_ON: streak2
162-
# CMAKE_CXX_COMPILER: /usr/bin/g++
163-
# CMAKE_C_COMPILER: /usr/bin/gcc
164-
# CMAKE_BUILD_TYPE: Debug
165-
# ENABLE_CUDA: ON
166-
# CMAKE_CUDA_ARCHITECTURES: "86"
167-
# NPROC: 4
168-
# DOCKER_RUN_ARGS: "--cpus=4 --memory=64g --runtime=nvidia --gpus all"
169-
170-
# - name: ubuntu22-clang14-cuda11-rel (ubuntu-22, clang-14.0.0, cuda-11.8.0, Release)
171-
# DOCKER_REPOSITORY: geosx/ubuntu:22.04-cuda11.8
172-
# RUNS_ON: streak2
173-
# CMAKE_CXX_COMPILER: /usr/bin/clang++
174-
# CMAKE_C_COMPILER: /usr/bin/clang
175-
# CMAKE_BUILD_TYPE: Release
176-
# ENABLE_CUDA: ON
177-
# CMAKE_CUDA_ARCHITECTURES: "86"
178-
# NPROC: 4
179-
# DOCKER_RUN_ARGS: "--cpus=4 --memory=64g --runtime=nvidia --gpus all"
148+
- name: ubuntu24-gcc11-cuda12-rel (ubuntu-24, gcc 11.4.0, cuda-12.9.1, Release)
149+
DOCKER_REPOSITORY: geosx/ubuntu:24.04-gcc-cuda12.9
150+
RUNS_ON: streak2
151+
CMAKE_CXX_COMPILER: /usr/bin/g++
152+
CMAKE_C_COMPILER: /usr/bin/gcc
153+
CMAKE_BUILD_TYPE: Release
154+
ENABLE_CUDA: ON
155+
CMAKE_CUDA_ARCHITECTURES: "86"
156+
NPROC: 4
157+
DOCKER_RUN_ARGS: "--cpus=4 --memory=64g --runtime=nvidia --gpus all"
180158

181-
# - name: ubuntu22-clang14-cuda11-dbg (ubuntu-22, clang-14.0.0, cuda-11.8.0, Debug)
182-
# DOCKER_REPOSITORY: geosx/ubuntu:22.04-cuda11.8
183-
# RUNS_ON: streak2
184-
# CMAKE_CXX_COMPILER: /usr/bin/clang++
185-
# CMAKE_C_COMPILER: /usr/bin/clang
186-
# CMAKE_BUILD_TYPE: Debug
187-
# ENABLE_CUDA: ON
188-
# CMAKE_CUDA_ARCHITECTURES: "86"
189-
# NPROC: 4
190-
# DOCKER_RUN_ARGS: "--cpus=4 --memory=64g --runtime=nvidia --gpus all"
159+
- name: ubuntu24-gcc11-cuda12-dbg (ubuntu-24, gcc 11.4.0, cuda-12.9.1, Debug)
160+
DOCKER_REPOSITORY: geosx/ubuntu:24.04-gcc-cuda12.9
161+
RUNS_ON: streak2
162+
CMAKE_CXX_COMPILER: /usr/bin/g++
163+
CMAKE_C_COMPILER: /usr/bin/gcc
164+
CMAKE_BUILD_TYPE: Debug
165+
ENABLE_CUDA: ON
166+
CMAKE_CUDA_ARCHITECTURES: "86"
167+
NPROC: 4
168+
DOCKER_RUN_ARGS: "--cpus=4 --memory=64g --runtime=nvidia --gpus all"
191169

192-
# - name: RHEL8.10-clang17-cuda12-rel (ubi8.10, clang-17.0.6, cuda-12.4.1, Release)
193-
# DOCKER_REPOSITORY: geosx/ubi:8.10-cuda12.8
194-
# RUNS_ON: streak2
195-
# CMAKE_CXX_COMPILER: clang++
196-
# CMAKE_C_COMPILER: clang
197-
# CMAKE_BUILD_TYPE: Release
198-
# ENABLE_CUDA: ON
199-
# CMAKE_CUDA_ARCHITECTURES: "86"
200-
# NPROC: 4
201-
# DOCKER_RUN_ARGS: "--cpus=4 --memory=64g --runtime=nvidia --gpus all"
170+
- name: ubuntu24-clang14-cuda12-rel (ubuntu-24, clang-14.0.0, cuda-12.9.1, Release)
171+
DOCKER_REPOSITORY: geosx/ubuntu:24.04-clang-cuda12.9
172+
RUNS_ON: streak2
173+
CMAKE_CXX_COMPILER: /usr/bin/clang++
174+
CMAKE_C_COMPILER: /usr/bin/clang
175+
CMAKE_BUILD_TYPE: Release
176+
ENABLE_CUDA: ON
177+
CMAKE_CUDA_ARCHITECTURES: "86"
178+
NPROC: 4
179+
DOCKER_RUN_ARGS: "--cpus=4 --memory=64g --runtime=nvidia --gpus all"
202180

203-
# - name: RHEL8.10-gcc13-cuda12-rel (ubi8.10, gcc 13.2.1, cuda-12.4.1, Release)
204-
# DOCKER_REPOSITORY: geosx/ubi:8.10-cuda12.8
205-
# RUNS_ON: streak2
206-
# CMAKE_CXX_COMPILER: /opt/rh/gcc-toolset-13/root/bin/g++
207-
# CMAKE_C_COMPILER: /opt/rh/gcc-toolset-13/root/bin/gcc
208-
# CMAKE_BUILD_TYPE: Release
209-
# ENABLE_CUDA: ON
210-
# CMAKE_CUDA_ARCHITECTURES: "86"
211-
# NPROC: 4
212-
# DOCKER_RUN_ARGS: "--cpus=4 --memory=64g --runtime=nvidia --gpus all"
181+
- name: ubuntu24-clang14-cuda12-dbg (ubuntu-24, clang-14.0.0, cuda-12.9.1, Debug)
182+
DOCKER_REPOSITORY: geosx/ubuntu:24.04-clang-cuda12.9
183+
RUNS_ON: streak2
184+
CMAKE_CXX_COMPILER: /usr/bin/clang++
185+
CMAKE_C_COMPILER: /usr/bin/clang
186+
CMAKE_BUILD_TYPE: Debug
187+
ENABLE_CUDA: ON
188+
CMAKE_CUDA_ARCHITECTURES: "86"
189+
NPROC: 4
190+
DOCKER_RUN_ARGS: "--cpus=4 --memory=64g --runtime=nvidia --gpus all"
213191

214192
steps:
215193
- name: Checkout Repository
@@ -247,7 +225,7 @@ jobs:
247225
lfs: false
248226
- name: run code coverage
249227
env:
250-
DOCKER_REPOSITORY: geosx/ubuntu:22.04-${{ needs.get_docker_image_tag_hash.outputs.DOCKER_IMAGE_TAG_HASH }}
228+
DOCKER_REPOSITORY: geosx/ubuntu:22.04-b838c3153fadcfd4cd37e4859a4b172581e08417
251229
HOST_CONFIG: hostconfigs/environment.cmake
252230
CMAKE_CXX_COMPILER: /usr/bin/g++
253231
CMAKE_C_COMPILER: /usr/bin/gcc
@@ -264,7 +242,7 @@ jobs:
264242

265243

266244
check_that_all_jobs_succeeded:
267-
runs-on: ubuntu-22.04
245+
runs-on: ubuntu-24.04
268246
needs:
269247
- get_docker_image_tag_hash
270248
- linux_builds

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ if( NOT is_submodule )
1919

2020
set( BLT_SOURCE_DIR ${PROJECT_SOURCE_DIR}/cmake/blt CACHE PATH "" )
2121
set( BLT_CXX_STD "c++17" CACHE STRING "Version of C++ standard" FORCE )
22+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
23+
set(CMAKE_CUDA_STANDARD_REQUIRED ON)
24+
2225
set( ENABLE_WARNINGS_AS_ERRORS "ON" CACHE PATH "" )
2326

2427
option( HPCREACT_ENABLE_UNIT_TESTS "Builds tests" ON )

cmake/CMakeBasics.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,10 @@ blt_append_custom_compiler_flag( FLAGS_VAR CMAKE_CXX_FLAGS_DEBUG
2626
CLANG "-fstandalone-debug"
2727
)
2828

29+
if( ENABLE_COVERAGE )
30+
blt_append_custom_compiler_flag( FLAGS_VAR CMAKE_CXX_FLAGS_DEBUG
31+
GNU "-O0 -fno-inline -fno-inline-functions -fno-inline-functions-called-once"
32+
)
33+
endif()
34+
2935
set( CAMP_ENABLE_TESTS OFF CACHE BOOL "")

cmake/blt

Submodule blt updated 610 files
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#################################################################################
2+
# Generated host-config - Edit at own risk!
3+
#################################################################################
4+
#--------------------------------------------------------------------------------
5+
# SYS_TYPE: toss_4_x86_64_ib
6+
# Compiler Spec: clang@=19.1.3
7+
# CMake executable path: /usr/tce/backend/installations/linux-rhel8-x86_64/gcc-10.3.1/cmake-3.26.3-nz532rvfpaf5lf74zxmplgiobuhol7lu/bin/cmake
8+
#--------------------------------------------------------------------------------
9+
10+
#--------------------------------------------------------------------------------
11+
# Compilers
12+
#--------------------------------------------------------------------------------
13+
14+
set(CMAKE_C_COMPILER "/usr/tce/packages/clang/clang-19.1.3-magic/bin/clang" CACHE PATH "")
15+
16+
set(CMAKE_CXX_COMPILER "/usr/tce/packages/clang/clang-19.1.3-magic/bin/clang++" CACHE PATH "")
17+
18+
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG -march=native -mtune=native" CACHE STRING "")
19+
20+
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g -DNDEBUG" CACHE STRING "")
21+
22+
set(CMAKE_CXX_FLAGS_DEBUG "-g" CACHE STRING "")
23+
24+
#--------------------------------------------------------------------------------
25+
# CMake Standard
26+
#--------------------------------------------------------------------------------
27+
28+
set(BLT_CXX_STD "c++17" CACHE STRING "")
29+
30+
31+
#--------------------------------------------------------------------------------
32+
# OpenMP
33+
#--------------------------------------------------------------------------------
34+
35+
set(ENABLE_OPENMP ON CACHE BOOL "")
36+
37+
#--------------------------------------------------------------------------------
38+
# Cuda
39+
#--------------------------------------------------------------------------------
40+
41+
set(ENABLE_CUDA OFF CACHE BOOL "")
42+
43+
#--------------------------------------------------------------------------------
44+
# System Math Libraries
45+
#--------------------------------------------------------------------------------
46+
47+
set(ENABLE_MKL ON CACHE BOOL "")
48+
49+
set(MKL_INCLUDE_DIRS "/usr/tce/packages/mkl/mkl-2022.1.0/include" CACHE PATH "")
50+
51+
set(MKL_LIBRARIES /usr/tce/packages/mkl/mkl-2022.1.0/mkl/2022.1.0/lib/intel64/libmkl_intel_lp64.so
52+
/usr/tce/packages/mkl/mkl-2022.1.0/mkl/2022.1.0/lib/intel64/libmkl_gnu_thread.so
53+
/usr/tce/packages/mkl/mkl-2022.1.0/mkl/2022.1.0/lib/intel64/libmkl_core.so
54+
/usr/tce/backend/installations/linux-rhel8-x86_64/gcc-13.3.1/llvm-19.1.3-gy2lu5xbi4csr2k47emlajzfs5mlsd4g/bin/../lib/x86_64-unknown-linux-gnu/libomp.so
55+
/lib64/libpthread.so
56+
/lib64/libm.so
57+
/lib64/libdl.so CACHE STRING "")

0 commit comments

Comments
 (0)