From 8e6122c8f4f2afb5330947b5638aa2b2060a5e6b Mon Sep 17 00:00:00 2001 From: marcobarilari Date: Thu, 28 May 2026 11:07:40 +0200 Subject: [PATCH] update slurm files for fmriprep and mriqc --- doc/cpp_fmriprep.slurm | 11 +++++------ doc/cpp_mriqc.slurm | 12 ++++++------ doc/cpp_mriqc_group.slurm | 17 +++++++++-------- doc/run_fmriprep.md | 6 +++--- doc/run_mriqc.md | 16 +++++++++++++--- 5 files changed, 36 insertions(+), 26 deletions(-) diff --git a/doc/cpp_fmriprep.slurm b/doc/cpp_fmriprep.slurm index c8135e8..ef88294 100644 --- a/doc/cpp_fmriprep.slurm +++ b/doc/cpp_fmriprep.slurm @@ -1,4 +1,4 @@ -#!/bin/bash +!/bin/bash #SBATCH --job-name=fMRIprep #SBATCH --time=9:00:00 # hh:mm:ss @@ -6,7 +6,7 @@ #SBATCH --ntasks=1 #SBATCH --cpus-per-task=4 #SBATCH --mem-per-cpu=20000 # megabytes -#SBATCH --partition=batch,debug +#SBATCH --partition=batch #SBATCH --mail-user=marco.barilari@uclouvain.be #SBATCH --mail-type=ALL @@ -59,10 +59,9 @@ set -e -x -u -o pipefail module --force purge subjID=$1 -TaskName=$2 # "latest" or procide specific version number -FMRIPREP_VERSION="24.0.0" +FMRIPREP_VERSION="25.2.5" # set username to locate scratch folder ceci_username="marcobar" @@ -71,7 +70,7 @@ ceci_username="marcobar" nb_dummy_scans=0 # cluster paths -path_to_singularity_image="$HOME/tools/containers/images/bids/bids-fmriprep--${FMRIPREP_VERSION}.sing" +path_to_singularity_image="$HOME/tools/containers/images/bids/bids-fmriprep--${FMRIPREP_VERSION}.sif" scratch_dir=$GLOBALSCRATCH freesurfer_license_folder="$HOME/tools" @@ -80,7 +79,7 @@ root_dir="$HOME/path-to-project-yoda-fodler" bids_dir="$root_dir/inputs/raw" output_dir="$root_dir/outputs/derivatives/fmriprep" -# make the scratch folder, here there is no limit space and fmriprep can store stuff in case of crash and do not start from zero again +# make the scratch folder, here there is no limit space and fmriprep can store temp files in case of crash and it does not start from zero again mkdir -p "${scratch_dir}"/work-fmriprep # create output folder in case it does not exists diff --git a/doc/cpp_mriqc.slurm b/doc/cpp_mriqc.slurm index 268bb78..a35316c 100644 --- a/doc/cpp_mriqc.slurm +++ b/doc/cpp_mriqc.slurm @@ -1,11 +1,11 @@ #!/bin/bash #SBATCH --job-name=MRIqc -#SBATCH --time=4:00:00 # hh:mm:ss +#SBATCH --time=0:30:00 # hh:mm:ss #SBATCH --ntasks=1 #SBATCH --cpus-per-task=4 -#SBATCH --mem-per-cpu=10000 # megabytes +#SBATCH --mem-per-cpu=3000 # megabytes #SBATCH --partition=batch #SBATCH --mail-user=marco.barilari@uclouvain.be @@ -17,7 +17,7 @@ #export OMP_NUM_THREADS=4 #export MKL_NUM_THREADS=4 -## CPP MRIqc script for CECI cluster v0.3.0 +## CPP MRIqc script for CECI cluster v0.4.0 # # writtent by CPP people # @@ -50,10 +50,10 @@ module --force purge subjID=$1 # "latest" or procide specific version number -MRIQC_VERSION="24.0.0" +MRIQC_VERSION="24.0.2" # cluster paths -path_to_singularity_image="$HOME/tools/containers/images/bids/bids-mriqc--${MRIQC_VERSION}.sing" +path_to_singularity_image="$HOME/tools/containers/images/bids/bids-mriqc--${MRIQC_VERSION}.sif" scratch_dir=$GLOBALSCRATCH # data paths @@ -61,7 +61,7 @@ root_dir="$HOME/path-to-project-yoda-fodler" bids_dir="$root_dir/inputs/raw" output_dir="$root_dir/outputs/derivatives/mriqc" -# make the scratch folder, here there is no limit space and fmriprep can store stuff in case of crash and do not start from zero again +# make the scratch folder, here there is no space limit and mriqc can store temp files in case of crash and it does not start from zero again mkdir -p "${scratch_dir}"/work-mriqc # create output folder in case it does not exists diff --git a/doc/cpp_mriqc_group.slurm b/doc/cpp_mriqc_group.slurm index e21db8d..2191ec2 100644 --- a/doc/cpp_mriqc_group.slurm +++ b/doc/cpp_mriqc_group.slurm @@ -1,11 +1,11 @@ #!/bin/bash #SBATCH --job-name=MRIqc -#SBATCH --time=4:00:00 # hh:mm:ss +#SBATCH --time=0:30:00 # hh:mm:ss #SBATCH --ntasks=1 #SBATCH --cpus-per-task=4 -#SBATCH --mem-per-cpu=10000 # megabytes +#SBATCH --mem-per-cpu=3000 # megabytes #SBATCH --partition=batch #SBATCH --mail-user=marco.barilari@uclouvain.be @@ -17,11 +17,12 @@ #export OMP_NUM_THREADS=4 #export MKL_NUM_THREADS=4 -## CPP MRIqc script for CECI cluster v0.3.0 +## CPP MRIqc script for CECI cluster v0.4.0 # # writtent by CPP people # # Submission command for Lemaitre4 after running mriqc for each participant +# !!! to run from within `raw` folder # # sbatch cpp_mriqc_group.slurm @@ -37,11 +38,11 @@ set -e -x -u -o pipefail module --force purge -# "latest" or procide specific version number -MRIQC_VERSION="24.0.0" +# "latest" or provide specific version number +MRIQC_VERSION="24.0.2" # cluster paths -path_to_singularity_image="$HOME/tools/containers/images/bids/bids-mriqc--${MRIQC_VERSION}.sing" +path_to_singularity_image="$HOME/tools/containers/images/bids/bids-mriqc--${MRIQC_VERSION}.sif" scratch_dir=$GLOBALSCRATCH # data paths @@ -49,7 +50,7 @@ root_dir="$HOME/path-to-project-yoda-fodler" bids_dir="$root_dir/inputs/raw" output_dir="$root_dir/outputs/derivatives/mriqc" -# make the scratch folder, here there is no limit space and fmriprep can store stuff in case of crash and do not start from zero again +# make the scratch folder, here there is no space limit and mriqc can store temp files in case of crash and it does not start from zero again mkdir -p "${scratch_dir}"/work-mriqc # create mriqc output folder in case they don't exist @@ -62,6 +63,6 @@ singularity run --cleanenv \ "${path_to_singularity_image}" \ /bids_dir \ /output \ - --work-dir /scratch_dir/work-mriqc/"${subjID}" \ + --work-dir /scratch_dir/work-mriqc/group \ --verbose-reports \ group diff --git a/doc/run_fmriprep.md b/doc/run_fmriprep.md index 30ca7b5..63cdc35 100644 --- a/doc/run_fmriprep.md +++ b/doc/run_fmriprep.md @@ -20,14 +20,14 @@ To contribute see [here](https://cpp-lln-lab.github.io/CPP_HPC/contributing/) - install datalad on your user (see [here](https://github.com/cpp-lln-lab/CPP_HPC/install_datalad)) - get the fmriprep singularity image as follow: -here the example is with `fmriprp version 24.0.0` but check for newer version, list of fmriprep version available [here](https://hub.docker.com/r/nipreps/fmriprep/tags/) +here the example is with `fmriprp version 25.2.5` but check for newer version, list of fmriprep version available [here](https://hub.docker.com/r/nipreps/fmriprep/tags/) ```bash datalad install -s https://github.com/ReproNim/containers.git ~/tools/containers cd tools/containers -datalad get images/bids/bids-fmriprep--24.0.0.sing +datalad get images/bids/bids-fmriprep--25.2.5.sif ``` In case you have installed the repo a while a ago and you want to use a new version of fmriprep., update the `containers` repo via: @@ -42,7 +42,7 @@ datald update --merge Depending on the cluster “unlock” is needed or not. No need for `lemaitre4`. ```bash -datalad unlock containers/images/bids/bids-fmriprep--24.0.0.sing +datalad unlock containers/images/bids/bids-fmriprep--25.2.5.sif ``` ## Submit a fmriprep job via a `slurm` script diff --git a/doc/run_mriqc.md b/doc/run_mriqc.md index d4f4471..fa6d896 100644 --- a/doc/run_mriqc.md +++ b/doc/run_mriqc.md @@ -16,18 +16,18 @@ To contribute see [here](https://cpp-lln-lab.github.io/CPP_HPC/contributing/) ## Prepare to run MRIqc on the cluster -- have your data on the cluster and unlock them if they are managed by datalad +- have your data on the cluster and unlock them if they are managed by datalad (for MRIqc v24.0.2 data should not need to be unlocked) - install datalad on your user (see [here](https://github.com/cpp-lln-lab/CPP_HPC/install_datalad)) - get the fmriprep singularity image as follow: -here the example is with `MRIqc version 24.0.0` but check for newer version, list of fmriprep version available [here](https://hub.docker.com/r/nipreps/fmriprep/tags/) +here the example is with `MRIqc version 24.0.2` but check for newer version, list of fmriprep version available [here](https://hub.docker.com/r/nipreps/fmriprep/tags/) ```bash datalad install https://github.com/ReproNim/containers.git cd containers -datalad get images/bids/bids-mriqc--24.0.0.sing +datalad get images/bids/bids-mriqc--24.0.2.sif ``` In case you have installe the repo a while a ago and you want to use a new version of fmriprep., update the `containers` repo via: @@ -116,6 +116,16 @@ sbatch cpp_mriqc_group.slurm ## TIPS +### Troubleshooting + +- ERROR: `OSError: [Errno 30] Read-only file system: '/home/mriqc/.cache'` + +add this flag to the singulairy inputs + +```bash + -B "$HOME/tools/containers/images/bids":/home/mriqc \ +``` + ### check your job see [here](https://github.com/cpp-lln-lab.github.io/CPP_HPC/cluster_code_snippets/#check-your-running-jobs)