Skip to content

Commit 7729f9f

Browse files
Merge remote-tracking branch 'origin/1.2.0rc' into dev/1dsr
2 parents 1bcfe89 + e25b9c5 commit 7729f9f

197 files changed

Lines changed: 9754 additions & 3662 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.

.github/workflows/actions.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,14 @@ jobs:
2727
matrix:
2828
device: [cpu, amd-gpu, nvidia-gpu]
2929
precision: [double, single]
30+
mpi: [serial, parallel]
3031
exclude: # my AMD GPU doesn't support fp64 atomics : (
3132
- device: amd-gpu
3233
precision: double
34+
- device: amd-gpu
35+
mpi: parallel
36+
- device: nvidia-gpu
37+
mpi: parallel
3338
runs-on: [self-hosted, "${{ matrix.device }}"]
3439
steps:
3540
- name: Checkout
@@ -47,7 +52,7 @@ jobs:
4752
fi
4853
elif [ "${{ matrix.device }}" = "amd-gpu" ]; then
4954
FLAGS="-D Kokkos_ENABLE_HIP=ON -D Kokkos_ARCH_AMD_GFX1100=ON"
50-
elif [ "${{ matrix.device }}" = "cpu" ]; then
55+
elif [ "${{ matrix.mpi }}" = "parallel" ]; then
5156
FLAGS="-D mpi=ON"
5257
fi
5358
cmake -B build -D TESTS=ON -D output=ON -D precision=${{ matrix.precision }} $FLAGS

.gitmodules

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
[submodule "extern/adios2"]
55
path = extern/adios2
66
url = https://github.com/ornladios/ADIOS2.git
7-
branch = master
87
[submodule "extern/Kokkos"]
98
path = extern/Kokkos
109
url = https://github.com/kokkos/kokkos.git

CMakeLists.txt

Lines changed: 52 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# cmake-lint: disable=C0103,C0111,E1120,R0913,R0915
2+
13
cmake_minimum_required(VERSION 3.16)
24
cmake_policy(SET CMP0110 NEW)
35

@@ -8,10 +10,10 @@ project(
810
VERSION 1.2.0
911
LANGUAGES CXX C)
1012
add_compile_options("-D ENTITY_VERSION=\"${PROJECT_VERSION}\"")
13+
set(hash_cmd "git diff --quiet src/ && echo $(git rev-parse HEAD) ")
14+
string(APPEND hash_cmd "|| echo $(git rev-parse HEAD)-mod")
1115
execute_process(
12-
COMMAND
13-
bash -c
14-
"git diff --quiet src/ && echo $(git rev-parse HEAD) || echo $(git rev-parse HEAD)-mod"
16+
COMMAND bash -c ${hash_cmd}
1517
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
1618
OUTPUT_VARIABLE GIT_HASH
1719
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
@@ -46,6 +48,10 @@ set(mpi
4648
${default_mpi}
4749
CACHE BOOL "Use MPI")
4850

51+
set(gpu_aware_mpi
52+
${default_gpu_aware_mpi}
53+
CACHE BOOL "Enable GPU-aware MPI")
54+
4955
# -------------------------- Compilation settings -------------------------- #
5056
set(CMAKE_CXX_STANDARD 17)
5157
set(CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -55,9 +61,7 @@ if(${DEBUG} STREQUAL "OFF")
5561
set(CMAKE_BUILD_TYPE
5662
Release
5763
CACHE STRING "CMake build type")
58-
set(CMAKE_CXX_FLAGS
59-
"${CMAKE_CXX_FLAGS} -DNDEBUG -Wno-unused-local-typedefs -Wno-unknown-cuda-version"
60-
)
64+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNDEBUG")
6165
else()
6266
set(CMAKE_BUILD_TYPE
6367
Debug
@@ -79,38 +83,60 @@ set(BUILD_TESTING
7983
CACHE BOOL "Build tests")
8084

8185
# ------------------------ Third-party dependencies ------------------------ #
82-
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/kokkosConfig.cmake)
8386
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/dependencies.cmake)
8487

85-
find_or_fetch_dependency(Kokkos FALSE)
86-
find_or_fetch_dependency(plog TRUE)
88+
find_or_fetch_dependency(Kokkos FALSE QUIET)
89+
find_or_fetch_dependency(plog TRUE QUIET)
8790
set(DEPENDENCIES Kokkos::kokkos)
8891
include_directories(${plog_SRC}/include)
8992

9093
# -------------------------------- Main code ------------------------------- #
9194
set_precision(${precision})
95+
if("${Kokkos_DEVICES}" MATCHES "CUDA")
96+
add_compile_options("-D CUDA_ENABLED")
97+
set(DEVICE_ENABLED ON)
98+
add_compile_options("-D DEVICE_ENABLED")
99+
elseif("${Kokkos_DEVICES}" MATCHES "HIP")
100+
add_compile_options("-D HIP_ENABLED")
101+
set(DEVICE_ENABLED ON)
102+
add_compile_options("-D DEVICE_ENABLED")
103+
elseif("${Kokkos_DEVICES}" MATCHES "SYCL")
104+
add_compile_options("-D SYCL_ENABLED")
105+
set(DEVICE_ENABLED ON)
106+
add_compile_options("-D DEVICE_ENABLED")
107+
else()
108+
set(DEVICE_ENABLED OFF)
109+
endif()
110+
111+
if(("${Kokkos_DEVICES}" MATCHES "CUDA")
112+
OR ("${Kokkos_DEVICES}" MATCHES "HIP")
113+
OR ("${Kokkos_DEVICES}" MATCHES "SYCL"))
114+
set(DEVICE_ENABLED ON)
115+
else()
116+
set(DEVICE_ENABLED OFF)
117+
endif()
92118

93119
# MPI
94120
if(${mpi})
95-
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/MPIConfig.cmake)
121+
find_or_fetch_dependency(MPI FALSE REQUIRED)
122+
include_directories(${MPI_CXX_INCLUDE_PATH})
123+
add_compile_options("-D MPI_ENABLED")
96124
set(DEPENDENCIES ${DEPENDENCIES} MPI::MPI_CXX)
125+
if(${DEVICE_ENABLED})
126+
if(${gpu_aware_mpi})
127+
add_compile_options("-D GPU_AWARE_MPI")
128+
endif()
129+
else()
130+
set(gpu_aware_mpi
131+
OFF
132+
CACHE BOOL "Use explicit copy when using MPI + GPU")
133+
endif()
97134
endif()
98135

