Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
a016b6b
version bump
haykh May 18, 2026
c84edca
Merge branch 'master' into 1.5.0rc
haykh May 18, 2026
00fa0bf
port: team policy and vendor specific sort
LudwigBoess May 19, 2026
04d403c
removed redundant inner loop over species
LudwigBoess May 19, 2026
5830c07
frontier-specific memory pool allocation
LudwigBoess May 19, 2026
6e42c8a
version in cmake
haykh May 21, 2026
cd6c8c7
Merge branch 'master' into dev/team_policy
LudwigBoess May 26, 2026
cf14e9f
support more tile sizes
LudwigBoess May 26, 2026
787aa04
removed persistent sort scratch to reduce memory overhead
LudwigBoess May 26, 2026
827cf26
added team policy reporting
LudwigBoess Jun 2, 2026
4b81914
explicitly bind GPU Transport Layer for GPU aware MPI on Frontier
LudwigBoess Jun 2, 2026
a603ecb
minor refactor
haykh Jun 3, 2026
f80e561
Merge branch 'dev/team_policy' of github.com:entity-toolkit/entity in…
haykh Jun 3, 2026
b5e05ad
compile-time sorting interval with team policies and sorting speedup
LudwigBoess Jun 19, 2026
4f4409d
fix test for tiled deposit
LudwigBoess Jun 19, 2026
4dfaba9
replaced compile-time sort intervale with compile-time drift halo size
LudwigBoess Jun 20, 2026
cd1be6b
AMD-specific sorting improvements
LudwigBoess Jun 20, 2026
ed70dbd
reduced exchange for filters
LudwigBoess Jun 21, 2026
314d142
moved tag_offsets_h outside of loop to avoid multiple device-host copies
LudwigBoess Jun 21, 2026
8047a11
batched async communication
LudwigBoess Jun 21, 2026
5036917
removed async comm because of bandwidth issue
LudwigBoess Jun 21, 2026
8891420
bugfix in current deposit
LudwigBoess Jun 21, 2026
4f3a762
double-buffer radix sort to drop the N-sized temp (fixes device OOM …
LudwigBoess Jun 21, 2026
94ba9cd
fix printing of total particles
LudwigBoess Jun 24, 2026
9a4333e
use a persistent buffer per sort to reduce memory overhead
LudwigBoess Jun 24, 2026
216940c
added the option to explicitly disable vendor sort
LudwigBoess Jun 24, 2026
af942c8
remove dead particles after every sort
LudwigBoess Jun 24, 2026
e1de8ae
test update
LudwigBoess Jun 24, 2026
592ff89
generalized reduced exchange for current filters on any coordinate sy…
LudwigBoess Jun 25, 2026
9602eab
Merge pull request #212 from entity-toolkit/dev/frontier_mpi
LudwigBoess Jun 25, 2026
e2ff66d
Merge branch '1.5.0rc' into dev/team_policy
LudwigBoess Jun 25, 2026
6e1e23e
bugfix
LudwigBoess Jun 25, 2026
ff3ec19
move definittion of `compute_tile_offsets` to `public` so it compiles…
LudwigBoess Jun 25, 2026
03ccd20
added `team_policy_team_size` as a tunable runtime parameter
LudwigBoess Jun 26, 2026
ca7307d
add script to compute ideal tile size
LudwigBoess Jun 26, 2026
61ebebf
team policy for GRPIC
LudwigBoess Jun 26, 2026
210454b
bugfix in deposit tests
LudwigBoess Jun 26, 2026
e9cfa06
added explicit charge conservation test to the tiled deposit test
LudwigBoess Jun 26, 2026
c6e47fb
Merge pull request #209 from entity-toolkit/dev/team_policy
LudwigBoess Jun 26, 2026
4e9e931
port of load balancing from my fork
LudwigBoess Jun 27, 2026
ca3f162
bugfix in for sort includes
LudwigBoess Jun 29, 2026
c439364
Merge branch '1.5.0rc' into dev/load_balancing
LudwigBoess Jul 1, 2026
99f80f7
Merge pull request #216 from entity-toolkit/dev/load_balancing
LudwigBoess Jul 2, 2026
01b526a
fix memory lead for intel sorting
LudwigBoess Jul 27, 2026
ea15a40
Merge branch 'master' into 1.5.0rc
LudwigBoess Jul 27, 2026
8a81f77
Merge branch '1.5.0rc' into bug/intel_sort_memleak
LudwigBoess Jul 28, 2026
ad2f3db
bugfix for loadbalancing when compiled with nvcc
LudwigBoess Aug 7, 2026
d31b1c4
Merge branch '1.5.0rc' into bug/loadbalancing_nvidia
LudwigBoess Aug 10, 2026
d6f3f92
Merge pull request #221 from entity-toolkit/bug/intel_sort_memleak
LudwigBoess Aug 10, 2026
772b127
Merge branch '1.5.0rc' into bug/loadbalancing_nvidia
LudwigBoess Aug 10, 2026
765784e
replace the Rebalance particle-shift lambda with a ShiftPrtlIndices_k…
LudwigBoess Aug 11, 2026
765bfcd
Merge pull request #223 from entity-toolkit/bug/loadbalancing_nvidia
LudwigBoess Aug 12, 2026
2b34ab1
new more categorized report
haykh Sep 9, 2026
7dd38b7
refactor deposit into separate files
haykh Sep 9, 2026
b2e2e39
formatting
haykh Sep 9, 2026
db342bc
moved mpi & team_policy cmake to separate files
haykh Sep 10, 2026
f2e9f75
bump kokkos version to 5.2.1
haykh Sep 10, 2026
6da1342
fixed quietly failing reduced stats test
haykh Sep 10, 2026
6999602
RUNTESTS
haykh Sep 10, 2026
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
43 changes: 29 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set(PROJECT_NAME entity)

project(
${PROJECT_NAME}
VERSION 1.4.4
VERSION 1.5.0
LANGUAGES CXX C)
add_compile_options("-D ENTITY_VERSION=\"${PROJECT_VERSION}\"")
set(hash_cmd "git diff --quiet src/ && echo $(git rev-parse HEAD) ")
Expand Down Expand Up @@ -58,6 +58,28 @@ set(gpu_aware_mpi
${default_gpu_aware_mpi}
CACHE BOOL "Enable GPU-aware MPI")

set(team_policy
${default_team_policy}
CACHE BOOL "Enable team_policy tile-blocked deposit/pusher kernels")
set(team_policy_tile_size
${default_team_policy_tile_size}
CACHE STRING "team_policy tile edge length in cells")
set(team_policy_tile_sizes
"4;6;8;10;12;14;16"
CACHE STRING "team_policy tile-size choices")
set(team_policy_drift
${default_team_policy_drift}
CACHE
STRING
"team_policy tiled-deposit scratch halo drift in cells (max cells a particle may move between two sorts). Sizes the deposit scratch halo only; the sort cadence is set at runtime via spatial_sorting_interval. Default 1."
)
set(vendor_sort
${default_vendor_sort}
CACHE
BOOL
"Use the vendor sort_by_key (oneDPL/Thrust/rocThrust) for the team_policy spatial sort when available. OFF forces the Kokkos::BinSort fallback, which sorts each SoA member in place (lower peak memory, no maxnpart gather buffer) at the cost of sort speed."
)

# -------------------------- Compilation settings -------------------------- #
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand Down Expand Up @@ -136,21 +158,14 @@ else()
set(DEVICE_ENABLED OFF)
endif()

# ------------------------------ team_policy wiring ------------------------ #
if(${team_policy})
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/team_policy.cmake)
endif()

