Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
160 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
3d22fd0
initial commit on internal renderer
LudwigBoess Jun 30, 2026
ca24afe
add background to rendered image
LudwigBoess Jun 30, 2026
614aff4
added colorbar
LudwigBoess Jun 30, 2026
df10820
significant speedup
LudwigBoess Jun 30, 2026
ec55fcf
reduce send/recv via uint8
LudwigBoess Jun 30, 2026
6dd8117
added option to define colorbar ticks as parameter
LudwigBoess Jun 30, 2026
a84c821
generalize field rendering
LudwigBoess Jun 30, 2026
36ce55c
generalized field rendering
LudwigBoess Jun 30, 2026
866bf50
added Vmag rendering
LudwigBoess Jun 30, 2026
afb45f5
support for 2D rendering
LudwigBoess Jun 30, 2026
02cf11c
rendering of axis spines, ticks and labels
LudwigBoess Jun 30, 2026
5a0bffc
3D field lines
LudwigBoess Jun 30, 2026
7f8e819
2D field lines
LudwigBoess Jul 1, 2026
4c66325
option to plot time label
LudwigBoess Jul 1, 2026
95f08f2
added option to provide axis limits to rendering
LudwigBoess Jul 1, 2026
856d66c
added moving camera to track e.g. shock fronts
LudwigBoess Jul 1, 2026
cc78232
style updates
LudwigBoess Jul 1, 2026
0bf6e74
added more colormaps
LudwigBoess Jul 1, 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
9d74601
always render axis ticks in the foreground
LudwigBoess Jul 5, 2026
28f9dab
python script to preview render orientation
LudwigBoess Jul 5, 2026
2511855
Merge branch '1.5.0rc' into dev/raytrace_renderer
LudwigBoess Jul 14, 2026
e825a25
planetarium dome rendering in 2D
LudwigBoess Jul 25, 2026
01b526a
fix memory lead for intel sorting
LudwigBoess Jul 27, 2026
ea15a40
Merge branch 'master' into 1.5.0rc
LudwigBoess Jul 27, 2026
c1e851a
3D dome rendering
LudwigBoess Jul 28, 2026
1c90d79
extended external force to be able to access particle properties
LudwigBoess Jul 28, 2026
8a81f77
Merge branch '1.5.0rc' into bug/intel_sort_memleak
LudwigBoess Jul 28, 2026
410dca1
Merge branch '1.5.0rc' into dev/raytrace_renderer
LudwigBoess Jul 28, 2026
b50fad6
only render half-sphere within `dome_radius` to avoid corner projecti…
LudwigBoess Jul 29, 2026
2d0a157
added spectra3D components to entity_1.5rc
Jul 31, 2026
7c828be
fixed bug in metadomain_io.cpp and added template g_checkpoint_writer…
Jul 31, 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
49c0e19
Merge branch '1.5.0rc' into dev/external_force_particleprops
LudwigBoess Aug 12, 2026
650ff75
Merge branch '1.5.0rc' into dev/raytrace_renderer
LudwigBoess Aug 12, 2026
4be464a
evaluate metric once for gr pusher all iterations
alisagk Aug 17, 2026
b932d8b
explicit tetrad transform in gr pusher
alisagk Aug 17, 2026
3349f5c
pass is_left through to CrossesPiston so a right-facing wall can reus…
LudwigBoess Aug 21, 2026
523c401
bugfix in conductor BCs
LudwigBoess Aug 21, 2026
1aa6ee9
Turn inline Lambda into proper kernel to avoid NVidia compilation error
LudwigBoess Aug 21, 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
53cb461
Merge branch '1.5.0rc' into dev/external_force_particleprops
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
1fc6420
upd dependencies py for new kokkos v
haykh Sep 10, 2026
23c3128
fixed some typos in the spectra3D additions (GPU still not fixed)
Sep 14, 2026
a52726d
Merge remote-tracking branch 'origin/1.5.0rc' into spectra3D
haykh Sep 14, 2026
7bae89d
gitignore devenv
haykh Sep 14, 2026
50040dc
spectra3d merged with regular spectra output
haykh Sep 14, 2026
3a75390
.gitignore for devenv
haykh Sep 14, 2026
99a7339
refactor checkpoint/io/comms for metadomain + containers
haykh Sep 14, 2026
c5bc9eb
RUNPGENS + RUNTESTS
haykh Sep 14, 2026
1e41bd5
refactored stats output in the same spirit
haykh Sep 14, 2026
9ec9842
merged with new 1.5.0rc
haykh Sep 15, 2026
2076f0f
particle energy distribution calc refactored (incl. spatial)
haykh Sep 15, 2026
6989938
declare and call spatial bins in writing
haykh Sep 15, 2026
7c88d0f
spatially binned spectra done (probably)
haykh Sep 15, 2026
a94afa5
minor bugs
haykh Sep 15, 2026
aebfdcc
minor bugfix
haykh Sep 15, 2026
56b174c
rm old spec3d
haykh Sep 15, 2026
6697b95
input for shock fixed back
haykh Sep 15, 2026
87bf6ad
refactor particle-dependent external force via `HasExtFx*WithIndex` t…
LudwigBoess Sep 16, 2026
e3690bd
Merge branch '1.5.0rc' into dev/external_force_particleprops
LudwigBoess Sep 16, 2026
7d6bb45
vendor report moved
haykh Sep 21, 2026
bdc3172
perlmutter dep fixed
haykh Sep 21, 2026
c3dcd1c
Merge pull request #222 from entity-toolkit/dev/external_force_partic…
haykh Sep 21, 2026
940019d
spec test
haykh Sep 21, 2026
7258dca
RUNTESTS
haykh Sep 21, 2026
bfb93e3
Merge branch 'spectra3D' of github.com:entity-toolkit/entity into spe…
haykh Sep 21, 2026
881a9e3
RUNTESTS
haykh Sep 21, 2026
d29b395
Merge pull request #226 from entity-toolkit/spectra3D
haykh Sep 21, 2026
c56f796
minor
haykh Sep 21, 2026
7e7487e
Merge branch '1.5.0rc' of github.com:entity-toolkit/entity into 1.5.0rc
haykh Sep 21, 2026
022b007
merged 1.5.0rc
haykh Sep 21, 2026
33ac2eb
revert conductor BC normal-B fix, preserved on bug/conductor_bcs_norm…
LudwigBoess Sep 21, 2026
06996c5
Merge branch '1.5.0rc' into bug/conductor_piston
LudwigBoess Sep 21, 2026
4aac8c9
taplo -> tombi
haykh Sep 21, 2026
3b7f863
scripts to separate folder
haykh Sep 21, 2026
3e1d9b8
CITATION
haykh Sep 21, 2026
bd5773c
correct schema
haykh Sep 21, 2026
ec16905
devenv setup
haykh Sep 21, 2026
6ea5dad
adios2 version in nix
haykh Sep 21, 2026
d732be0
minor
haykh Sep 21, 2026
6e53061
cmake v bump, team_policy/vendor_sort moved to separate file
haykh Sep 24, 2026
ed57031
bump adios2 v
haykh Sep 24, 2026
6ac7f48
tiled_deposit and vendor_sort specific cmake
haykh Sep 24, 2026
7e22bb6
update on defaults and report
haykh Sep 24, 2026
e4303a6
[BUG!!!] FixFieldsConst was silently ignored
haykh Sep 24, 2026
83da0a4
[BUGv2!!!] FixFieldsConst was silently ignored in shock
haykh Sep 24, 2026
6b7e005
render_preview -> render + movie capability
haykh Sep 24, 2026
b78af71
team_policy -> tiled_deposit
haykh Sep 24, 2026
54ca188
rm deprecated team_policy flags
haykh Sep 24, 2026
2a30aaf
render now independent of output
haykh Sep 24, 2026
e5db7cc
minor
haykh Sep 24, 2026
cefb035
deprecation on team_policy flag
haykh Sep 24, 2026
c8a7285
changed render params
haykh Sep 27, 2026
eae626f
[output.render]->[render]
haykh Sep 27, 2026
c2998ba
Merge pull request #219 from entity-toolkit/dev/raytrace_renderer
haykh Sep 27, 2026
23a3eae
disable certain flags if reqs not met
haykh Sep 28, 2026
84c89d3
formatting with tombi
haykh Sep 28, 2026
beb8e61
Merge pull request #228 from alisagk/dev/gr-pusher
alisagk Sep 28, 2026
427cfdf
Fix slow parallel checkpoint read (COMM_SELF + O(N^2) metadata loop)
Alcauchy Sep 28, 2026
4e5d322
Merge branch '1.5.0rc' into bug/conductor_piston
LudwigBoess Sep 29, 2026
417334c
Merge pull request #225 from entity-toolkit/bug/conductor_piston
haykh Oct 1, 2026
832e3e6
Merge branch '1.5.0rc' into chkpt_read_fix
haykh Oct 5, 2026
7b1249d
1.5.0rc merge cleanup
haykh Oct 5, 2026
1fce041
Merge pull request #229 from entity-toolkit/chkpt_read_fix
haykh Oct 5, 2026
3d276bc
upd readme
haykh Oct 5, 2026
e60fbb7
cartesian_sr merged from dev/qed
haykh Oct 6, 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
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,8 @@ action-token
ignore-*
tombi/
tidy/
.claude
.claude