99136
# Output
100137
if(${output})
101-
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/adios2Config.cmake)
102-
find_or_fetch_dependency(adios2 FALSE)
103-
if(NOT DEFINED ENV{HDF5_ROOT})
104-
if(DEFINED ENV{CONDA_PREFIX})
105-
execute_process(COMMAND bash -c "conda list | grep \"hdf5\" -q"
106-
RESULT_VARIABLE HDF5_INSTALLED)
107-
if(HDF5_INSTALLED EQUAL 0)
108-
set(HDF5_ROOT $ENV{CONDA_PREFIX})
109-
endif()
110-
endif()
111-
endif()
112-
find_package(HDF5 REQUIRED)
113-
138+
find_or_fetch_dependency(adios2 FALSE QUIET)
139+
add_compile_options("-D OUTPUT_ENABLED")
114140
if(${mpi})
115141
set(DEPENDENCIES ${DEPENDENCIES} adios2::cxx11_mpi)
116142
else()
@@ -129,11 +155,12 @@ elseif(BENCHMARK)
129155
else()
130156
# ----------------------------------- GUI ---------------------------------- #
131157
if(${gui})
132-
find_or_fetch_dependency(nttiny FALSE)
158+
find_or_fetch_dependency(nttiny FALSE QUIET)
133159
endif()
134160

135161
# ------------------------------- Main source ------------------------------ #
136162
set_problem_generator(${pgen})
137163
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src src)
138-
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/report.cmake)
139164
endif()
165+
166+
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/report.cmake)