# MPI
if(${mpi})
find_or_fetch_dependency(MPI FALSE REQUIRED)
include_directories(${MPI_CXX_INCLUDE_PATH})
add_compile_options("-D MPI_ENABLED")
set(DEPENDENCIES ${DEPENDENCIES} MPI::MPI_CXX)
if(${DEVICE_ENABLED})
if(${gpu_aware_mpi})
add_compile_options("-D GPU_AWARE_MPI")
endif()
else()
set(gpu_aware_mpi
OFF
CACHE BOOL "Use explicit copy when using MPI + GPU")
endif()
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/mpi.cmake)
endif()

# Output
Expand Down
35 changes: 35 additions & 0 deletions cmake/defaults.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,38 @@ else()
endif()

set_property(CACHE default_gpu_aware_mpi PROPERTY TYPE BOOL)

if(DEFINED ENV{Entity_ENABLE_TEAM_POLICY})
set(default_team_policy
$ENV{Entity_ENABLE_TEAM_POLICY}
CACHE INTERNAL "Default flag for team_policy tile-blocked kernels")
else()
set(default_team_policy
OFF
CACHE INTERNAL "Default flag for team_policy tile-blocked kernels")
endif()
set_property(CACHE default_team_policy PROPERTY TYPE BOOL)

if(DEFINED ENV{Entity_ENABLE_VENDOR_SORT})
set(default_vendor_sort
$ENV{Entity_ENABLE_VENDOR_SORT}
CACHE INTERNAL
"Default flag for vendor sort_by_key (oneDPL/Thrust/rocThrust)")
else()
set(default_vendor_sort
ON
CACHE INTERNAL
"Default flag for vendor sort_by_key (oneDPL/Thrust/rocThrust)")
endif()
set_property(CACHE default_vendor_sort PROPERTY TYPE BOOL)

