Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 23 additions & 9 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,39 @@
name: Unit tests

on:
pull_request:
branches:
- '**rc'
- 'master'
push:

jobs:
check-commit:
runs-on: ubuntu-latest
outputs:
run_tests: ${{ steps.check_message.outputs.run_tests }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Check commit message
id: check_message
run: |
if git log -1 --pretty=%B | grep -q "RUNTEST"; then
echo "run_tests=true" >> "$GITHUB_OUTPUT"
else
echo "run_tests=false" >> "$GITHUB_OUTPUT"
fi
tests:
needs: check-commit
if: needs.check-commit.outputs.run_tests == 'true'
strategy:
fail-fast: false
matrix:
device: [amd-gpu, nvidia-gpu]
device: [cpu, amd-gpu, nvidia-gpu]
precision: [double, single]
exclude:
exclude: # my AMD GPU doesn't support fp64 atomics : (
- device: amd-gpu
precision: double
# my AMD GPU doesn't support fp64 atomics : (
runs-on: [self-hosted, "${{ matrix.device }}"]
if: contains(github.event.head_commit.message, 'totest')
steps:
- name: Checkout
uses: actions/checkout@v3.3.0
uses: actions/checkout@v4
- name: Configure
run: |
if [ "${{ matrix.device }}" = "nvidia-gpu" ]; then
Expand All @@ -35,6 +47,8 @@ jobs:
fi
elif [ "${{ matrix.device }}" = "amd-gpu" ]; then
FLAGS="-D Kokkos_ENABLE_HIP=ON -D Kokkos_ARCH_AMD_GFX1100=ON"
elif [ "${{ matrix.device }}" = "cpu" ]; then
FLAGS="-D mpi=ON"
fi
cmake -B build -D TESTS=ON -D output=ON -D precision=${{ matrix.precision }} $FLAGS
- name: Compile
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ venv/
# CMake testing files
Testing/

.clangd
.schema.json
*_old/
action-token
Expand Down
67 changes: 36 additions & 31 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,13 @@ project(
VERSION 1.2.0
LANGUAGES CXX C)
add_compile_options("-D ENTITY_VERSION=\"${PROJECT_VERSION}\"")
execute_process(COMMAND
bash -c "git diff --quiet src/ && echo $(git rev-parse HEAD) || echo $(git rev-parse HEAD)-mod"
execute_process(
COMMAND
bash -c
"git diff --quiet src/ && echo $(git rev-parse HEAD) || echo $(git rev-parse HEAD)-mod"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_VARIABLE GIT_HASH
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
)
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
message(STATUS "Git hash: ${GIT_HASH}")
add_compile_options("-D ENTITY_GIT_HASH=\"${GIT_HASH}\"")

Expand All @@ -25,56 +26,57 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/defaults.cmake)

# defaults
set(DEBUG
${default_debug}
CACHE BOOL "Debug mode")
${default_debug}
CACHE BOOL "Debug mode")

set(precision
${default_precision}
CACHE STRING "Precision")
${default_precision}
CACHE STRING "Precision")
set(pgen
${default_pgen}
CACHE STRING "Problem generator")
${default_pgen}
CACHE STRING "Problem generator")

set(gui
${default_gui}
CACHE BOOL "Use GUI [nttiny]")
${default_gui}
CACHE BOOL "Use GUI [nttiny]")
set(output
${default_output}
CACHE BOOL "Enable output")
${default_output}
CACHE BOOL "Enable output")
set(mpi
${default_mpi}
CACHE BOOL "Use MPI")
${default_mpi}
CACHE BOOL "Use MPI")

# -------------------------- Compilation settings -------------------------- #
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

if(${DEBUG} STREQUAL "OFF")
set(CMAKE_BUILD_TYPE
Release
CACHE STRING "CMake build type")
Release
CACHE STRING "CMake build type")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNDEBUG")
else()
set(CMAKE_BUILD_TYPE
Debug
CACHE STRING "CMake build type")
Debug
CACHE STRING "CMake build type")
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -DDEBUG -Wall -Wextra -Wno-unknown-pragmas")
"${CMAKE_CXX_FLAGS} -DDEBUG -Wall -Wextra -Wno-unknown-pragmas")
endif()

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedefs")

