Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Updates to singularity scripts and also added apptainer scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Jun 7, 2023
1 parent 7152017 commit 35e0099
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 1 deletion.
5 changes: 5 additions & 0 deletions apptainer/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
!bin/
!bin/swiftest_driver
!bin/swiftest_python
!install.sh
!setenv.sh
2 changes: 2 additions & 0 deletions apptainer/bin/swiftest_driver
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh --
apptainer exec --bind $(pwd):$(pwd) --env OMP_NUM_THREADS=${OMP_NUM_THREADS},FOR_COARRAY_NUM_IMAGES=${FOR_COARRAY_NUM_IMAGES} ${SWIFTEST_SIF} swiftest_driver "$@"
2 changes: 2 additions & 0 deletions apptainer/bin/swiftest_python
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh --
apptainer run --bind $(pwd):$(pwd) --env OMP_NUM_THREADS=${OMP_NUM_THREADS},FOR_COARRAY_NUM_IMAGES=${FOR_COARRAY_NUM_IMAGES} ${SWIFTEST_SIF} swiftest_driver "$@"
10 changes: 10 additions & 0 deletions apptainer/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh --
# This will install the Singularity container version of the swiftest_driver in place of the native compiled version into ../bin.
# In order to use the executable script, the SWIFTEST_SIF environment variable must be set to point to the location of swiftest_driver.sif, which requires this script to be called via source:
# $ . ./install.sh
#
tag=${1:-latest}
echo "Installing swiftest_driver.sif Singularity container and executable script from swiftest_driver:${tag} Docker container"
apptainer pull --force swiftest.sif docker://daminton/swiftest:${tag}
cp -rf bin/swiftest_driver ../bin/
source ./setenv.sh
4 changes: 4 additions & 0 deletions apptainer/setenv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh --
# This will set the SWIFTEST_SIF environment variable as long as it is executed by source.
# $ . ./setenv.sh
export SWIFTEST="${PWD}/swiftest.sif"
1 change: 1 addition & 0 deletions singularity/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
!bin/
!bin/swiftest_driver
!bin/swiftest_python
!install.sh
!setenv.sh
2 changes: 1 addition & 1 deletion singularity/bin/swiftest_driver
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/sh --
singularity run --bind $(pwd):$(pwd) exec --env OMP_NUM_THREADS=${OMP_NUM_THREADS},FOR_COARRAY_NUM_IMAGES=${FOR_COARRAY_NUM_IMAGES} ${SWIFTEST_SIF} swiftest_driver "$@"
singularity exec --bind $(pwd):$(pwd) --env OMP_NUM_THREADS=${OMP_NUM_THREADS},FOR_COARRAY_NUM_IMAGES=${FOR_COARRAY_NUM_IMAGES} ${SWIFTEST_SIF} swiftest_driver "$@"
2 changes: 2 additions & 0 deletions singularity/bin/swiftest_python
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh --
singularity run --bind $(pwd):$(pwd) --env OMP_NUM_THREADS=${OMP_NUM_THREADS},FOR_COARRAY_NUM_IMAGES=${FOR_COARRAY_NUM_IMAGES} ${SWIFTEST_SIF} swiftest_driver "$@"

0 comments on commit 35e0099

Please sign in to comment.