set(default_team_policy_tile_size
8
CACHE INTERNAL "Default tile edge length in cells for team_policy")

set(default_team_policy_drift
1
CACHE
INTERNAL
"Default tiled-deposit scratch halo drift for team_policy (cells between sorts)"
)
2 changes: 1 addition & 1 deletion cmake/dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set(Kokkos_REPOSITORY
https://github.com/kokkos/kokkos.git
CACHE STRING "Kokkos repository")
set(Kokkos_TAG
5.0.1
5.2.1
CACHE STRING "Kokkos tag")
set(adios2_REPOSITORY
https://github.com/ornladios/ADIOS2.git
Expand Down
71 changes: 71 additions & 0 deletions cmake/mpi.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
find_or_fetch_dependency(MPI FALSE REQUIRED)
include_directories(${MPI_CXX_INCLUDE_PATH})
add_compile_options("-D MPI_ENABLED")
set(DEPENDENCIES ${DEPENDENCIES} MPI::MPI_CXX)
if(${DEVICE_ENABLED})
if(${gpu_aware_mpi})
add_compile_options("-D GPU_AWARE_MPI")

# On Cray systems (e.g. Frontier) GPU-aware Cray MPICH can only handle
# device pointers if the GPU Transport Layer (GTL) library is linked. The
# Cray compiler wrappers (cc/CC) inject this automatically, but we build
# with hipcc/nvcc directly, so find_package(MPI) only finds base libmpi and
# the GTL is left out -> MPI_Sendrecv on a device pointer fails with "OFI
# ... Bad address". Add it explicitly here.
#
# Cray PE exports PE_MPICH_GTL_DIR_<accel> / PE_MPICH_GTL_LIBS_<accel> (e.g.
# amd_gfx90a -> -lmpi_gtl_hsa). Their absence means this is not a Cray MPICH
# build, in which case nothing extra is needed.
if("${Kokkos_DEVICES}" MATCHES "HIP")
set(_gtl_accels amd_gfx942 amd_gfx940 amd_gfx90a amd_gfx908 amd_gfx906)
elseif("${Kokkos_DEVICES}" MATCHES "CUDA")
set(_gtl_accels nvidia90 nvidia80 nvidia70)
elseif("${Kokkos_DEVICES}" MATCHES "SYCL")
set(_gtl_accels ponteVecchio)
else()
set(_gtl_accels "")
endif()

set(_gtl_dir "")
set(_gtl_libflag "")
foreach(_accel ${_gtl_accels})
if((NOT _gtl_dir) AND (DEFINED ENV{PE_MPICH_GTL_DIR_${_accel}}))
# strip the leading "-L" from the Cray-provided value
string(REGEX REPLACE "^-L" "" _gtl_dir
"$ENV{PE_MPICH_GTL_DIR_${_accel}}")
string(REGEX REPLACE "^-l" "" _gtl_libflag
"$ENV{PE_MPICH_GTL_LIBS_${_accel}}")
endif()
endforeach()

if(_gtl_dir AND _gtl_libflag)
find_library(
MPI_GTL_LIBRARY
NAMES ${_gtl_libflag}
HINTS "${_gtl_dir}"
NO_DEFAULT_PATH)
if(MPI_GTL_LIBRARY)
message(
STATUS "GPU-aware MPI: linking Cray GTL library ${MPI_GTL_LIBRARY}")
set(DEPENDENCIES ${DEPENDENCIES} ${MPI_GTL_LIBRARY})
else()
message(
FATAL_ERROR
"${Red}gpu_aware_mpi=ON: Cray MPICH detected but the GTL "
"library 'lib${_gtl_libflag}' was not found in '${_gtl_dir}'. "
"GPU-aware MPI will crash at runtime without it. Make sure the "
"craype-accel module is loaded, or build with gpu_aware_mpi=OFF."
"${ColorReset}")
endif()
else()
message(
STATUS "GPU-aware MPI: no Cray GTL environment found; assuming the MPI "
"implementation is GPU-aware without an extra transport library."
)
endif()
endif()
else()
set(gpu_aware_mpi
OFF
CACHE BOOL "Use explicit copy when using MPI + GPU")
endif()
134 changes: 94 additions & 40 deletions cmake/report.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ printchoices(
${default_deposit}
"${Blue}"
DEPOSIT_REPORT
46)
44)
printchoices(
"Shape order"
"shape_order"
Expand All @@ -110,18 +110,43 @@ printchoices(
OFF
"${Green}"
MPI_REPORT
46)
if(${mpi} AND ${DEVICE_ENABLED})
printchoices(
"GPU-aware MPI"
"gpu_aware_mpi"
"${ON_OFF_VALUES}"
${gpu_aware_mpi}
OFF
"${Green}"
GPU_AWARE_MPI_REPORT
46)
endif()
44)
printchoices(
"GPU-aware MPI"
"gpu_aware_mpi"
"${ON_OFF_VALUES}"
${gpu_aware_mpi}
OFF
"${Green}"
GPU_AWARE_MPI_REPORT
44)
printchoices(
"Team Policy"
"team_policy"
"${ON_OFF_VALUES}"
${team_policy}
OFF
"${Green}"
TEAM_POLICY_REPORT
44)
printchoices(
"Tile Size"
"team_policy_tile_size"
"${team_policy_tile_sizes}"
${team_policy_tile_size}
${default_team_policy_tile_size}
"${Blue}"
TEAM_POLICY_TILE_SIZE_REPORT
44)
printchoices(
"Vendor sort"
"vendor_sort"
"${ON_OFF_VALUES}"
${vendor_sort}
ON
"${Green}"
VENDOR_SORT_REPORT
44)
printchoices(
"Debug mode"
"DEBUG"
Expand Down Expand Up @@ -158,62 +183,91 @@ string(APPEND REPORT_TEXT ${DASHED_LINE_SYMBOL} "\n" "Configurations" "\n")

if(${PGEN_FOUND})
string(APPEND REPORT_TEXT " " ${PGEN_REPORT} "\n")
else()
string(
APPEND
REPORT_TEXT
" - Problem generator [${Magenta}pgen${ColorReset}]: ${Dim}none${ColorReset}\n"
)
endif()
string(APPEND REPORT_TEXT " " ${TESTS_REPORT} "\n")

string(REPLACE ";" "+" Kokkos_ARCH "${Kokkos_ARCH}")
string(REPLACE ";" "+" Kokkos_DEVICES "${Kokkos_DEVICES}")

string(
APPEND
REPORT_TEXT
" "
${PRECISION_REPORT}
${TESTS_REPORT}
"\n"
" "
${DEPOSIT_REPORT}
${OUTPUT_REPORT}
"\n"
" - Install prefix [${Magenta}CMAKE_INSTALL_PREFIX${ColorReset}]: "
"${CMAKE_INSTALL_PREFIX}"
"\n"
${DASHED_LINE_SYMBOL}
"\n"
"Algorithmic specs"
"\n"
" "
${PRECISION_REPORT}
"\n"
" "
${SHAPEFUNCTION_REPORT}
"\n"
" > PIC-specific specs"
"\n"
" "
${DEPOSIT_REPORT}
"\n"
${DASHED_LINE_SYMBOL}
"\n"
"Performance specs"
"\n"
" "
${OUTPUT_REPORT}
"\n")

string(REPLACE ";" "+" Kokkos_ARCH "${Kokkos_ARCH}")
string(REPLACE ";" "+" Kokkos_DEVICES "${Kokkos_DEVICES}")

string(
APPEND
REPORT_TEXT
${DEBUG_REPORT}
"\n"
" - ARCH [${Magenta}Kokkos_ARCH_***${ColorReset}]: "
"${Kokkos_ARCH}"
"\n"
" - DEVICES [${Magenta}Kokkos_ENABLE_***${ColorReset}]: "
"${Kokkos_DEVICES}"
"\n"
" "
" > Multi-node specs"
" ${Dim}[requires mpi=ON]${ColorReset}"
"\n"
" "
${MPI_REPORT}
"\n"
" "
${GPU_AWARE_MPI_REPORT}
"\n"
" > Team-policy specs"
" ${Dim}[requires team_policy=ON]${ColorReset}"
"\n"
" "
${TEAM_POLICY_REPORT}
"\n"
" "
${TEAM_POLICY_TILE_SIZE_REPORT}
"\n"
" "
"- Deposit drift [${Magenta}team_policy_drift${ColorReset}]: "
${team_policy_drift}
"\n"
" "
${VENDOR_SORT_REPORT}
"\n")

if(${mpi} AND ${DEVICE_ENABLED})
string(APPEND REPORT_TEXT " " ${GPU_AWARE_MPI_REPORT} "\n")
endif()

string(
APPEND
REPORT_TEXT
" "
${DEBUG_REPORT}
"\n"
" - Install prefix [${Magenta}CMAKE_INSTALL_PREFIX${ColorReset}]: "
"${CMAKE_INSTALL_PREFIX}"
"\n"
${DASHED_LINE_SYMBOL}
"\n"
"Compilers & dependencies"
"\n")

string(
APPEND
REPORT_TEXT
"\n"
" - C compiler [${Magenta}CMAKE_C_COMPILER${ColorReset}]: v"
${CMAKE_C_COMPILER_VERSION}
"\n"
Expand Down
Loading
Loading