Skip to content

Commit

Permalink
fix: set singularity cachedir & tmpdir in submission script
Browse files Browse the repository at this point in the history
for eddie, need to set cachedir to /exports/eddie/scratch/$USER/.singularity
and set sing tmpdir to \$TMPDIR
  • Loading branch information
kelly-sovacool committed Jan 21, 2025
1 parent 1740bc2 commit 440cee9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
11 changes: 7 additions & 4 deletions charlie
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,8 @@ function run() {
fi
preruncleanup

$EXPORT_SING_CACHE_DIR_CMD
export SINGULARITY_CACHEDIR=$SING_CACHE_DIR
export SINGULARITY_TMPDIR=$TMPDIR

snakemake -s $SNAKEFILE\
--directory $WORKDIR \
Expand Down Expand Up @@ -466,15 +467,15 @@ function run() {

preruncleanup
cat ${WORKDIR}/config/${PLATFORM}/submit_script.sh |\
envsubst '$CLUSTER_PROFILE $CONFIGFILE $EXPORT_SING_CACHE_DIR_CMD $MODULE_LOAD $PARTITION $SINGULARITY_BINDS $SNAKEFILE $trigger $WORKDIR' \
envsubst '$CLUSTER_PROFILE $CONFIGFILE $SING_CACHE_DIR $MODULE_LOAD $PARTITION $SINGULARITY_BINDS $SNAKEFILE $trigger $WORKDIR' \
> ${WORKDIR}/submit_script.sh
sbatch ${WORKDIR}/submit_script.sh

elif [ "$1" == "qsub" ]; then

preruncleanup
cat ${WORKDIR}/config/${PLATFORM}/submit_script.sh |\
envsubst '$CLUSTER_PROFILE $CONFIGFILE $EXPORT_SING_CACHE_DIR_CMD $MODULE_LOAD $PARTITION $SINGULARITY_BINDS $SNAKEFILE $trigger $WORKDIR' \
envsubst '$CLUSTER_PROFILE $CONFIGFILE $SING_CACHE_DIR $MODULE_LOAD $PARTITION $SINGULARITY_BINDS $SNAKEFILE $trigger $WORKDIR' \
> ${WORKDIR}/run_script.sh
pushd $WORKDIR && bash run_script.sh && popd

Expand Down Expand Up @@ -593,12 +594,14 @@ function main(){
if [[ -z "$SING_CACHE_DIR" ]]; then
if [[ -d "/data/$USER" ]]; then
SING_CACHE_DIR="/data/$USER/.singularity"
elif [[ "$PLATFORM" == "eddie" ]]; then
SING_CACHE_DIR="/exports/eddie/scratch/$USER/.singularity"
else
SING_CACHE_DIR="${WORKDIR}/.singularity"
fi
export SING_CACHE_DIR
echo "singularity cache dir (--singcache) is not set, using ${SING_CACHE_DIR}"
fi
export EXPORT_SING_CACHE_DIR_CMD="export SINGULARITY_CACHEDIR=\"${SING_CACHE_DIR}\""

# required files
export CONFIGFILE="${WORKDIR}/config.yaml"
Expand Down
2 changes: 1 addition & 1 deletion config/biowulf/submit_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

cd $SLURM_SUBMIT_DIR
$MODULE_LOAD
$EXPORT_SING_CACHE_DIR_CMD
export SINGULARITY_CACHEDIR=$SING_CACHE_DIR

snakemake -s $SNAKEFILE \
--directory $WORKDIR \
Expand Down
3 changes: 2 additions & 1 deletion config/eddie/submit_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

. /etc/profile.d/modules.sh
$MODULE_LOAD
$EXPORT_SING_CACHE_DIR_CMD
export SINGULARITY_CACHEDIR=$SING_CACHE_DIR
export SINGULARITY_TMPDIR=$TMPDIR

snakemake -s $SNAKEFILE \
--directory $WORKDIR \
Expand Down
2 changes: 1 addition & 1 deletion config/fnlcr/submit_script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

cd $SLURM_SUBMIT_DIR
$MODULE_LOAD
$EXPORT_SING_CACHE_DIR_CMD
export SINGULARITY_CACHEDIR=$SING_CACHE_DIR

snakemake -s $SNAKEFILE \
--directory $WORKDIR \
Expand Down

0 comments on commit 440cee9

Please sign in to comment.