# devenv
.devenv*
devenv.local.nix
6 changes: 0 additions & 6 deletions .taplo.toml

This file was deleted.

23 changes: 23 additions & 0 deletions .tombi.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
toml-version = "v1.0.0"

[format]
[format.rules]
indent-sub-tables = true
indent-table-key-value-pairs = true
key-value-equals-sign-alignment = true
trailing-comment-alignment = true

[schema]
enabled = true
strict = true

[[schemas]]
path = "entity.schema.json"
include = ["**/*.toml"]
exclude = [
".tombi.toml",
"extern/**",
".venv/**",
"build/**",
"**/*.ckpt/**",
]
2 changes: 1 addition & 1 deletion CITATION
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ For the general relativistic module, please cite the following paper:
```latex
@ARTICLE{EntityGR_2025,
author = {{Galishnikova}, Alisa and {Hakobyan}, Hayk and {Philippov}, Alexander and {Crinquand}, Benjamin},
title = "{$\mathtt{Entity}$ -- Hardware-agnostic Particle-in-Cell Code for Plasma Astrophysics. II: General Relativistic Module}",
title = "{Entity -- Hardware-agnostic Particle-in-Cell Code for Plasma Astrophysics. II: General Relativistic Module}",
journal = {arXiv e-prints},
keywords = {High Energy Astrophysical Phenomena},
year = 2025,
Expand Down
58 changes: 43 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# cmake-lint: disable=C0103,C0111,E1120,R0913,R0915

cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.22)
cmake_policy(SET CMP0110 NEW)

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,22 @@ set(gpu_aware_mpi
${default_gpu_aware_mpi}
CACHE BOOL "Enable GPU-aware MPI")

set(tiled_deposit
${default_tiled_deposit}
CACHE BOOL "Enable tile-blocked deposit/pusher kernels")
set(tiled_deposit_tile_size
${default_tiled_deposit_tile_size}
CACHE STRING "tiled deposit tile edge length in cells")
set(tiled_deposit_tile_sizes
"4;6;8;10;12;14;16"
CACHE STRING "tiled deposit tile-size choices")
set(tiled_deposit_drift
${default_tiled_deposit_drift}
CACHE STRING "tiled deposit scratch halo drift in cells")
set(vendor_sort
${default_vendor_sort}
CACHE BOOL "Use the vendor sort_by_key")

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

if(NOT ${DEVICE_ENABLED})
set(vendor_sort OFF)
endif()

if(NOT ${DEVICE_ENABLED} OR NOT ${mpi})
set(gpu_aware_mpi OFF)
endif()

# tiled deposit
if(${tiled_deposit})
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/tiled_deposit.cmake)
else()
message(
STATUS "tiled_deposit=OFF; using global deposit scheme with ScatterViews")
endif()

# vendor-specific sorting routines
if(${vendor_sort})
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/vendor_sort.cmake)
else()
message(STATUS "vendor_sort=OFF; forcing Kokkos::BinSort "
"fallback for spatial sort_by_key")
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
77 changes: 72 additions & 5 deletions CODEGUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ entity
├── pgens # problem generators
├── examples # example problem generators with standard use-cases
├── tutorials # problem generators from tutorials
├── scripts # user-facing helper scripts
│ ├── dependencies.py # deployment scripts on various machines
│ ├── generate_template.py # renders `input.default.toml` from `entity.schema.json`
│ ├── ideal_tile_size.py # recommends the team tile size for the tiled deposit
│ └── render.py # helper tools for the on-the-fly rendering routine
├── src # main code containing all separate submodules
│ ├── archetypes # archetypes which can be used by the user in problem generators
│ ├── engines # simulation engines
Expand All @@ -48,15 +53,15 @@ entity
├── .gitattributes
├── .gitignore
├── .gitmodules
├── .taplo.toml # formatting guidelines for toml files
├── .tombi.toml # formatting guidelines for toml files + schema association
├── CITATION
├── CODEGUIDE.md # this file
├── CMakeLists.txt # root cmake file
├── CODE_OF_CONDUCT.md
├── LICENSE
├── README.md
├── dependencies.py # deployment scripts on various machines
└── input.example.toml # most complete toml file with all possible input options
├── entity.schema.json # JSON Schema for the input file: the source of truth
└── input.default.toml # generated reference input with every option at its default
```

