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
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

[![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)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE) [![GitHub Stars](https://img.shields.io/github/stars/KiT-RT/charm_kit)](https://github.com/KiT-RT/charm_kit/stargazers)
[![Tests](https://github.com/KiT-RT/charm_kit/actions/workflows/tests.yml/badge.svg)](https://github.com/KiT-RT/charm_kit/actions/workflows/tests.yml)

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

Expand Down Expand Up @@ -30,8 +30,8 @@ Preliminaries:
2. Clone the CharmKiT repository:

```bash
git clone git@github.com:KiT-RT/CharmKiT.git
cd CharmKiT
git clone git@github.com:KiT-RT/charm_kit.git
cd charm_kit
```

3. Install Poetry and create the project environment:
Expand Down
39 changes: 39 additions & 0 deletions update_kitrt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env bash
set -euo pipefail

KITRT_REPO_URL="${KITRT_REPO_URL:-git@github.com:KiT-RT/kitrt_code.git}"
KITRT_CONTAINER_RUNTIME="${KITRT_CONTAINER_RUNTIME:-singularity}"

has_cuda_gpu() {
if ! command -v nvidia-smi >/dev/null 2>&1; then
return 1
fi
nvidia-smi -L >/dev/null 2>&1
}

cd kitrt_code
git remote set-url origin "${KITRT_REPO_URL}"
git fetch origin

default_branch="$(git symbolic-ref --quiet --short refs/remotes/origin/HEAD 2>/dev/null | sed 's#^origin/##' || true)"
if [ -z "${default_branch}" ]; then
default_branch="$(git remote show origin | sed -n '/HEAD branch/s/.*: //p' | head -n 1)"
fi
if [ -z "${default_branch}" ]; then
default_branch="$(git rev-parse --abbrev-ref HEAD)"
fi

git checkout "${default_branch}"
git pull --ff-only origin "${default_branch}"
git submodule update --init --recursive

cd tools/singularity
chmod +x install_kitrt_singularity.sh install_kitrt_singularity_cuda.sh

"${KITRT_CONTAINER_RUNTIME}" exec kit_rt.sif ./install_kitrt_singularity.sh

if has_cuda_gpu && [ -f kit_rt_MPI_cuda.sif ]; then
"${KITRT_CONTAINER_RUNTIME}" exec --nv kit_rt_MPI_cuda.sif ./install_kitrt_singularity_cuda.sh
fi

cd ../../../
Loading