Biowulf High Performance Computing at the NIH
Aslprep on Biowulf

Aslprep is an application for preprocessing of ASL (arterial spin labeling) data and computation of CBF (cerebral blood flow). Aslprep is a pipeline that uses AFNI, FSL, ANTs, and freesurfer.

References:

Web site


Documentation
Important Notes

Interactive job
Interactive jobs should be used for debugging, graphics, or applications that cannot be run as batch jobs.

Allocate an interactive session and run the program.
Sample session (user input in bold):

[user@biowulf]$ sinteractive
salloc.exe: Pending job allocation 46116226
salloc.exe: job 46116226 queued and waiting for resources
salloc.exe: job 46116226 has been allocated resources
salloc.exe: Granted job allocation 46116226
salloc.exe: Waiting for resource configuration
salloc.exe: Nodes cn3144 are ready for job

[user@cn3144 ~]$ module load aslprep

[user@cn3144 ~]$ aslprep --help
usage: aslprep [-h] [--version] [--skip_bids_validation]
               [--participant-label PARTICIPANT_LABEL [PARTICIPANT_LABEL ...]]
               [--echo-idx ECHO_IDX] [--bids-filter-file FILE]
               [--anat-derivatives PATH] [--nprocs NPROCS]
               [--omp-nthreads OMP_NTHREADS] [--mem MEMORY_GB] [--low-mem]
               [--use-plugin FILE] [--anat-only] [--boilerplate_only]
               [--md-only-boilerplate] [-v]
               [--ignore {fieldmaps,slicetiming,sbref} [{fieldmaps,slicetiming,sbref} ...]]
               [--longitudinal]
               [--output-spaces [OUTPUT_SPACES [OUTPUT_SPACES ...]]]
               [--asl2t1w-init {register,header}] [--asl2t1w-dof {6,9,12}]
               [--force-bbr] [--force-no-bbr] [--m0_scale M0_SCALE]
               [--random-seed RANDOM_SEED] [--dummy-vols DUMMY_VOLS]
               [--smooth_kernel SMOOTH_KERNEL] [--scorescrub] [--basil]
               [--skull-strip-template SKULL_STRIP_TEMPLATE]
               [--skull-strip-fixed-seed]
               [--skull-strip-t1w {auto,skip,force}] [--fmap-bspline]
               [--fmap-no-demean] [--use-syn-sdc] [--force-syn]
               [--fs-license-file FILE] [-w WORK_DIR] [--clean-workdir]
               [--resource-monitor] [--reports-only] [--run-uuid RUN_UUID]
               [--write-graph] [--stop-on-first-crash] [--notrack] [--sloppy]
               bids_dir output_dir {participant}

ASLPrep: ASL PREProcessing workflows v0.2.7

[user@cn3144 ~]$ exit
salloc.exe: Relinquishing job allocation 46116226
[user@biowulf ~]$

Batch job
Most jobs should be run as batch jobs.

Create a batch input file (e.g. aslprep.sh). For example:

#!/bin/bash
# sbatch --gres=lscratch:100 --mem=32g --cpus-per-task=48 --time=72:00:00 aslprep.sh

set -o pipefail
set -e

function fail {
    echo "FAIL: $@" >&2
    exit 1  # signal failure
}

module load aslprep
aslprep /data/${USER}/BIDS-dataset/asl001 /data/${USER}/BIDS-dataset/aslprep.out.ds001 \
participant --participant_label sub-01 -w /lscratch/$SLURM_JOB_ID \
--notrack --nthreads $SLURM_CPUS_PER_TASK --mem_mb $SLURM_MEM_PER_NODE \
--stop-on-first-crash

Submit this job using the Slurm sbatch command.

sbatch [--gres=lscratch:#] [--cpus-per-task=#] [--mem=#] aslprep.sh
Swarm of Jobs
A swarm of jobs is an easy way to submit a set of independent commands requiring identical resources.

Create a swarmfile (e.g. aslprep.swarm). For example:

export TMPDIR=/lscratch/$SLURM_JOB_ID; \
mkdir -p $TMPDIR/out; \
mkdir -p $TMPDIR/wrk; \
aslprep /data/${USER}/BIDS-dataset/asl001/ $TMPDIR/out \
participant --participant_label sub-01 -w $TMPDIR/wrk \
--notrack --nthreads $SLURM_CPUS_PER_TASK \
--mem_mb $SLURM_MEM_PER_NODE \
--stop-on-first-crash; \
mv $TMPDIR/out /data/${USER}/BIDS-dataset/aslprep.out.s001
export TMPDIR=/lscratch/$SLURM_JOB_ID; \
mkdir -p $TMPDIR/out; \
mkdir -p $TMPDIR/wrk; \
aslprep /data/${USER}/BIDS-dataset/asl001/ $TMPDIR/out \
participant --participant_label sub-02 -w $TMPDIR/wrk \
--notrack --nthreads $SLURM_CPUS_PER_TASK \
--mem_mb $SLURM_MEM_PER_NODE \
--stop-on-first-crash; \
mv $TMPDIR/out /data/${USER}/BIDS-dataset/aslprep.out.s002 

Submit this job using the swarm command.

swarm -f aslprep.swarm [--gres=lscratch:#] [-g #] [-t #] --module aslprep
where
-gres=lscratch:# Number of Gigabytes of local disk space allocated per process (1 line in the swarm command file)
-g # Number of Gigabytes of memory required for each process (1 line in the swarm command file)
-t # Number of threads/CPUs required for each process (1 line in the swarm command file).
--module aslprep Loads the aslprep module for each subjob in the swarm