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
40 changes: 40 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Tests

on:
push:
branches:
- main
- master
pull_request:
workflow_dispatch:

jobs:
pytest:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version:
- "3.10"
- "3.11"

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: |
requirements.txt
pyproject.toml

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Run pytest
run: pytest -q
36 changes: 24 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@

# charm_kit
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) [![GitHub Stars](https://img.shields.io/github/stars/KiT-RT/CharmKiT)](https://github.com/KiT-RT/CharmKiT/stargazers)
[![Tests](https://github.com/KiT-RT/CharmKiT/actions/workflows/tests.yml/badge.svg)](https://github.com/KiT-RT/CharmKiT/actions/workflows/tests.yml)

# charm_kit: A wrapper for KiT-RT to conduct simulation sweeps fast


charm_kit is a benchmarking suite for the CharmNet project, providing automated parameter studies and test case management for the [KiT-RT PDE simulator](https://kit-rt.readthedocs.io/en/develop/index.html). It enables reproducible runs of radiative transfer test cases such as the lattice and hohlraum setups, using Python scripts to manage parameter sweeps, configuration, and result collection. charm_kit supports both high-performance computing (HPC) and local (no-HPC) execution modes, leveraging Singularity containers for reproducibility.

Expand Down Expand Up @@ -34,6 +38,15 @@ Preliminaries:
```
If on a cluster without root, build the container locally and upload it to `charm_kit/kitrt_code/tools/singularity/`.

## Testing

Run unit tests from the repo root:

```bash
poetry install --with dev
poetry run pytest -q
```


## How charm_kit Works

Expand Down Expand Up @@ -68,7 +81,6 @@ Execution and I/O flags:
- `--slurm`: Submit jobs through SLURM.
- `--singularity`: Run KiT-RT through the CPU Singularity image.
- `--cuda`: Run KiT-RT through the CUDA Singularity image (`--nv` is added automatically).
- `--load-from-npz`: Load parameter samples from NPZ input (script-dependent behavior).
- `--csv CSV`: Read design parameters from CSV and write QOIs back to that CSV.
- `--config CONFIG`: Path to a TOML hyperparameter file.
- `-q`, `--quiet`: Suppress solver stdout/stderr output.
Expand Down Expand Up @@ -108,19 +120,19 @@ Precedence for hyperparameters is:
1. **Local mode, raw (no Singularity)**

```bash
python3 run_lattice.py
poetry run python run_lattice.py
# or
python3 run_hohlraum.py
poetry run python run_hohlraum.py
```

Uses local executable: `./kitrt_code/build/KiT-RT`.

2. **Local mode + Singularity (CPU)**

```bash
python3 run_lattice.py --singularity
poetry run python run_lattice.py --singularity
# or
python3 run_hohlraum.py --singularity
poetry run python run_hohlraum.py --singularity
```

Uses image/executable:
Expand All @@ -129,9 +141,9 @@ Precedence for hyperparameters is:
3. **Local mode + Singularity + GPU**

```bash
python3 run_lattice.py --cuda
poetry run python run_lattice.py --cuda
# or
python3 run_hohlraum.py --cuda
poetry run python run_hohlraum.py --cuda
```

Uses image/executable:
Expand All @@ -140,19 +152,19 @@ Precedence for hyperparameters is:
4. **SLURM mode, raw (no Singularity)**

```bash
python3 run_lattice.py --slurm
poetry run python run_lattice.py --slurm
# or
python3 run_hohlraum.py --slurm
poetry run python run_hohlraum.py --slurm
```

Generated SLURM scripts call: `srun ./kitrt_code/build/KiT-RT ...`.

5. **SLURM mode + Singularity (CPU)**

```bash
python3 run_lattice.py --slurm --singularity
poetry run python run_lattice.py --slurm --singularity
# or
python3 run_hohlraum.py --slurm --singularity
poetry run python run_hohlraum.py --slurm --singularity
```

Generated SLURM scripts call:
Expand Down
Binary file removed benchmarks/half_lattice/.DS_Store
Binary file not shown.
Empty file.
54 changes: 0 additions & 54 deletions benchmarks/half_lattice/half_lattice.cfg

This file was deleted.

Binary file removed benchmarks/half_lattice/mesh/.DS_Store
Binary file not shown.
Loading