Skip to content

Commit fe1be01

Browse files
authored
Feature/initial bulk reactions (#2)
* basic repository setup * set up CI workflow * kinetic bulk chemistry based on law of mass action + species balance equation * equilibrium bulk chemistry based on law of mass action and reaction extents
1 parent 9cb1f6f commit fe1be01

39 files changed

+10914
-1
lines changed
Lines changed: 287 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,287 @@
1+
name: hpcReactCI
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
workflow_dispatch:
8+
9+
concurrency:
10+
group: ${{ github.workflow }}-${{ github.ref }}
11+
cancel-in-progress: true
12+
13+
jobs:
14+
15+
get_docker_image_tag_hash:
16+
runs-on: ubuntu-22.04
17+
outputs:
18+
DOCKER_IMAGE_TAG_HASH: ${{ steps.extract_docker_image_tag_hash.outputs.DOCKER_IMAGE_TAG_HASH }}
19+
steps:
20+
- name: Extract docker image tag hash
21+
id: extract_docker_image_tag_hash
22+
run: |
23+
echo "DOCKER_IMAGE_TAG_HASH=310f70ba6065b94858af2cafeba828ea76c02a1d" >> "$GITHUB_OUTPUT"
24+
25+
# code_style:
26+
# needs: [check_pull_request_is_not_a_draft]
27+
# runs-on: ubuntu-22.04
28+
# steps:
29+
# - name: Checkout Repository
30+
# uses: actions/[email protected]
31+
# with:
32+
# submodules: true
33+
# lfs: false
34+
# - name: Check style
35+
# env:
36+
# DOCKER_REPOSITORY: geosx/ubuntu20.04-gcc9
37+
# CMAKE_BUILD_TYPE: Release
38+
# BUILD_AND_TEST_ARGS: --test-code-style
39+
# run: ./scripts/ci_build_and_test.sh
40+
41+
doxygen_check:
42+
runs-on: ubuntu-22.04
43+
needs:
44+
- get_docker_image_tag_hash
45+
steps:
46+
- name: Checkout Repository
47+
uses: actions/[email protected]
48+
with:
49+
submodules: true
50+
lfs: false
51+
- name: Check doxygen
52+
env:
53+
DOCKER_REPOSITORY: geosx/ubuntu:22.04-${{ needs.get_docker_image_tag_hash.outputs.DOCKER_IMAGE_TAG_HASH }}
54+
HOST_CONFIG: hostconfigs/environment.cmake
55+
CMAKE_CXX_COMPILER: /usr/bin/clang++
56+
CMAKE_C_COMPILER: /usr/bin/clang
57+
CMAKE_BUILD_TYPE: Release
58+
BUILD_AND_TEST_ARGS: --test-doxygen
59+
run: ./scripts/ci_build_and_test.sh
60+
61+
62+
code_checks:
63+
runs-on: ubuntu-22.04
64+
needs:
65+
- get_docker_image_tag_hash
66+
steps:
67+
- name: Checkout Repository
68+
uses: actions/[email protected]
69+
with:
70+
submodules: true
71+
lfs: false
72+
- name: code_checks
73+
env:
74+
DOCKER_REPOSITORY: geosx/ubuntu:22.04-${{ needs.get_docker_image_tag_hash.outputs.DOCKER_IMAGE_TAG_HASH }}
75+
HOST_CONFIG: hostconfigs/environment.cmake
76+
CMAKE_CXX_COMPILER: /usr/bin/clang++
77+
CMAKE_C_COMPILER: /usr/bin/clang
78+
CMAKE_BUILD_TYPE: Release
79+
BUILD_AND_TEST_ARGS: --code-checks
80+
run: ./scripts/ci_build_and_test.sh
81+
82+
linux_builds:
83+
name: ${{matrix.name}}
84+
runs-on: ${{matrix.RUNS_ON}}
85+
needs:
86+
- get_docker_image_tag_hash
87+
strategy:
88+
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
89+
fail-fast: false
90+
matrix:
91+
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
98+
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
105+
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
112+
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
119+
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
123+
CMAKE_CXX_COMPILER: /usr/bin/g++
124+
CMAKE_C_COMPILER: /usr/bin/gcc
125+
CMAKE_BUILD_TYPE: Debug
126+
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
130+
CMAKE_CXX_COMPILER: /usr/bin/g++
131+
CMAKE_C_COMPILER: /usr/bin/gcc
132+
CMAKE_BUILD_TYPE: Release
133+
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
137+
CMAKE_CXX_COMPILER: /usr/bin/clang++
138+
CMAKE_C_COMPILER: /usr/bin/clang
139+
CMAKE_BUILD_TYPE: Debug
140+
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
144+
CMAKE_CXX_COMPILER: /usr/bin/clang++
145+
CMAKE_C_COMPILER: /usr/bin/clang
146+
CMAKE_BUILD_TYPE: Release
147+
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"
180+
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"
191+
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"
202+
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"
213+
214+
steps:
215+
- name: Checkout Repository
216+
uses: actions/[email protected]
217+
with:
218+
submodules: true
219+
lfs: false
220+
221+
- name: Print environment
222+
run: printenv
223+
224+
- name: Build and test
225+
env:
226+
DOCKER_REPOSITORY: ${{ matrix.DOCKER_REPOSITORY }}-${{ needs.get_docker_image_tag_hash.outputs.DOCKER_IMAGE_TAG_HASH }}
227+
CMAKE_CXX_COMPILER: ${{ matrix.CMAKE_CXX_COMPILER }}
228+
CMAKE_C_COMPILER: ${{ matrix.CMAKE_C_COMPILER }}
229+
CMAKE_BUILD_TYPE: ${{ matrix.CMAKE_BUILD_TYPE }}
230+
ENABLE_CUDA: ${{ matrix.ENABLE_CUDA }}
231+
CMAKE_CUDA_ARCHITECTURES: ${{ matrix.CMAKE_CUDA_ARCHITECTURES }}
232+
NPROC: ${{ matrix.NPROC }}
233+
BUILD_AND_TEST_ARGS: ${{ matrix.BUILD_AND_TEST_ARGS }} --build-exe
234+
DOCKER_RUN_ARGS: ${{ matrix.DOCKER_RUN_ARGS }}
235+
HOST_CONFIG: hostconfigs/environment.cmake
236+
run: ./scripts/ci_build_and_test.sh
237+
238+
code_coverage:
239+
runs-on: ubuntu-22.04
240+
needs:
241+
- get_docker_image_tag_hash
242+
steps:
243+
- name: Checkout Repository
244+
uses: actions/[email protected]
245+
with:
246+
submodules: true
247+
lfs: false
248+
- name: run code coverage
249+
env:
250+
DOCKER_REPOSITORY: geosx/ubuntu:22.04-${{ needs.get_docker_image_tag_hash.outputs.DOCKER_IMAGE_TAG_HASH }}
251+
HOST_CONFIG: hostconfigs/environment.cmake
252+
CMAKE_CXX_COMPILER: /usr/bin/g++
253+
CMAKE_C_COMPILER: /usr/bin/gcc
254+
CMAKE_BUILD_TYPE: Debug
255+
BUILD_AND_TEST_ARGS: "--build-exe --code-coverage"
256+
run: ./scripts/ci_build_and_test.sh
257+
- name: Upload coverage reports to Codecov
258+
uses: codecov/codecov-action@v3
259+
with:
260+
files: hpcReact_coverage.info.cleaned
261+
fail_ci_if_error: true
262+
env:
263+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
264+
265+
266+
check_that_all_jobs_succeeded:
267+
runs-on: ubuntu-22.04
268+
needs:
269+
- get_docker_image_tag_hash
270+
- linux_builds
271+
- doxygen_check
272+
- code_checks
273+
if: ${{ always() }}
274+
env:
275+
RETURN_VAL: |
276+
${{
277+
needs.linux_builds.result == 'success' &&
278+
needs.doxygen_check.result == 'success' &&
279+
needs.code_checks.result == 'success'
280+
}}
281+
steps:
282+
- name: PR Success
283+
if: ${{ contains(env.RETURN_VAL, 'true') }}
284+
run: "true"
285+
- name: PR Failure
286+
if: ${{ contains(env.RETURN_VAL, 'false') }}
287+
run: "false"

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
build*
2+
cmake/blt*

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "cmake/blt"]
2+
path = cmake/blt
3+
url = [email protected]:LLNL/blt.git