README.md

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,20 @@ Our [detailed documentation](https://entity-toolkit.github.io/) includes everyth
1010

1111
[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
1212

13-
## Lead developers
14-
15-
__Hayk Hakobyan__ {[@haykh](https://github.com/haykh)}
16-
17-
🥔 __Jens Mahlmann__ {[@jmahlmann](https://github.com/jmahlmann)}
18-
19-
💁‍♂️ __Alexander Chernoglazov__ {[@SChernoglazov](https://github.com/SChernoglazov)}
20-
21-
🧋 __Alisa Galishnikova__ {[@alisagk](https://github.com/alisagk)}
22-
23-
🐬 __Sasha Philippov__ {[@sashaph](https://github.com/sashaph)}
24-
2513
## Contributors (alphabetical)
2614

27-
👀 __Yangyang Cai__ {[@StaticObserver](https://github.com/StaticObserver): GRPIC}
28-
29-
🍵 __Benjamin Crinquand__ {[@bcrinquand](https://github.com/bcrinquand): GRPIC, cubed-sphere}
30-
31-
:radio: __Siddhant Solanki__ {[@sidruns30](https://github.com/sidruns30): framework}
32-
33-
🤷 __Arno Vanthieghem__ {[@vanthieg](https://github.com/vanthieg): framework, PIC}
34-
35-
😺 __Muni Zhou__ {[@munizhou](https://github.com/munizhou): PIC}
15+
* :guitar: Ludwig Böss {[@LudwigBoess](https://github.com/LudwigBoess)}
16+
* :eyes: Yangyang Cai {[@StaticObserver](https://github.com/StaticObserver)}
17+
* :person_tipping_hand: Alexander Chernoglazov {[@SChernoglazov](https://github.com/SChernoglazov)}
18+
* :tea: Benjamin Crinquand {[@bcrinquand](https://github.com/bcrinquand)}
19+
* :bubble_tea: Alisa Galishnikova {[@alisagk](https://github.com/alisagk)}
20+
* :locomotive: Evgeny Gorbunov {[@Alcauchy](https://github.com/Alcauchy)}
21+
* :coffee: Hayk Hakobyan {[@haykh](https://github.com/haykh)}
22+
* :potato: Jens Mahlmann {[@jmahlmann](https://github.com/jmahlmann)}
23+
* :dolphin: Sasha Philippov {[@sashaph](https://github.com/sashaph)}
24+
* :radio: Siddhant Solanki {[@sidruns30](https://github.com/sidruns30)}
25+
* :shrug: Arno Vanthieghem {[@vanthieg](https://github.com/vanthieg)}
26+
* :cat: Muni Zhou {[@munizhou](https://github.com/munizhou)}
3627

3728
## Branch policy
3829

TASKLIST.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

cmake/MPIConfig.cmake

Lines changed: 0 additions & 4 deletions
This file was deleted.

cmake/adios2Config.cmake

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,18 @@ set(ADIOS2_USE_Fortran
1212
CACHE BOOL "Use Fortran for ADIOS2")
1313

1414
# Format/compression support
15-
set(ADIOS2_USE_ZeroMQ
16-
OFF
17-
CACHE BOOL "Use ZeroMQ for ADIOS2")
15+
set(ADIOS2_USE_HDF5
16+
ON
17+
CACHE BOOL "Use HDF5 for ADIOS2")
1818

1919
set(ADIOS2_USE_MPI
2020
${mpi}
2121
CACHE BOOL "Use MPI for ADIOS2")
2222

23+
set(ADIOS2_USE_ZeroMQ
24+
OFF
25+
CACHE BOOL "Use ZeroMQ for ADIOS2")
26+
2327
set(ADIOS2_USE_CUDA
2428
OFF
2529
CACHE BOOL "Use CUDA for ADIOS2")
26-
27-
add_compile_options("-D OUTPUT_ENABLED")

cmake/benchmark.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# cmake-lint: disable=C0103
2+
13
set(SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
24

35
add_subdirectory(${SRC_DIR}/global ${CMAKE_CURRENT_BINARY_DIR}/global)

cmake/config.cmake

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# cmake-lint: disable=C0103
2+
13
# -------------------------------- Precision ------------------------------- #
24
function(set_precision precision_name)
35
list(FIND precisions ${precision_name} PRECISION_FOUND)
@@ -28,10 +30,8 @@ function(set_problem_generator pgen_name)
2830
endforeach()
2931
list(FIND PGEN_NAMES ${pgen_name} PGEN_FOUND)
3032
if(NOT ${pgen_name} STREQUAL "." AND ${PGEN_FOUND} EQUAL -1)
31-
message(
32-
FATAL_ERROR
33-
"Invalid problem generator: ${pgen_name}\nValid options are: ${PGEN_NAMES}"
34-
)
33+
message(FATAL_ERROR "Invalid problem generator: "
34+
"${pgen_name}\nValid options are: ${PGEN_NAMES}")
3535
endif()
3636
set(PGEN
3737
${pgen_name}

cmake/defaults.cmake

Lines changed: 24 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# cmake-lint: disable=C0103
2+
13
# ----------------------------- Defaults ---------------------------------- #
24
if(DEFINED ENV{Entity_ENABLE_DEBUG})
35
set(default_debug
@@ -33,7 +35,7 @@ if(DEFINED ENV{Entity_ENABLE_OUTPUT})
3335
CACHE INTERNAL "Default flag for output")
3436
else()
3537
set(default_output
36-
OFF
38+
ON
3739
CACHE INTERNAL "Default flag for output")
3840
endif()
3941

@@ -51,50 +53,36 @@ endif()
5153

5254
set_property(CACHE default_gui PROPERTY TYPE BOOL)
5355

54-
if(DEFINED ENV{Kokkos_ENABLE_CUDA})
55-
set(default_KOKKOS_ENABLE_CUDA
56-
$ENV{Kokkos_ENABLE_CUDA}
57-
CACHE INTERNAL "Default flag for CUDA")
58-
else()
59-
set(default_KOKKOS_ENABLE_CUDA
60-
OFF
61-
CACHE INTERNAL "Default flag for CUDA")
62-
endif()
63-
64-
set_property(CACHE default_KOKKOS_ENABLE_CUDA PROPERTY TYPE BOOL)
65-
66-
if(DEFINED ENV{Kokkos_ENABLE_HIP})
67-
set(default_KOKKOS_ENABLE_HIP
68-
$ENV{Kokkos_ENABLE_HIP}
69-
CACHE INTERNAL "Default flag for HIP")
56+
if(DEFINED ENV{Entity_ENABLE_MPI})
57+
set(default_mpi
58+
$ENV{Entity_ENABLE_MPI}
59+
CACHE INTERNAL "Default flag for MPI")
7060
else()
71-
set(default_KOKKOS_ENABLE_HIP
61+
set(default_mpi
7262
OFF
73-
CACHE INTERNAL "Default flag for HIP")
63+
CACHE INTERNAL "Default flag for MPI")
7464
endif()
7565

76-
set_property(CACHE default_KOKKOS_ENABLE_HIP PROPERTY TYPE BOOL)
77-
78-
if(DEFINED ENV{Kokkos_ENABLE_OPENMP})
79-
set(default_KOKKOS_ENABLE_OPENMP
80-
$ENV{Kokkos_ENABLE_OPENMP}
81-
CACHE INTERNAL "Default flag for OpenMP")
66+
if(DEFINED ENV{Entity_MPI_DEVICE_COPY})
67+
set(default_mpi_device_copy
68+
$ENV{Entity_MPI_DEVICE_COPY}
69+
CACHE INTERNAL "Default flag for copying from device to host for MPI")
8270
else()
83-
set(default_KOKKOS_ENABLE_OPENMP
71+
set(default_mpi_device_copy
8472
OFF
85-
CACHE INTERNAL "Default flag for OpenMP")
73+
CACHE INTERNAL "Default flag for copying from device to host for MPI")
8674
endif()
8775

88-
set_property(CACHE default_KOKKOS_ENABLE_OPENMP PROPERTY TYPE BOOL)
76+
set_property(CACHE default_mpi PROPERTY TYPE BOOL)
8977

90-
if(DEFINED ENV{Entity_ENABLE_MPI})
91-
set(default_mpi
92-
$ENV{Entity_ENABLE_MPI}
93-
CACHE INTERNAL "Default flag for MPI")
78+
if(DEFINED ENV{Entity_ENABLE_GPU_AWARE_MPI})
79+
set(default_gpu_aware_mpi
80+
$ENV{Entity_ENABLE_GPU_AWARE_MPI}
81+
CACHE INTERNAL "Default flag for GPU-aware MPI")
9482
else()
95-
set(default_mpi
96-
OFF
97-
CACHE INTERNAL "Default flag for MPI")
83+
set(default_gpu_aware_mpi
84+
ON
85+
CACHE INTERNAL "Default flag for GPU-aware MPI")
9886
endif()
9987

100-
set_property(CACHE default_mpi PROPERTY TYPE BOOL)
88+
set_property(CACHE default_gpu_aware_mpi PROPERTY TYPE BOOL)

0 commit comments

Comments
 (0)