## Testing
Expand All @@ -75,13 +80,75 @@ You can also compile all the problem generators and run the ones from the `examp
./dev/scripts/tests.sh --build build_dir --flags "-D mpi=ON" --with_pgens --make_plots
```

## Input configuration

`entity.schema.json` is the single source of truth for the input file. It is a [JSON Schema](https://json-schema.org) (draft 2020-12) describing every table and key the code reads, and it serves two purposes at once:

* editors validate and autocomplete input files against it as you type (see [Formatting](#formatting) below);
* `input.default.toml` -- the annotated reference input listing every option -- is *generated* from it, so the docs cannot drift from what is validated.

Regenerate the reference input after any schema change:

```sh
python scripts/generate_template.py -d -o input.default.toml
```

Dropping `-d` renders the same file with every value left as `""`, i.e. a blank form to fill in rather than a list of defaults. Writing to stdout (the default) is handy for reviewing a change: `diff <(python scripts/generate_template.py -d) input.default.toml`.

### The `x-entity` annotations

Standard JSON Schema keywords (`type`, `enum`, `minimum`, `items`, `prefixItems`, `required`, `default`, `deprecated`, ...) carry everything a validator can check. Everything else lives in an `x-entity` object on the node, and is what the generator turns into the `@`-annotations above each key:

| field | meaning |
| --- | --- |
| `type` | the literal `@type:` string, e.g. `"array<uint> [size 1 :->: 3]"` -- richer than the JSON type |
| `default` | the literal `@default:` text, for defaults the code computes at runtime (`"N_GHOSTS"`, `"1% of the domain size"`) or that need a specific notation (`"1e-4"` rather than `0.0001`) |
| `notes` | ordered `@note:` lines; embedded newlines are kept as hard line breaks |
| `examples` | ordered `@example:` lines |
| `enum` | an *illustrative, non-exhaustive* value list, never validated (e.g. `output.fields.quantities`) |
| `deprecated` | the `@deprecated:` text, paired with the standard `"deprecated": true` |
| `inferred` | see below |

`x-entity.inferred` sits on a **table** and lists quantities the code derives rather than reads -- `grid.dim`, `scales.sigma0`, `checkpoint.start_step`. They are deliberately *not* in `properties`, so `additionalProperties: false` rejects them as input keys, and the generator emits them as an `@inferred:` comment block after that table's own keys.

### Adding a new input parameter

1. Add the key to `entity.schema.json`, in the position you want it to appear in the reference input -- property order is emission order, and scalar keys are emitted before sub-tables regardless.
2. Give it a `description` (the brief line) and an `x-entity.type`; add real constraints (`minimum`, `enum`, `minItems`, ...) wherever they are checkable, and a `default` when it has a literal one.
3. Regenerate `input.default.toml`.
4. Parse it in `src/framework/parameters/`, and register any derived quantity under `x-entity.inferred`.

Three things to keep in mind:

* **String enums are matched case-insensitively by the code** (`fmt::toLower` is applied to `engine`, `metric`, the boundary lists, `pusher`, `log_level`, ...), so a bare `"enum"` would reject perfectly valid input. The convention is `anyOf: [{"enum": [<canonical>]}, {"type": "string", "pattern": "(?i)^(<canonical>|...)$"}]` -- the enum branch drives completion and hover, the pattern branch keeps any casing legal. Note `(?i)` is a Rust/Python regex extension: tombi honours it, JS-based validators do not.
* **Every table is closed.** Set `additionalProperties: false` so typos are caught; tombi's `strict = true` closes objects that omit it anyway. `[setup]` is the one deliberate exception (`additionalProperties: true`), since its keys belong to the problem generator.
* **If a key's documented default is `[]`, the empty array must validate**, which `minItems` would otherwise forbid -- use `anyOf: [{"maxItems": 0}, {<the real shape>}]` (see `render.extent.x1`).

## Code guidelines

### Formatting

To maintain coherence throughout the source code, we use `clang-format` to enforce a uniform style. A corresponding `.clang-format` file with all the style-related settings can be found in the root directory of the code. To use this, one needs to have the `clang-format` executable (typically provided with the `llvm` package). After installing the `clang-format` itself (check by running `clang-format --version`), you can use it either manually by running `clang-format .` in the route directory of the code, or attach it to your favorite code editor to run on save. For VSCode, the recommended extension is [`xaver.clang-format`](https://github.com/xaverh/vscode-clang-format), for vim -- [`rhysd/vim-clang-format`](https://vimawesome.com/plugin/vim-clang-format), for nvim -- [`stevearc/conform.nvim`](https://github.com/stevearc/conform.nvim), for [emacs](https://www.vim.org/download.php).

You can run the formatting on all files with `./dev/scripts/format.sh`.
You can run the formatting on all files with `./dev/scripts/format.sh` (this covers C++ and CMake; TOML is handled separately, below).

TOML files are formatted and validated with [`tombi`](https://tombi-toml.github.io/tombi/), which is a formatter, linter and language server in one. The settings live in `.tombi.toml` in the root directory, which also associates `entity.schema.json` with every `.toml` file in the tree -- so input files are checked against the schema as you edit them, with completion and hover documentation for every key. It is provided by the nix shell (`dev/nix`); otherwise install it with `uvx tombi`, `pip install tombi`, `npm i -g tombi` or `brew install tombi`.

From the command line:

```sh
tombi format # formats the whole project (or pass files/directories)
tombi format --check # verify only, for CI -- mirrors `format.sh --verify`
tombi lint <file.toml> # schema validation only
```

In the editor, point it at the `tombi lsp` language server. For VSCode, the extension is [`tombi-toml.tombi`](https://marketplace.visualstudio.com/items?itemName=tombi-toml.tombi); for nvim, `tombi` ships as a built-in `nvim-lspconfig` server, so `vim.lsp.enable('tombi')` is enough. Individual input files can opt into the schema explicitly -- useful outside the repo -- with a directive on the first line:

```toml
#:schema ./entity.schema.json
```

> `tombi` replaces `taplo`, which the project used previously and which is no longer maintained.

Best practices are also enforced using `clang-tidy`; to generate recommendations for all the files, run `./dev/scripts/tidy.sh --build build_dir` where `build_dir` is the directory where the code was built, or for specific files: `./dev/scripts/tidy.sh --build build_dir --files "(file1|file2).cpp"` or only for the changed files: `./dev/scripts/tidy.sh --build build_dir --changed`. The recommendations will be in the `tidy/` directory.

Expand Down Expand Up @@ -120,4 +187,4 @@ Best practices are also enforced using `clang-tidy`; to generate recommendations

* There is no difference between `.h` and `.hpp` files as both indicate C++ header files. As a consistency convention, we use `.h` for common headers which may be included from multiple `.cpp` files (e.g., metrics), while `.hpp` are very specific headers for only a single (or a couple of) .cpp file (e.g. kernels).

* Do assertions on parameters and quantities whenever possible. Outside the kernels, use `raise::Error(message, HERE)` and `raise::ErrorIf(condition, message, HERE)` to throw exceptions. Inside the kernels, use `raise::KernelError(HERE, message, **args)`. To enable compile-time errors, use `static_assert(condition, message)`. The `HERE` keyword is macro that includes the filename and line number in the error message.
* Do assertions on parameters and quantities whenever possible. Outside the kernels, use `raise::Error(message, HERE)` and `raise::ErrorIf(condition, message, HERE)` to throw exceptions. Inside the kernels, use `raise::KernelError(HERE, message)`. To enable compile-time errors, use `static_assert(condition, message)`. The `HERE` keyword is macro that includes the filename and line number in the error message.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ Our [detailed documentation](https://entity-toolkit.github.io/) includes everyth

## News

- [Oct 2026]: spectra output now support **spatial binning** [PR #226](https://github.com/entity-toolkit/entity/pull/226)
- [Oct 2026]: native [**on-the-fly plotter**](https://entity-toolkit.github.io/wiki/content/3-advanced/3-rendering/) is now available [PR #219](https://github.com/entity-toolkit/entity/pull/219)
- [Oct 2026]: added [**dynamic load balancing**](https://entity-toolkit.github.io/wiki/content/3-advanced/4-load_balancing/) for multi-node runs [PR #216](https://github.com/entity-toolkit/entity/pull/216)
- [May 2026]: our **method paper** for higher-order shape functions and generalized field stencils is [online](https://ui.adsabs.harvard.edu/abs/2026arXiv260515260B/abstract)
- [Apr 2026]: user-defined **custom particle update** functionality [PR #198](https://github.com/entity-toolkit/entity/pull/198)
- [Apr 2026]: **moving window** [PR #196](https://github.com/entity-toolkit/entity/pull/196)
Expand Down
39 changes: 39 additions & 0 deletions cmake/defaults.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,42 @@ else()
endif()

set_property(CACHE default_gpu_aware_mpi PROPERTY TYPE BOOL)

if(DEFINED ENV{Entity_ENABLE_TILED_DEPOSIT})
set(default_tiled_deposit
$ENV{Entity_ENABLE_TILED_DEPOSIT}
CACHE INTERNAL "Default flag for tiled_deposit tile-blocked kernels")
elseif(DEFINED ENV{Entity_ENABLE_TEAM_POLICY})
message(WARNING "`Entity_ENABLE_TEAM_POLICY` is deprecated, "
"use `Entity_ENABLE_TILED_DEPOSIT` instead")
set(default_tiled_deposit
$ENV{Entity_ENABLE_TEAM_POLICY}
CACHE INTERNAL "Default flag for tiled_deposit tile-blocked kernels")
else()
set(default_tiled_deposit
OFF
CACHE INTERNAL "Default flag for tiled_deposit tile-blocked kernels")
endif()
set_property(CACHE default_tiled_deposit 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_tiled_deposit_tile_size
8
CACHE INTERNAL "Default tile edge length in cells for tiled_deposit")

set(default_tiled_deposit_drift
1
CACHE INTERNAL
"Default tiled-deposit scratch halo drift (cells between sorts)")
4 changes: 2 additions & 2 deletions cmake/dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ 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
CACHE STRING "ADIOS2 repository")
set(adios2_TAG
v2.11.0
v2.12.1
CACHE STRING "ADIOS2 tag")

set(CONNECTION_CHECKED
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()
Loading
Loading