CMakeLists.txt

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
cmake_minimum_required( VERSION 3.23.1 )
2+
3+
# Set version number
4+
set( HPCREACT_VERSION_MAJOR 0 )
5+
set( HPCREACT_VERSION_MINOR 1 )
6+
set( HPCREACT_VERSION_PATCHLEVEL 0 )
7+
8+
# check if this is build as a submodule or a separate project
9+
get_directory_property( parent_dir PARENT_DIRECTORY )
10+
if(parent_dir)
11+
set( is_submodule ON )
12+
else()
13+
set( is_submodule OFF )
14+
endif()
15+
16+
if( NOT is_submodule )
17+
message( "not a submodule")
18+
project( hpcReact LANGUAGES CXX C )
19+
20+
set( BLT_SOURCE_DIR ${PROJECT_SOURCE_DIR}/cmake/blt CACHE PATH "" )
21+
set( BLT_CXX_STD "c++17" CACHE STRING "Version of C++ standard" FORCE )
22+
set( ENABLE_WARNINGS_AS_ERRORS "ON" CACHE PATH "" )
23+
24+
option( HPCREACT_ENABLE_UNIT_TESTS "Builds tests" ON )
25+
26+
option( ENABLE_CUDA "Build with CUDA" OFF )
27+
option( ENABLE_HIP "Build with HIP" OFF )
28+
29+
endif()
30+
31+
include( ${BLT_SOURCE_DIR}/SetupBLT.cmake )
32+
33+
include( cmake/CMakeBasics.cmake )
34+
include( cmake/Macros.cmake )
35+
#include( cmake/Config.cmake )
36+
37+
38+
add_subdirectory( src )
39+
40+
# if( HPCREACT_ENABLE_DOCS )
41+
# add_subdirectory( docs )
42+
# endif()
43+
44+

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
# HPCReact
1+
# hpcReact
22
Package for modeling of chemical reactions on High Performance Computing Systems

