peclet 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,6 @@
1
+ # Phase 0 toolchain artifacts
2
+ /build/
3
+ /extern/
4
+
5
+ # MkDocs site output (built in CI, published to Pages)
6
+ /site/
peclet-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Frank Peters
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
peclet-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,98 @@
1
+ Metadata-Version: 2.4
2
+ Name: peclet
3
+ Version: 0.1.0
4
+ Summary: GPU-accelerated & parallel simulation of transport phenomena (CFD, DEM, Voronoi) — CPU family metapackage
5
+ Project-URL: Homepage, https://github.com/computational-chemical-engineering/peclet
6
+ Project-URL: Documentation, https://github.com/computational-chemical-engineering/peclet
7
+ Author-email: Frank Peters <e.a.j.f.peters@gmail.com>
8
+ License-Expression: MIT
9
+ License-File: LICENSE
10
+ Requires-Python: >=3.10
11
+ Requires-Dist: peclet-dem==0.1.0
12
+ Requires-Dist: peclet-flow==0.1.0
13
+ Requires-Dist: peclet-morton==0.1.0
14
+ Requires-Dist: peclet-voro==0.1.0
15
+ Provides-Extra: mpi
16
+ Requires-Dist: peclet-core==0.1.0; extra == 'mpi'
17
+ Description-Content-Type: text/markdown
18
+
19
+ # peclet
20
+
21
+ A suite of codes for **simulation of transport phenomena** — Eulerian (CFD/Navier–Stokes), Lagrangian
22
+ (DEM/particle packing) and mixed (Voronoi) methods — sharing one MPI **block domain decomposition**
23
+ with efficient **asynchronous ghost-layer exchange**, **SDF**-described solids, a common **immersed
24
+ boundary** methodology, **GPU** support, and **Python bindings**.
25
+
26
+ The name nods to the [Péclet number](https://en.wikipedia.org/wiki/P%C3%A9clet_number) — the ratio of
27
+ advective to diffusive transport, the dimensionless heart of transport phenomena.
28
+
29
+ 📖 **Documentation site:** <https://computational-chemical-engineering.github.io/peclet/> — the suite's front
30
+ door (design docs + install/deployment guide + links to each code's Doxygen API). Built from `docs/`
31
+ via MkDocs ([mkdocs.yml](mkdocs.yml)).
32
+
33
+ This is an **umbrella repository**: each code is a git **submodule** (its own repo and history); this
34
+ repo pins compatible commits and holds the shared design docs.
35
+
36
+ ## Clone
37
+
38
+ ```bash
39
+ git clone --recursive git@github.com:computational-chemical-engineering/peclet.git
40
+ # or, after a plain clone:
41
+ git submodule update --init --recursive
42
+ ```
43
+
44
+ ## Layout
45
+
46
+ | Submodule | Role |
47
+ |-----------|------|
48
+ | `core/` | **Shared infrastructure** (header-only C++20 + MPI, optional Kokkos): ORB block decomposition, async grid ghost-layer exchange + Lagrangian particle migration/ghosts, SDF geometry, VTI I/O. Every method depends on it. |
49
+ | `flow/` | Eulerian **Kokkos** incompressible Navier–Stokes (porous media; staggered MAC grid + cut-cell IBM). Complete, validated, MPI-optional distributed solver on `core`; `pnm` is its pore-network-extraction module. |
50
+ | `dem/` | Lagrangian **Kokkos + ArborX** DEM/XPBD particle packing. Full XPBD step with a validated distributed `step_mpi` (core particle halo). |
51
+ | `voro/` | Mixed Lagrangian/Eulerian dynamic 3D Voronoi tessellation (header-only C++17; periodic & Lees–Edwards). |
52
+ | `morton/` | Morton/Z-order spatial-index primitive — arithmetic directly in Morton space (header-only C++17 + BMI2/AVX-512, Python). |
53
+
54
+ Both GPU codes are **Kokkos**-based; the same source runs on CUDA, HIP (AMD/LUMI), and OpenMP backends,
55
+ chosen by the bootstrapped install prefix (`tools/bootstrap_deps.sh`). The reusable parts of the original
56
+ `block_decomposer` prototype were extracted into `core/`.
57
+
58
+ ## Shared design docs
59
+
60
+ `docs/` is the cross-code contract every method follows:
61
+ [ARCHITECTURE](docs/ARCHITECTURE.md) · [CONVENTIONS](docs/CONVENTIONS.md) · [STYLE](docs/STYLE.md) ·
62
+ [INTERFACES](docs/INTERFACES.md) · [ROADMAP](docs/ROADMAP.md) ·
63
+ [PORTABILITY](docs/PORTABILITY.md). See `CLAUDE.md` for an agent-facing overview.
64
+
65
+ ## Install & run (Python)
66
+
67
+ Everything ships under one **`peclet` namespace** — installable parts of one family:
68
+
69
+ | PyPI package | Import | Role |
70
+ |---|---|---|
71
+ | `peclet-morton` | `peclet.morton` | Morton/Z-order spatial index |
72
+ | `peclet-flow` | `peclet.flow` (+ `.pnm`) | Eulerian incompressible Navier–Stokes solver |
73
+ | `peclet-dem` | `peclet.dem` | Lagrangian DEM/XPBD particle packing |
74
+ | `peclet-voro` | `peclet.voro` | Dynamic Voronoi tessellation + mesh generator |
75
+ | `peclet-core` | `peclet.core` (`.mpi`, `.amr`) | Shared infra (particle halo, AMR) — sdist only |
76
+ | `peclet` | — | metapackage: `pip install peclet` pulls the CPU family |
77
+
78
+ **Multicore CPU (OpenMP):** the compute packages ship **self-contained wheels** — `pip install peclet`
79
+ (or an individual `pip install peclet-flow`) just works and runs multi-threaded (`OMP_NUM_THREADS`).
80
+
81
+ **GPU (CUDA/HIP) and multi-rank MPI:** a portable binary wheel is impossible (arch × CUDA/ROCm × MPI-ABI),
82
+ so you build the packages from source against a Kokkos prefix, or use a container. Because the backend
83
+ (Serial / OpenMP / CUDA / HIP) is compiled in, you build for your hardware —
84
+ [**docs/DEPLOYMENT.md**](docs/DEPLOYMENT.md) is the guide: the backend×MPI matrix, `pip install` recipes
85
+ per environment, and **Apptainer containers** for Snellius (CUDA) and LUMI (HIP) in [`containers/`](containers).
86
+
87
+ ## Continuous integration & docs
88
+
89
+ Each submodule carries its own `.github/workflows/`: a **CI** workflow (build + test where feasible —
90
+ `core` and `morton` run full CPU/MPI suites; `flow` and `dem` build the Kokkos OpenMP host
91
+ backend) and a **Documentation** workflow that builds the Doxygen API docs and publishes them to that
92
+ repo's GitHub Pages. Enabling Pages once per repo (Settings → Pages → "Source: GitHub Actions") is the
93
+ only manual step.
94
+
95
+ ## Note on submodule pins
96
+
97
+ This umbrella pins each submodule to a compatible commit on `main`. Update to the latest upstream with
98
+ `git submodule update --remote` followed by a commit here that bumps the pointers.
peclet-0.1.0/README.md ADDED
@@ -0,0 +1,80 @@
1
+ # peclet
2
+
3
+ A suite of codes for **simulation of transport phenomena** — Eulerian (CFD/Navier–Stokes), Lagrangian
4
+ (DEM/particle packing) and mixed (Voronoi) methods — sharing one MPI **block domain decomposition**
5
+ with efficient **asynchronous ghost-layer exchange**, **SDF**-described solids, a common **immersed
6
+ boundary** methodology, **GPU** support, and **Python bindings**.
7
+
8
+ The name nods to the [Péclet number](https://en.wikipedia.org/wiki/P%C3%A9clet_number) — the ratio of
9
+ advective to diffusive transport, the dimensionless heart of transport phenomena.
10
+
11
+ 📖 **Documentation site:** <https://computational-chemical-engineering.github.io/peclet/> — the suite's front
12
+ door (design docs + install/deployment guide + links to each code's Doxygen API). Built from `docs/`
13
+ via MkDocs ([mkdocs.yml](mkdocs.yml)).
14
+
15
+ This is an **umbrella repository**: each code is a git **submodule** (its own repo and history); this
16
+ repo pins compatible commits and holds the shared design docs.
17
+
18
+ ## Clone
19
+
20
+ ```bash
21
+ git clone --recursive git@github.com:computational-chemical-engineering/peclet.git
22
+ # or, after a plain clone:
23
+ git submodule update --init --recursive
24
+ ```
25
+
26
+ ## Layout
27
+
28
+ | Submodule | Role |
29
+ |-----------|------|
30
+ | `core/` | **Shared infrastructure** (header-only C++20 + MPI, optional Kokkos): ORB block decomposition, async grid ghost-layer exchange + Lagrangian particle migration/ghosts, SDF geometry, VTI I/O. Every method depends on it. |
31
+ | `flow/` | Eulerian **Kokkos** incompressible Navier–Stokes (porous media; staggered MAC grid + cut-cell IBM). Complete, validated, MPI-optional distributed solver on `core`; `pnm` is its pore-network-extraction module. |
32
+ | `dem/` | Lagrangian **Kokkos + ArborX** DEM/XPBD particle packing. Full XPBD step with a validated distributed `step_mpi` (core particle halo). |
33
+ | `voro/` | Mixed Lagrangian/Eulerian dynamic 3D Voronoi tessellation (header-only C++17; periodic & Lees–Edwards). |
34
+ | `morton/` | Morton/Z-order spatial-index primitive — arithmetic directly in Morton space (header-only C++17 + BMI2/AVX-512, Python). |
35
+
36
+ Both GPU codes are **Kokkos**-based; the same source runs on CUDA, HIP (AMD/LUMI), and OpenMP backends,
37
+ chosen by the bootstrapped install prefix (`tools/bootstrap_deps.sh`). The reusable parts of the original
38
+ `block_decomposer` prototype were extracted into `core/`.
39
+
40
+ ## Shared design docs
41
+
42
+ `docs/` is the cross-code contract every method follows:
43
+ [ARCHITECTURE](docs/ARCHITECTURE.md) · [CONVENTIONS](docs/CONVENTIONS.md) · [STYLE](docs/STYLE.md) ·
44
+ [INTERFACES](docs/INTERFACES.md) · [ROADMAP](docs/ROADMAP.md) ·
45
+ [PORTABILITY](docs/PORTABILITY.md). See `CLAUDE.md` for an agent-facing overview.
46
+
47
+ ## Install & run (Python)
48
+
49
+ Everything ships under one **`peclet` namespace** — installable parts of one family:
50
+
51
+ | PyPI package | Import | Role |
52
+ |---|---|---|
53
+ | `peclet-morton` | `peclet.morton` | Morton/Z-order spatial index |
54
+ | `peclet-flow` | `peclet.flow` (+ `.pnm`) | Eulerian incompressible Navier–Stokes solver |
55
+ | `peclet-dem` | `peclet.dem` | Lagrangian DEM/XPBD particle packing |
56
+ | `peclet-voro` | `peclet.voro` | Dynamic Voronoi tessellation + mesh generator |
57
+ | `peclet-core` | `peclet.core` (`.mpi`, `.amr`) | Shared infra (particle halo, AMR) — sdist only |
58
+ | `peclet` | — | metapackage: `pip install peclet` pulls the CPU family |
59
+
60
+ **Multicore CPU (OpenMP):** the compute packages ship **self-contained wheels** — `pip install peclet`
61
+ (or an individual `pip install peclet-flow`) just works and runs multi-threaded (`OMP_NUM_THREADS`).
62
+
63
+ **GPU (CUDA/HIP) and multi-rank MPI:** a portable binary wheel is impossible (arch × CUDA/ROCm × MPI-ABI),
64
+ so you build the packages from source against a Kokkos prefix, or use a container. Because the backend
65
+ (Serial / OpenMP / CUDA / HIP) is compiled in, you build for your hardware —
66
+ [**docs/DEPLOYMENT.md**](docs/DEPLOYMENT.md) is the guide: the backend×MPI matrix, `pip install` recipes
67
+ per environment, and **Apptainer containers** for Snellius (CUDA) and LUMI (HIP) in [`containers/`](containers).
68
+
69
+ ## Continuous integration & docs
70
+
71
+ Each submodule carries its own `.github/workflows/`: a **CI** workflow (build + test where feasible —
72
+ `core` and `morton` run full CPU/MPI suites; `flow` and `dem` build the Kokkos OpenMP host
73
+ backend) and a **Documentation** workflow that builds the Doxygen API docs and publishes them to that
74
+ repo's GitHub Pages. Enabling Pages once per repo (Settings → Pages → "Source: GitHub Actions") is the
75
+ only manual step.
76
+
77
+ ## Note on submodule pins
78
+
79
+ This umbrella pins each submodule to a compatible commit on `main`. Update to the latest upstream with
80
+ `git submodule update --remote` followed by a commit here that bumps the pointers.
@@ -0,0 +1,88 @@
1
+ # Containers
2
+
3
+ Apptainer (Singularity) definition files that bake the toolchain + a bootstrapped Kokkos/ArborX prefix
4
+ and pip-install the `peclet.flow`, `peclet.dem`, and `peclet.morton` Python packages. Apptainer is the de-facto
5
+ container runtime on HPC (both **Snellius** and **LUMI** use it; Docker is not permitted on the compute
6
+ nodes).
7
+
8
+ | File | Backend | Target |
9
+ |------|---------|--------|
10
+ | `cpu.def` | Kokkos OpenMP + Serial | laptops, CI, CPU HPC partitions |
11
+ | `cuda.def` | Kokkos CUDA | **Snellius** (A100 `sm_80` default; H100 `sm_90` via env) |
12
+ | `hip.def` | Kokkos HIP | **LUMI-G** (MI250X `gfx90a`) |
13
+
14
+ ## Build
15
+
16
+ Run from the **suite root** so the `%files . /opt/peclet` section copies the full source tree
17
+ (check out submodules first):
18
+
19
+ ```bash
20
+ git submodule update --init --recursive
21
+ apptainer build peclet-cpu.sif containers/cpu.def
22
+ # GPU images compile device code for a chosen arch (no GPU needed at build time):
23
+ KOKKOS_ARCH=AMPERE80 CUDA_ARCH=80 apptainer build peclet-cuda.sif containers/cuda.def # A100
24
+ apptainer build peclet-hip.sif containers/hip.def
25
+ ```
26
+
27
+ The GPU images are large and slow to build (they compile Kokkos for the device arch); build them on a
28
+ build node, or pull/convert a prebuilt image. The arch is read from the build environment — see the
29
+ header comment in each `.def`.
30
+
31
+ ## Run
32
+
33
+ ```bash
34
+ # CPU, single process:
35
+ apptainer exec peclet-cpu.sif python3 -c "import peclet.flow, peclet.dem, peclet.morton"
36
+
37
+ # CPU, 4 MPI ranks (host mpirun launches one container per rank):
38
+ mpirun -np 4 apptainer exec peclet-cpu.sif python3 your_distributed_script.py
39
+
40
+ # NVIDIA GPU (Snellius) — --nv binds the host driver:
41
+ srun apptainer exec --nv peclet-cuda.sif python3 your_script.py
42
+
43
+ # AMD GPU (LUMI) — use the Cray-MPICH launcher wrapper (see below):
44
+ module load LUMI partition/G cray-mpich rocm
45
+ srun -n8 --gpus-per-node=8 containers/lumi-run.sh peclet-hip.sif your_script.py
46
+ ```
47
+
48
+ ## LUMI / Cray-MPICH (the `hip.def` MPI model)
49
+
50
+ LUMI-G runs **Cray-MPICH** over the **Slingshot-11** interconnect (libfabric `cxi` provider), not
51
+ OpenMPI. `hip.def` therefore uses the **MPICH-ABI hybrid** model:
52
+
53
+ 1. The container is **built against vanilla MPICH** (Ubuntu's MPICH 4.0 exports `libmpi.so.12`, the
54
+ same SONAME Cray-MPICH provides), so `dem`'s distributed step links the MPICH ABI.
55
+ 2. At **runtime**, [`lumi-run.sh`](lumi-run.sh) binds the host Cray-MPICH + libfabric + GPU-transport-
56
+ layer (GTL) libraries over the container's MPICH, so the app actually talks Slingshot and does
57
+ GPU-aware transfers. It injects `CRAY_LD_LIBRARY_PATH` (which the Cray PE sets once
58
+ `cray-mpich`/`rocm` are loaded) into the container and sets `MPICH_GPU_SUPPORT_ENABLED=1`.
59
+
60
+ ```bash
61
+ module load LUMI partition/G cray-mpich rocm # populates CRAY_LD_LIBRARY_PATH
62
+ srun -n8 --gpus-per-node=8 containers/lumi-run.sh peclet-hip.sif my_run.py
63
+ # override the host-library bind list if LUMI's layout differs:
64
+ PECLET_LUMI_BIND=/opt/cray,/var/spool/slurmd,/usr/lib64/libcxi.so.1 \
65
+ srun ... containers/lumi-run.sh peclet-hip.sif my_run.py
66
+ ```
67
+
68
+ Notes / gotchas:
69
+ - **ROCm version.** Pin the `hip.def` base (`rocm/dev-ubuntu-22.04:6.2.4`) to **≤** the LUMI driver's
70
+ ROCm (`module show rocm`); a container ROCm newer than the host driver fails at load.
71
+ - **GTL vs hsa.** The GPU-transport-layer lib (`libmpi_gtl_hsa.so`) is built against the host ROCm; if
72
+ you hit hsa-symbol errors, also bind the host `/opt/rocm` ahead of the container's in
73
+ `PECLET_LUMI_BIND` / the injected `LD_LIBRARY_PATH`.
74
+ - **Simpler path.** If your project has LUMI's `singularity-bindings` (EasyBuild) module, load it
75
+ instead — it sets the bind list + `LD_LIBRARY_PATH` for you, and `lumi-run.sh` will compose with it.
76
+
77
+ ## Snellius / other HPC notes
78
+
79
+ - **MPI ABI.** Same hybrid model: `srun`/`mpirun` on the host, MPI inside the container. `cpu.def` and
80
+ `cuda.def` ship OpenMPI; if your Snellius MPI module is OpenMPI this composes directly, otherwise bind
81
+ the host MPI or rebuild against the matching ABI.
82
+ - **GPU-aware MPI (Snellius).** Use the CUDA-aware OpenMPI module + `--nv`. The codes host-stage the
83
+ halo by default and opt into GPU-aware MPI explicitly — see `core/docs/cuda-aware-mpi.md`.
84
+ - **Arch.** `cuda.def` defaults to A100 (`sm_80`); pass `KOKKOS_ARCH=HOPPER90 CUDA_ARCH=90` for H100.
85
+ `hip.def` targets MI250X (`gfx90a`).
86
+
87
+ These `.def` files have **not** been built/tested in CI (no GPU runners); treat them as a starting
88
+ point to build on the target cluster. Roadblocks/assumptions are noted in `../docs/DEPLOYMENT.md`.
@@ -0,0 +1,48 @@
1
+ # The `peclet` metapackage — `pip install peclet` pulls the self-contained CPU (OpenMP) build of the
2
+ # suite: the Morton index, the Eulerian NS solver, the DEM packer, and the Voronoi engine. It ships NO
3
+ # code of its own (so `peclet` stays an implicit PEP-420 namespace owned by the member packages) — it is
4
+ # purely a convenience dependency set.
5
+ #
6
+ # pip install peclet # CPU family: peclet-morton + peclet-flow + peclet-dem + peclet-voro
7
+ # pip install peclet[mpi] # + peclet-core (MPI particle halo / AMR — builds from sdist, needs MPI)
8
+ #
9
+ # GPU (CUDA/HIP) and multi-rank MPI are NOT pip-installable as portable wheels (arch x CUDA/ROCm x
10
+ # MPI-ABI): build the member packages from source against a Kokkos prefix, or use the containers.
11
+ # See docs/DEPLOYMENT.md.
12
+
13
+ [build-system]
14
+ requires = ["hatchling"]
15
+ build-backend = "hatchling.build"
16
+
17
+ [project]
18
+ name = "peclet"
19
+ version = "0.1.0"
20
+ description = "GPU-accelerated & parallel simulation of transport phenomena (CFD, DEM, Voronoi) — CPU family metapackage"
21
+ readme = "README.md"
22
+ requires-python = ">=3.10"
23
+ license = "MIT"
24
+ license-files = ["LICENSE"]
25
+ authors = [{ name = "Frank Peters", email = "e.a.j.f.peters@gmail.com" }]
26
+ dependencies = [
27
+ "peclet-morton==0.1.0",
28
+ "peclet-flow==0.1.0",
29
+ "peclet-dem==0.1.0",
30
+ "peclet-voro==0.1.0",
31
+ ]
32
+
33
+ [project.optional-dependencies]
34
+ # peclet-core is sdist-only (MPI particle halo + Kokkos AMR): installing it builds from source and needs
35
+ # an MPI toolchain (+ optional Kokkos prefix for the AMR module).
36
+ mpi = ["peclet-core==0.1.0"]
37
+
38
+ [project.urls]
39
+ Homepage = "https://github.com/computational-chemical-engineering/peclet"
40
+ Documentation = "https://github.com/computational-chemical-engineering/peclet"
41
+
42
+ # No Python package is built — this metapackage is dependencies only. Point hatchling at an empty target
43
+ # so it produces a valid (code-free) wheel/sdist.
44
+ [tool.hatch.build.targets.wheel]
45
+ bypass-selection = true
46
+
47
+ [tool.hatch.build.targets.sdist]
48
+ include = ["pyproject.toml", "README.md", "LICENSE"]