From b3715084d9b5659db2b69e9308f1e42db0219d1e Mon Sep 17 00:00:00 2001
From: Blaise Li <blaise.li__git@nsup.org>
Date: Fri, 12 Jul 2024 17:15:41 +0200
Subject: [PATCH] TMPDIR in the cluster is in /local/scratch/tmp

---
 singularity/run_pipeline.sh      | 4 ++--
 singularity/workflows_shell.sh   | 2 +-
 singularity/wrap_in_container.sh | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/singularity/run_pipeline.sh b/singularity/run_pipeline.sh
index ac4eb56..ddb47de 100755
--- a/singularity/run_pipeline.sh
+++ b/singularity/run_pipeline.sh
@@ -114,7 +114,7 @@ cluster_opts="--cluster \\\'sbatch --mem={cluster.ram} --cpus-per-task={threads}
 #cluster_opts="--cores 20 --cluster \'sbatch --mem={cluster.ram} --cpus-per-task={threads} --job-name={rule}-{wildcards} --qos=${QOS} --part=${PART} --mpi=none\' -j 300"
 #cmd="APPTAINERENV_USER=${USER} apptainer run --cleanenv -B /opt/hpc/slurm -B /var/run/munge -B /pasteur ${container} ${PROGNAME} ${pipeline_config} ${cluster_opts} --cluster-config ${cluster_config}"
 #cmd="APPTAINERENV_USER=${USER} apptainer run --cleanenv -B /opt/hpc/slurm -B /var/run/munge -B /pasteur ${container} ${PROGNAME} $@"
-cmd="APPTAINERENV_USER=${USER} apptainer run -B /opt/hpc/slurm -B /var/run/munge -B /pasteur ${container} ${PROGNAME} $@ ${cluster_opts}"
+cmd="APPTAINERENV_USER=${USER} apptainer run -B /opt/hpc/slurm -B /var/run/munge -B /pasteur -B /local  ${container} ${PROGNAME} $@ ${cluster_opts}"
 
 # This script can be called from various symbolic links.
 # The name of the link determines which snakefile to use.
@@ -127,6 +127,6 @@ cmd="APPTAINERENV_USER=${USER} apptainer run -B /opt/hpc/slurm -B /var/run/munge
 # that are expected to be in a specific location there.
 # singularity run -B /pasteur -B /run/shm:/run/shm ${container} ${PROGNAME} $@
 #[[ $(hostname) = "pisa" ]] && SINGULARITYENV_USER=${USER} singularity run --cleanenv -B /pasteur -B /run/shm:/run/shm ${container} ${PROGNAME} $@ || sbatch --qos=${QOS} --part=${PART} --wrap="${cmd}"
-[[ $(hostname) = "pisa" ]] && SINGULARITYENV_USER=${USER} singularity run -B /pasteur -B /run/shm:/run/shm ${container} ${PROGNAME} $@ || sbatch --qos=${QOS} --part=${PART} --wrap="${cmd}"
+[[ $(hostname) = "pisa" ]] && SINGULARITYENV_USER=${USER} singularity run -B /pasteur -B /local -B /run/shm:/run/shm ${container} ${PROGNAME} $@ || sbatch --qos=${QOS} --part=${PART} --wrap="${cmd}"
 
 exit 0
diff --git a/singularity/workflows_shell.sh b/singularity/workflows_shell.sh
index 267ef30..fcce92b 100755
--- a/singularity/workflows_shell.sh
+++ b/singularity/workflows_shell.sh
@@ -77,6 +77,6 @@ case ${1} in
         # -B /pasteur will mount /pasteur in the container
         # so that it finds the Genome configuration and gene lists
         # that are expected to be in a specific location there.
-        [[ $(hostname) = "pisa" ]] && SINGULARITYENV_USER=${USER} singularity shell -B /pasteur -B /run/shm:/run/shm ${container} $@ || APPTAINERENV_USER=${USER} apptainer shell -B /opt/hpc/slurm -B /var/run/munge -B /pasteur ${container} $@
+        [[ $(hostname) = "pisa" ]] && SINGULARITYENV_USER=${USER} singularity shell -B /pasteur -B /local -B /run/shm:/run/shm ${container} $@ || APPTAINERENV_USER=${USER} apptainer shell -B /opt/hpc/slurm -B /var/run/munge -B /pasteur -B /local ${container} $@
         ;;
 esac
diff --git a/singularity/wrap_in_container.sh b/singularity/wrap_in_container.sh
index a05a8ed..cdc23c9 100755
--- a/singularity/wrap_in_container.sh
+++ b/singularity/wrap_in_container.sh
@@ -71,6 +71,6 @@ fi
 
 echo "${PROGNAME} found ${container}"
 
-APPTAINERENV_USER=${USER} apptainer exec -B /pasteur ${container} $@
+APPTAINERENV_USER=${USER} apptainer exec -B /pasteur -B /local ${container} $@
 
 exit 0
-- 
GitLab