# options
set(precisions
"single" "double"
CACHE STRING "Precisions")
"single" "double"
CACHE STRING "Precisions")

include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/config.cmake)

# ------------------------- Third-Party Tests ------------------------------ #
set(BUILD_TESTING
OFF
CACHE BOOL "Build tests")
OFF
CACHE BOOL "Build tests")

# ------------------------ Third-party dependencies ------------------------ #
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/kokkosConfig.cmake)
Expand All @@ -98,21 +100,24 @@ endif()
if(${output})
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/adios2Config.cmake)
find_or_fetch_dependency(adios2 FALSE)
if (NOT DEFINED ENV{HDF5_ROOT})
if(NOT DEFINED ENV{HDF5_ROOT})
set(USE_CUSTOM_HDF5 OFF)
if (DEFINED ENV{CONDA_PREFIX})
if(DEFINED ENV{CONDA_PREFIX})
execute_process(COMMAND bash -c "conda list | grep \"hdf5\" -q"
RESULT_VARIABLE HDF5_INSTALLED)
if (HDF5_INSTALLED EQUAL 0)
RESULT_VARIABLE HDF5_INSTALLED)
if(HDF5_INSTALLED EQUAL 0)
set(HDF5_ROOT $ENV{CONDA_PREFIX})
else()
set(USE_CUSTOM_HDF5 ON)
endif()
else()
set(USE_CUSTOM_HDF5 ON)
endif()
if (USE_CUSTOM_HDF5)
message(FATAL_ERROR "HDF5_ROOT is not set. Please set it to the root of the HDF5 installation")
if(USE_CUSTOM_HDF5)
message(
FATAL_ERROR
"HDF5_ROOT is not set. Please set it to the root of the HDF5 installation"
)
endif()
endif()
find_package(HDF5 REQUIRED)
Expand Down
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,23 @@ Our [detailed documentation](https://entity-toolkit.github.io/) includes everyth

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

## Core developers (alphabetical)
## Lead developers

👀 __Yangyang Cai__ {[@StaticObserver](https://github.com/StaticObserver): GRPIC}
☕ __Hayk Hakobyan__ {[@haykh](https://github.com/haykh)}

💁‍♂️ __Alexander Chernoglazov__ {[@SChernoglazov](https://github.com/SChernoglazov): PIC}
🥔 __Jens Mahlmann__ {[@jmahlmann](https://github.com/jmahlmann)}

🍵 __Benjamin Crinquand__ {[@bcrinquand](https://github.com/bcrinquand): GRPIC, cubed-sphere}
💁‍♂️ __Alexander Chernoglazov__ {[@SChernoglazov](https://github.com/SChernoglazov)}

🧋 __Alisa Galishnikova__ {[@alisagk](https://github.com/alisagk): GRPIC}
🧋 __Alisa Galishnikova__ {[@alisagk](https://github.com/alisagk)}

☕ __Hayk Hakobyan__ {[@haykh](https://github.com/haykh): framework, PIC, GRPIC, cubed-sphere}
🐬 __Sasha Philippov__ {[@sashaph](https://github.com/sashaph)}

🥔 __Jens Mahlmann__ {[@jmahlmann](https://github.com/jmahlmann): framework, MPI, cubed-sphere}
## Contributors (alphabetical)

🐬 __Sasha Philippov__ {[@sashaph](https://github.com/sashaph): all-around}
👀 __Yangyang Cai__ {[@StaticObserver](https://github.com/StaticObserver): GRPIC}

🍵 __Benjamin Crinquand__ {[@bcrinquand](https://github.com/bcrinquand): GRPIC, cubed-sphere}

🤷 __Arno Vanthieghem__ {[@vanthieg](https://github.com/vanthieg): framework, PIC}

Expand Down
3 changes: 2 additions & 1 deletion cmake/MPIConfig.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
find_package(MPI REQUIRED)
include_directories(${MPI_CXX_INCLUDE_PATH})
add_compile_options("-D MPI_ENABLED")
add_compile_options("-D MPI_ENABLED")

24 changes: 18 additions & 6 deletions cmake/adios2Config.cmake
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
# ----------------------------- Adios2 settings ---------------------------- #
set(ADIOS2_BUILD_EXAMPLES OFF CACHE BOOL "Build ADIOS2 examples")
set(ADIOS2_BUILD_EXAMPLES
OFF
CACHE BOOL "Build ADIOS2 examples")

# Language support
set(ADIOS2_USE_Python OFF CACHE BOOL "Use Python for ADIOS2")
set(ADIOS2_USE_Fortran OFF CACHE BOOL "Use Fortran for ADIOS2")
set(ADIOS2_USE_Python
OFF
CACHE BOOL "Use Python for ADIOS2")
set(ADIOS2_USE_Fortran
OFF
CACHE BOOL "Use Fortran for ADIOS2")

# Format/compression support
set(ADIOS2_USE_ZeroMQ OFF CACHE BOOL "Use ZeroMQ for ADIOS2")
set(ADIOS2_USE_ZeroMQ
OFF
CACHE BOOL "Use ZeroMQ for ADIOS2")

set(ADIOS2_USE_MPI ${mpi} CACHE BOOL "Use MPI for ADIOS2")
set(ADIOS2_USE_MPI
${mpi}
CACHE BOOL "Use MPI for ADIOS2")

set(ADIOS2_USE_CUDA OFF CACHE BOOL "Use CUDA for ADIOS2")
set(ADIOS2_USE_CUDA
OFF
CACHE BOOL "Use CUDA for ADIOS2")

add_compile_options("-D OUTPUT_ENABLED")
31 changes: 23 additions & 8 deletions cmake/config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ function(set_precision precision_name)
list(FIND precisions ${precision_name} PRECISION_FOUND)

if(${PRECISION_FOUND} EQUAL -1)
message(FATAL_ERROR "Invalid precision: ${precision_name}\nValid options are: ${precisions}")
message(
FATAL_ERROR
"Invalid precision: ${precision_name}\nValid options are: ${precisions}"
)
endif()

if(${precision_name} STREQUAL "single")
Expand All @@ -13,19 +16,31 @@ endfunction()

# ---------------------------- Problem generator --------------------------- #
function(set_problem_generator pgen_name)
file(GLOB_RECURSE PGENS "${CMAKE_CURRENT_SOURCE_DIR}/setups/**/pgen.hpp" "${CMAKE_CURRENT_SOURCE_DIR}/setups/pgen.hpp")
file(GLOB_RECURSE PGENS "${CMAKE_CURRENT_SOURCE_DIR}/setups/**/pgen.hpp"
"${CMAKE_CURRENT_SOURCE_DIR}/setups/pgen.hpp")
foreach(PGEN ${PGENS})
get_filename_component(PGEN_NAME ${PGEN} DIRECTORY)
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/setups/" "" PGEN_NAME ${PGEN_NAME})
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/setups" "" PGEN_NAME ${PGEN_NAME})
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/setups/" "" PGEN_NAME
${PGEN_NAME})
string(REPLACE "${CMAKE_CURRENT_SOURCE_DIR}/setups" "" PGEN_NAME
${PGEN_NAME})
list(APPEND PGEN_NAMES ${PGEN_NAME})
endforeach()
list(FIND PGEN_NAMES ${pgen_name} PGEN_FOUND)
if(NOT ${pgen_name} STREQUAL "." AND ${PGEN_FOUND} EQUAL -1)
message(FATAL_ERROR "Invalid problem generator: ${pgen_name}\nValid options are: ${PGEN_NAMES}")
message(
FATAL_ERROR
"Invalid problem generator: ${pgen_name}\nValid options are: ${PGEN_NAMES}"
)
endif()
set(PGEN ${pgen_name} PARENT_SCOPE)
set(PGEN
${pgen_name}
PARENT_SCOPE)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/setups/${pgen_name})
set(PGEN_FOUND TRUE PARENT_SCOPE)
set(problem_generators ${PGEN_NAMES} PARENT_SCOPE)
set(PGEN_FOUND
TRUE
PARENT_SCOPE)
set(problem_generators
${PGEN_NAMES}
PARENT_SCOPE)
endfunction()
Loading