cmake/CMakeBasics.cmake

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
set(CMAKE_ENABLE_EXPORTS ON)
2+
3+
if( CMAKE_BUILD_TYPE MATCHES "Debug" )
4+
5+
else()
6+
7+
endif()
8+
9+
option( ENABLE_COVERAGE "Enable coverage" OFF )
10+
#set( SHIVA_BUILD_OBJ_LIBS OFF CACHE BOOL "" )
11+
12+
13+
# if( CMAKE_CXX_STANDARD IN_LIST "98; 11; 14" )
14+
# MESSAGE(FATAL_ERROR "Shiva requires at least c++17")
15+
# endif()
16+
17+
18+
blt_append_custom_compiler_flag( FLAGS_VAR CMAKE_CXX_FLAGS DEFAULT "${OpenMP_CXX_FLAGS}")
19+
blt_append_custom_compiler_flag( FLAGS_VAR CMAKE_CXX_FLAGS
20+
GNU "-Wpedantic -pedantic-errors -Wshadow -Wfloat-equal -Wcast-align -Wcast-qual"
21+
CLANG "-Wpedantic -pedantic-errors -Wshadow -Wfloat-equal -Wcast-align -Wcast-qual -Wabsolute-value"
22+
)
23+
24+
blt_append_custom_compiler_flag( FLAGS_VAR CMAKE_CXX_FLAGS_DEBUG
25+
GNU ""
26+
CLANG "-fstandalone-debug"
27+
)
28+
29+
set( CAMP_ENABLE_TESTS OFF CACHE BOOL "")

0 commit comments

Comments
 (0)