From 24f265cdb5e5571138c36a87609a67da4aacee75 Mon Sep 17 00:00:00 2001 From: rhancockn Date: Tue, 5 Dec 2017 11:07:07 -0500 Subject: [PATCH 1/7] One solution to HW4 --- example_solution/scripts/README.md | 9 +++ example_solution/scripts/inputs.txt | 2 + example_solution/scripts/run_all.sh | 14 ++++ example_solution/scripts/run_bedpost.sh | 4 + example_solution/scripts/run_bedpost_post.sh | 3 + example_solution/scripts/run_bedpost_pre.sh | 10 +++ example_solution/scripts/run_dtifit.sh | 10 +++ example_solution/scripts/run_eddy.sh | 20 +++++ example_solution/scripts/run_topup.sh | 80 +++++++++++++++++++ example_solution/scripts/sbatch_bedpost.sh | 43 ++++++++++ .../scripts/sbatch_bedpost_post.sh | 43 ++++++++++ .../scripts/sbatch_bedpost_pre.sh | 43 ++++++++++ example_solution/scripts/sbatch_dtifit.sh | 44 ++++++++++ example_solution/scripts/sbatch_eddy.sh | 44 ++++++++++ example_solution/scripts/sbatch_topup.sh | 44 ++++++++++ 15 files changed, 413 insertions(+) create mode 100644 example_solution/scripts/README.md create mode 100644 example_solution/scripts/inputs.txt create mode 100755 example_solution/scripts/run_all.sh create mode 100755 example_solution/scripts/run_bedpost.sh create mode 100755 example_solution/scripts/run_bedpost_post.sh create mode 100755 example_solution/scripts/run_bedpost_pre.sh create mode 100755 example_solution/scripts/run_dtifit.sh create mode 100755 example_solution/scripts/run_eddy.sh create mode 100755 example_solution/scripts/run_topup.sh create mode 100755 example_solution/scripts/sbatch_bedpost.sh create mode 100755 example_solution/scripts/sbatch_bedpost_post.sh create mode 100755 example_solution/scripts/sbatch_bedpost_pre.sh create mode 100755 example_solution/scripts/sbatch_dtifit.sh create mode 100755 example_solution/scripts/sbatch_eddy.sh create mode 100755 example_solution/scripts/sbatch_topup.sh diff --git a/example_solution/scripts/README.md b/example_solution/scripts/README.md new file mode 100644 index 0000000..9af98d4 --- /dev/null +++ b/example_solution/scripts/README.md @@ -0,0 +1,9 @@ +# Example HW4 solution + +On HPC: + +1. Run the `mk_skel.sh hw4` script +2. Copy the contents of the `scripts` directory here to `/scratch/$USER/hw4/scripts` +3. `cd /scratch/$USER/hw4/scripts` +4. `./run_all.sh` + diff --git a/example_solution/scripts/inputs.txt b/example_solution/scripts/inputs.txt new file mode 100644 index 0000000..9a4d210 --- /dev/null +++ b/example_solution/scripts/inputs.txt @@ -0,0 +1,2 @@ +100206_3T_DWI_dir95_LR 100206_3T_DWI_dir95_LR.bval 100206_3T_DWI_dir95_LR.bvec -1 0 0 .1115 +100206_3T_DWI_dir95_RL 100206_3T_DWI_dir95_RL.bval 100206_3T_DWI_dir95_RL.bvec 1 0 0 .1115 diff --git a/example_solution/scripts/run_all.sh b/example_solution/scripts/run_all.sh new file mode 100755 index 0000000..b884a24 --- /dev/null +++ b/example_solution/scripts/run_all.sh @@ -0,0 +1,14 @@ +#!/bin/bash +#Run everything +#This script calls the required SLURM submission scripts +#and illustrates the use of job dependencies +#there is a possibility this won't work with afterok. +#You can try afterany to ignore the job exit status + +j_topup=$( sbatch sbatch_topup.sh ) +j_eddy=$( sbatch --dependency=afterok:$j_topup sbatch_eddy.sh ) +j_dtifit=$( sbatch --dependency=afterok:$j_eddy sbatch_dtifit.sh ) +j_bedpostprep=$( sbatch --dependency=afterok:$j_eddy sbatch_bedpost_pre.sh ) +j_bedpost=$( sbatch --dependency=afterok:$j_bedpostprep sbatch_bedpost.sh ) +sbatch --dependency=afterok:$j_bedpost sbatch_bedpost_post.sh + diff --git a/example_solution/scripts/run_bedpost.sh b/example_solution/scripts/run_bedpost.sh new file mode 100755 index 0000000..292bd17 --- /dev/null +++ b/example_solution/scripts/run_bedpost.sh @@ -0,0 +1,4 @@ +#!/bin/bash +cd /bin/data_out/bedpostX +bedpostx_single_slice.sh $1 --nf=2 --fudge=1 --bi=1000 --nj=1250 --se=25 --model=2 --cnonlinear --rician + diff --git a/example_solution/scripts/run_bedpost_post.sh b/example_solution/scripts/run_bedpost_post.sh new file mode 100755 index 0000000..185ec7b --- /dev/null +++ b/example_solution/scripts/run_bedpost_post.sh @@ -0,0 +1,3 @@ +#!/bin/bash +cd /bind/data_out +bedpostx_postproc.sh bedpostX diff --git a/example_solution/scripts/run_bedpost_pre.sh b/example_solution/scripts/run_bedpost_pre.sh new file mode 100755 index 0000000..d30b7d0 --- /dev/null +++ b/example_solution/scripts/run_bedpost_pre.sh @@ -0,0 +1,10 @@ +#!/bin/bash +#prepare for bedpost +cd /bind/data_out +mkdir bedpostX +imcp corrected bedpostX/data +imcp brain_mask bedpostX/nodif_brain_mask +cp bvals bedpostX/bvals +cp corrected.eddy_rotated_bvecs bedpostX/bvecs +bedposx_preproc.sh bedpostX + diff --git a/example_solution/scripts/run_dtifit.sh b/example_solution/scripts/run_dtifit.sh new file mode 100755 index 0000000..49d79fa --- /dev/null +++ b/example_solution/scripts/run_dtifit.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +#Fit a tensor model +#Assume the preprocessed inputs are in /bind/data_out + +cd /bind/data_out +dtifit -k corrected -m brain_mask -r corrected.eddy_rotated_bvecs -b bvals -o dti + + + diff --git a/example_solution/scripts/run_eddy.sh b/example_solution/scripts/run_eddy.sh new file mode 100755 index 0000000..57bd3f2 --- /dev/null +++ b/example_solution/scripts/run_eddy.sh @@ -0,0 +1,20 @@ +#!/bin/bash +#Run eddy +#Assume the preprocessed inputs are in /bind/data_out +#and original source files are in /bind/data_in +#Multiband factor=3, top slice removed + +cd /bind/data_out +eddy_cuda --mask=brain_mask \ +--acqp=acqparams.txt \ +--index=index.txt \ +--imain=merged_dwi \ +--bvecs=bvecs \ +--bvals=bvals \ +--out=corrected \ +--mb=3 \ +--mb_offs=1 \ +--ol_type=gw \ +--cnr_maps \ +--repol \ +--topup=topup diff --git a/example_solution/scripts/run_topup.sh b/example_solution/scripts/run_topup.sh new file mode 100755 index 0000000..1d2dca0 --- /dev/null +++ b/example_solution/scripts/run_topup.sh @@ -0,0 +1,80 @@ +#!/bin/bash +#prep the data and run topup +#Usage: +#run_topup.sh inputs.txt +#Where inputs.txt contains lines of the following form, one per blip +#dwi_file bval_file bvec_file x y z t +#x y z t are lines as in the topup acquisition parameter file + +inputs=$1 + +#INDIR=/bind/data_in +#OUTDIR=/bind/data_out + +INDIR=/Users/roh17004/scratch/ibrain_dwi/100206 +OUTDIR=/Users/roh17004/Dropbox/hw4_solution/out + +extract_b0 () +{ + #extract low b0 values as separate volumes + #extract_b0 file.bvals dwi.nii.gz prefix offset + #assumes series starts with b0 + local bvals=( $( cat $1 )) + local b0in=$2 + local prefix=$3 + local rr=$$ + local i=0 + local index_i=$4 + while [ $i -lt ${#bvals[@]} ]; do + if [ ${bvals[$i]} -lt 51 ]; then + fslroi $b0in `printf "${prefix}.${rr}.%03d $i 1" $i` + let index_i=index_i+1 + fi + let i=i+1 + echo $(( index_i )) >> ${OUTDIR}/index.txt + + done + + fslmerge -t ${prefix} ${prefix}.${rr}.* + rm ${prefix}.${rr}.* +} + +#commands to merge everything +cmd_merge_dwi="fslmerge -t ${OUTDIR}/merged_dwi " +cmd_merge_bval="join " +cmd_merge_bvec="join " + + +offset=0 +while read line; do + a=( $( echo $line ) ) + echo ${INDIR}/${a[0]} + cmd_merge_dwi="$cmd_merge_dwi ${INDIR}/${a[0]}" + cmd_merge_bval="$cmd_merge_bval ${INDIR}/${a[1]}" + cmd_merge_bvec="$cmd_merge_bvec ${INDIR}/${a[2]}" + echo "${a[3]} ${a[4]} ${a[5]} ${a[6]}" >> ${OUTDIR}/acqparams.txt + prefix=`printf "${OUTDIR}/blip_%03d" $offset` + extract_b0 ${INDIR}/${a[1]} ${INDIR}/${a[0]} $prefix $offset + let offset=offset+`fslnvols $prefix` +done <<< "$(cat $inputs)" + +`$cmd_merge_dwi` +echo "$($cmd_merge_bvec)" > ${OUTDIR}/bvecs +echo "$($cmd_merge_bval)" > ${OUTDIR}/bvals + +#merge b0 +fslmerge -t ${OUTDIR}/b0_all ${OUTDIR}/blip_* + +#remove top slice from HCP +fslroi ${OUTDIR}/b0_all ${OUTDIR}/b0_all_cropped 0 -1 0 -1 0 110 0 -1 +fslroi ${OUTDIR}/merged_dwi ${OUTDIR}/merged_dwi_cropped 0 -1 0 -1 0 110 0 -1 + +#topup +cd $OUTDIR +topup --imain=b0_all_cropped --datain=acqparams.txt --config=b02b0.cnf --out=topup —iout=corrected_b0 + +#create brain mask +bet corrected_b0 brain -m + + + diff --git a/example_solution/scripts/sbatch_bedpost.sh b/example_solution/scripts/sbatch_bedpost.sh new file mode 100755 index 0000000..284d95a --- /dev/null +++ b/example_solution/scripts/sbatch_bedpost.sh @@ -0,0 +1,43 @@ +#!/bin/bash +#SBATCH --mail-type=ALL # Mail events (NONE, BEGIN, END, FAIL, ALL) +#SBATCH --mail-user=First.Last@uconn.edu # Your email address +#SBATCH --nodes=1 # OpenMP requires a single node +#SBATCH --mem=2048mb # Memory limit +#SBATCH --time=04:00:00 # Time limit hh:mm:ss +#SBATCH -e error_%A_%a.log # Standard error +#SBATCH -o output_%A_%a.log # Standard output +#SBATCH --job-name=bedpostx # Descriptive job name +#SBATCH --partition=serial # Use a serial partition 24 cores/7days +#SBATCH --array=0-109 + +export OMP_NUM_THREADS=1 #<= cpus-per-task +export ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=1 #<= cpus-per-task +##### END OF JOB DEFINITION ##### + +#Define user paths +NETID=$USER +PROJECT=hw4 + +export DIR_BASE=/scratch/${NETID}/${PROJECT} +export DIR_RESOURCES=${DIR_BASE}/resources #ro +export DIR_DATA=${DIR_BASE}/data #rw data +export DIR_DATAIN=${DIR_BASE}/data_in #ro data +export DIR_DATAOUT=${DIR_BASE}/data_out #rw data +export SUBJECTS_DIR=${DIR_BASE}/freesurfer #rw for Freesurfer +export DIR_WORK=/work #rw /work on HPC is 40Gb local storage +export DIR_SCRATCH=${DIR_BASE}/scratch #rw shared storage +export DIR_SCRIPTS=${DIR_BASE}/scripts #ro, prepended to PATH + + +# Load modules +module load matlab/2017a #matlab binaries are bound +module load singularity/2.3.1-gcc #required to run the container + +#set the matlab license path to the path inside the container +export LM_LICENSE_FILE=/bind/matlablicense/uits.lic + +#finally call the container with any arguments for the job +#wrapper will bind the appropriate paths +#environment variables are passed to the container + +./burc_wrapper.sh run_bedpost.sh $SLURM_ARRAY_TASK_ID diff --git a/example_solution/scripts/sbatch_bedpost_post.sh b/example_solution/scripts/sbatch_bedpost_post.sh new file mode 100755 index 0000000..4ae91d9 --- /dev/null +++ b/example_solution/scripts/sbatch_bedpost_post.sh @@ -0,0 +1,43 @@ +#!/bin/bash +#SBATCH --mail-type=ALL # Mail events (NONE, BEGIN, END, FAIL, ALL) +#SBATCH --mail-user=First.Last@uconn.edu # Your email address +#SBATCH --nodes=1 # OpenMP requires a single node +#SBATCH --ntasks=1 # Run a single serial task +#SBATCH --cpus-per-task=1 # Number of cores to use +#SBATCH --time=00:20:00 # Time limit hh:mm:ss +#SBATCH -e error_%A_%a.log # Standard error +#SBATCH -o output_%A_%a.log # Standard output +#SBATCH --job-name=bedpostpre # Descriptive job name +#SBATCH --partition=serial # Use a serial partition 24 cores/7days + +export OMP_NUM_THREADS=1 #<= cpus-per-task +export ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=1 #<= cpus-per-task +##### END OF JOB DEFINITION ##### + +#Define user paths +NETID=$USER +PROJECT=hw4 + +export DIR_BASE=/scratch/${NETID}/${PROJECT} +export DIR_RESOURCES=${DIR_BASE}/resources #ro +export DIR_DATA=${DIR_BASE}/data #rw data +export DIR_DATAIN=/scratch/birc_ro/ibrain_dwi/100206 #ro data +export DIR_DATAOUT=${DIR_BASE}/data_out #rw data +export SUBJECTS_DIR=${DIR_BASE}/freesurfer #rw for Freesurfer +export DIR_WORK=/work #rw /work on HPC is 40Gb local storage +export DIR_SCRATCH=${DIR_BASE}/scratch #rw shared storage +export DIR_SCRIPTS=${DIR_BASE}/scripts #ro, prepended to PATH + + +# Load modules +module load matlab/2017a #matlab binaries are bound +module load singularity/2.3.1-gcc #required to run the container + +#set the matlab license path to the path inside the container +export LM_LICENSE_FILE=/bind/matlablicense/uits.lic + +#finally call the container with any arguments for the job +#wrapper will bind the appropriate paths +#environment variables are passed to the container + +./burc_wrapper.sh run_bedpost_post.sh diff --git a/example_solution/scripts/sbatch_bedpost_pre.sh b/example_solution/scripts/sbatch_bedpost_pre.sh new file mode 100755 index 0000000..d3891f4 --- /dev/null +++ b/example_solution/scripts/sbatch_bedpost_pre.sh @@ -0,0 +1,43 @@ +#!/bin/bash +#SBATCH --mail-type=ALL # Mail events (NONE, BEGIN, END, FAIL, ALL) +#SBATCH --mail-user=First.Last@uconn.edu # Your email address +#SBATCH --nodes=1 # OpenMP requires a single node +#SBATCH --ntasks=1 # Run a single serial task +#SBATCH --cpus-per-task=1 # Number of cores to use +#SBATCH --time=00:20:00 # Time limit hh:mm:ss +#SBATCH -e error_%A_%a.log # Standard error +#SBATCH -o output_%A_%a.log # Standard output +#SBATCH --job-name=bedpostpre # Descriptive job name +#SBATCH --partition=serial # Use a serial partition 24 cores/7days + +export OMP_NUM_THREADS=1 #<= cpus-per-task +export ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=1 #<= cpus-per-task +##### END OF JOB DEFINITION ##### + +#Define user paths +NETID=$USER +PROJECT=hw4 + +export DIR_BASE=/scratch/${NETID}/${PROJECT} +export DIR_RESOURCES=${DIR_BASE}/resources #ro +export DIR_DATA=${DIR_BASE}/data #rw data +export DIR_DATAIN=/scratch/birc_ro/ibrain_dwi/100206 #ro data +export DIR_DATAOUT=${DIR_BASE}/data_out #rw data +export SUBJECTS_DIR=${DIR_BASE}/freesurfer #rw for Freesurfer +export DIR_WORK=/work #rw /work on HPC is 40Gb local storage +export DIR_SCRATCH=${DIR_BASE}/scratch #rw shared storage +export DIR_SCRIPTS=${DIR_BASE}/scripts #ro, prepended to PATH + + +# Load modules +module load matlab/2017a #matlab binaries are bound +module load singularity/2.3.1-gcc #required to run the container + +#set the matlab license path to the path inside the container +export LM_LICENSE_FILE=/bind/matlablicense/uits.lic + +#finally call the container with any arguments for the job +#wrapper will bind the appropriate paths +#environment variables are passed to the container + +./burc_wrapper.sh run_bedpost_pre.sh diff --git a/example_solution/scripts/sbatch_dtifit.sh b/example_solution/scripts/sbatch_dtifit.sh new file mode 100755 index 0000000..6cf75ce --- /dev/null +++ b/example_solution/scripts/sbatch_dtifit.sh @@ -0,0 +1,44 @@ +#!/bin/bash +#SBATCH --mail-type=ALL # Mail events (NONE, BEGIN, END, FAIL, ALL) +#SBATCH --mail-user=First.Last@uconn.edu # Your email address +#SBATCH --nodes=1 # OpenMP requires a single node +#SBATCH --ntasks=1 # Run a single serial task +#SBATCH --cpus-per-task=1 # Number of cores to use +#SBATCH --mem=2048mb # Memory limit +#SBATCH --time=00:20:00 # Time limit hh:mm:ss +#SBATCH -e error_%A_%a.log # Standard error +#SBATCH -o output_%A_%a.log # Standard output +#SBATCH --job-name=dtifit # Descriptive job name +#SBATCH --partition=serial # Use a serial partition 24 cores/7days + +export OMP_NUM_THREADS=2 #<= cpus-per-task +export ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=2 #<= cpus-per-task +##### END OF JOB DEFINITION ##### + +#Define user paths +NETID=$USER +PROJECT=hw4 + +export DIR_BASE=/scratch/${NETID}/${PROJECT} +export DIR_RESOURCES=${DIR_BASE}/resources #ro +export DIR_DATA=${DIR_BASE}/data #rw data +export DIR_DATAIN=/scratch/birc_ro/ibrain_dwi/100206 #ro data +export DIR_DATAOUT=${DIR_BASE}/data_out #rw data +export SUBJECTS_DIR=${DIR_BASE}/freesurfer #rw for Freesurfer +export DIR_WORK=/work #rw /work on HPC is 40Gb local storage +export DIR_SCRATCH=${DIR_BASE}/scratch #rw shared storage +export DIR_SCRIPTS=${DIR_BASE}/scripts #ro, prepended to PATH + + +# Load modules +module load matlab/2017a #matlab binaries are bound +module load singularity/2.3.1-gcc #required to run the container + +#set the matlab license path to the path inside the container +export LM_LICENSE_FILE=/bind/matlablicense/uits.lic + +#finally call the container with any arguments for the job +#wrapper will bind the appropriate paths +#environment variables are passed to the container + +./burc_wrapper.sh run_dtifit.sh diff --git a/example_solution/scripts/sbatch_eddy.sh b/example_solution/scripts/sbatch_eddy.sh new file mode 100755 index 0000000..f21c8e3 --- /dev/null +++ b/example_solution/scripts/sbatch_eddy.sh @@ -0,0 +1,44 @@ +#!/bin/bash +#SBATCH --mail-type=ALL # Mail events (NONE, BEGIN, END, FAIL, ALL) +#SBATCH --mail-user=First.Last@uconn.edu # Your email address +#SBATCH --nodes=1 # OpenMP requires a single node +#SBATCH --ntasks=1 # Run a single serial task +#SBATCH --time=04:00:00 # Time limit hh:mm:ss +#SBATCH -e error_%A_%a.log # Standard error +#SBATCH -o output_%A_%a.log # Standard output +#SBATCH --job-name=eddy # Descriptive job name +#SBATCH --partition=gpu +#SBATCH --gres=gpu:1 # Request a GPU + +export OMP_NUM_THREADS=1 #<= cpus-per-task +export ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=1 #<= cpus-per-task +##### END OF JOB DEFINITION ##### + +#Define user paths +NETID=$USER +PROJECT=hw4 + +export DIR_BASE=/scratch/${NETID}/${PROJECT} +export DIR_RESOURCES=${DIR_BASE}/resources #ro +export DIR_DATA=${DIR_BASE}/data #rw data +export DIR_DATAIN=/scratch/birc_ro/ibrain_dwi/100206 #ro data +export DIR_DATAOUT=${DIR_BASE}/data_out #rw data +export SUBJECTS_DIR=${DIR_BASE}/freesurfer #rw for Freesurfer +export DIR_WORK=/work #rw /work on HPC is 40Gb local storage +export DIR_SCRATCH=${DIR_BASE}/scratch #rw shared storage +export DIR_SCRIPTS=${DIR_BASE}/scripts #ro, prepended to PATH + + +# Load modules +module load cuda/8.0.61 #for GPU/CUDA +module load matlab/2017a #matlab binaries are bound +module load singularity/2.3.1-gcc #required to run the container + +#set the matlab license path to the path inside the container +export LM_LICENSE_FILE=/bind/matlablicense/uits.lic + +#finally call the container with any arguments for the job +#wrapper will bind the appropriate paths +#environment variables are passed to the container + +./burc_wrapper.sh run_eddy.sh \ No newline at end of file diff --git a/example_solution/scripts/sbatch_topup.sh b/example_solution/scripts/sbatch_topup.sh new file mode 100755 index 0000000..68d3a08 --- /dev/null +++ b/example_solution/scripts/sbatch_topup.sh @@ -0,0 +1,44 @@ +#!/bin/bash +#SBATCH --mail-type=ALL # Mail events (NONE, BEGIN, END, FAIL, ALL) +#SBATCH --mail-user=First.Last@uconn.edu # Your email address +#SBATCH --nodes=1 # OpenMP requires a single node +#SBATCH --ntasks=1 # Run a single serial task +#SBATCH --cpus-per-task=2 # Number of cores to use +#SBATCH --mem=4096mb # Memory limit +#SBATCH --time=04:00:00 # Time limit hh:mm:ss +#SBATCH -e error_%A_%a.log # Standard error +#SBATCH -o output_%A_%a.log # Standard output +#SBATCH --job-name=topup # Descriptive job name +#SBATCH --partition=serial # Use a serial partition 24 cores/7days + +export OMP_NUM_THREADS=2 #<= cpus-per-task +export ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=2 #<= cpus-per-task +##### END OF JOB DEFINITION ##### + +#Define user paths +NETID=$USER +PROJECT=hw4 + +export DIR_BASE=/scratch/${NETID}/${PROJECT} +export DIR_RESOURCES=${DIR_BASE}/resources #ro +export DIR_DATA=${DIR_BASE}/data #rw data +export DIR_DATAIN=/scratch/birc_ro/ibrain_dwi/100206 #ro data +export DIR_DATAOUT=${DIR_BASE}/data_out #rw data +export SUBJECTS_DIR=${DIR_BASE}/freesurfer #rw for Freesurfer +export DIR_WORK=/work #rw /work on HPC is 40Gb local storage +export DIR_SCRATCH=${DIR_BASE}/scratch #rw shared storage +export DIR_SCRIPTS=${DIR_BASE}/scripts #ro, prepended to PATH + + +# Load modules +module load matlab/2017a #matlab binaries are bound +module load singularity/2.3.1-gcc #required to run the container + +#set the matlab license path to the path inside the container +export LM_LICENSE_FILE=/bind/matlablicense/uits.lic + +#finally call the container with any arguments for the job +#wrapper will bind the appropriate paths +#environment variables are passed to the container + +./burc_wrapper.sh run_topup.sh From 9fb3b8f9604b46c105f4e66526af425dec01fd5f Mon Sep 17 00:00:00 2001 From: Roeland Hancock Date: Fri, 26 Jan 2018 15:13:02 -0500 Subject: [PATCH 2/7] Fixing directories in run-topup.sh --- example_solution/scripts/run_topup.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/example_solution/scripts/run_topup.sh b/example_solution/scripts/run_topup.sh index 1d2dca0..70d36f7 100755 --- a/example_solution/scripts/run_topup.sh +++ b/example_solution/scripts/run_topup.sh @@ -8,11 +8,9 @@ inputs=$1 -#INDIR=/bind/data_in -#OUTDIR=/bind/data_out +INDIR=/bind/data_in +OUTDIR=/bind/data_out -INDIR=/Users/roh17004/scratch/ibrain_dwi/100206 -OUTDIR=/Users/roh17004/Dropbox/hw4_solution/out extract_b0 () { From 3639b60cb414ef4645b707f44cba8bd344ce8779 Mon Sep 17 00:00:00 2001 From: rhancockn Date: Tue, 30 Jan 2018 17:13:07 -0500 Subject: [PATCH 3/7] Working version --- example_solution/scripts/README.md | 7 +-- example_solution/scripts/run_all.sh | 2 +- example_solution/scripts/run_bedpost.sh | 4 +- example_solution/scripts/run_bedpost_post.sh | 3 +- example_solution/scripts/run_bedpost_pre.sh | 5 ++- example_solution/scripts/run_dtifit.sh | 0 example_solution/scripts/run_eddy.sh | 2 +- example_solution/scripts/run_eddy_mp.sh | 20 +++++++++ example_solution/scripts/run_topup.sh | 18 +++++--- example_solution/scripts/sbatch_bedpost.sh | 2 +- .../scripts/sbatch_bedpost_post.sh | 4 +- .../scripts/sbatch_bedpost_pre.sh | 4 +- example_solution/scripts/sbatch_dtifit.sh | 11 +++-- example_solution/scripts/sbatch_eddy.sh | 8 ++-- example_solution/scripts/sbatch_eddy_mp.sh | 45 +++++++++++++++++++ example_solution/scripts/sbatch_topup.sh | 6 +-- 16 files changed, 109 insertions(+), 32 deletions(-) mode change 100755 => 100644 example_solution/scripts/run_all.sh mode change 100755 => 100644 example_solution/scripts/run_bedpost.sh mode change 100755 => 100644 example_solution/scripts/run_bedpost_post.sh mode change 100755 => 100644 example_solution/scripts/run_bedpost_pre.sh mode change 100755 => 100644 example_solution/scripts/run_dtifit.sh mode change 100755 => 100644 example_solution/scripts/run_eddy.sh create mode 100644 example_solution/scripts/run_eddy_mp.sh mode change 100755 => 100644 example_solution/scripts/run_topup.sh mode change 100755 => 100644 example_solution/scripts/sbatch_bedpost.sh mode change 100755 => 100644 example_solution/scripts/sbatch_bedpost_post.sh mode change 100755 => 100644 example_solution/scripts/sbatch_bedpost_pre.sh mode change 100755 => 100644 example_solution/scripts/sbatch_dtifit.sh mode change 100755 => 100644 example_solution/scripts/sbatch_eddy.sh create mode 100644 example_solution/scripts/sbatch_eddy_mp.sh mode change 100755 => 100644 example_solution/scripts/sbatch_topup.sh diff --git a/example_solution/scripts/README.md b/example_solution/scripts/README.md index 9af98d4..583bc62 100644 --- a/example_solution/scripts/README.md +++ b/example_solution/scripts/README.md @@ -2,8 +2,9 @@ On HPC: -1. Run the `mk_skel.sh hw4` script -2. Copy the contents of the `scripts` directory here to `/scratch/$USER/hw4/scripts` -3. `cd /scratch/$USER/hw4/scripts` +1. Run the `mk_skel.sh martin` script +2. Copy the input data to `/scratch/$USER/martin/data_in` +2. Copy the contents of the `scripts` directory here to `/scratch/$USER/martin/scripts` +3. `cd /scratch/$USER/martin/scripts` 4. `./run_all.sh` diff --git a/example_solution/scripts/run_all.sh b/example_solution/scripts/run_all.sh old mode 100755 new mode 100644 index b884a24..bbdee69 --- a/example_solution/scripts/run_all.sh +++ b/example_solution/scripts/run_all.sh @@ -6,7 +6,7 @@ #You can try afterany to ignore the job exit status j_topup=$( sbatch sbatch_topup.sh ) -j_eddy=$( sbatch --dependency=afterok:$j_topup sbatch_eddy.sh ) +j_eddy=$( sbatch --dependency=afterok:$j_topup sbatch_eddy_mp.sh ) j_dtifit=$( sbatch --dependency=afterok:$j_eddy sbatch_dtifit.sh ) j_bedpostprep=$( sbatch --dependency=afterok:$j_eddy sbatch_bedpost_pre.sh ) j_bedpost=$( sbatch --dependency=afterok:$j_bedpostprep sbatch_bedpost.sh ) diff --git a/example_solution/scripts/run_bedpost.sh b/example_solution/scripts/run_bedpost.sh old mode 100755 new mode 100644 index 292bd17..155270b --- a/example_solution/scripts/run_bedpost.sh +++ b/example_solution/scripts/run_bedpost.sh @@ -1,4 +1,4 @@ #!/bin/bash -cd /bin/data_out/bedpostX -bedpostx_single_slice.sh $1 --nf=2 --fudge=1 --bi=1000 --nj=1250 --se=25 --model=2 --cnonlinear --rician +cd /bind/data_out +bedpostx_single_slice.sh bedpostX $1 --nf=2 --fudge=1 --bi=1000 --nj=1250 --se=25 --model=2 --cnonlinear --rician diff --git a/example_solution/scripts/run_bedpost_post.sh b/example_solution/scripts/run_bedpost_post.sh old mode 100755 new mode 100644 index 185ec7b..4519115 --- a/example_solution/scripts/run_bedpost_post.sh +++ b/example_solution/scripts/run_bedpost_post.sh @@ -1,3 +1,4 @@ #!/bin/bash cd /bind/data_out -bedpostx_postproc.sh bedpostX +bedpostx_postproc.sh bedpostX.bedpostX + diff --git a/example_solution/scripts/run_bedpost_pre.sh b/example_solution/scripts/run_bedpost_pre.sh old mode 100755 new mode 100644 index d30b7d0..23a8808 --- a/example_solution/scripts/run_bedpost_pre.sh +++ b/example_solution/scripts/run_bedpost_pre.sh @@ -6,5 +6,6 @@ imcp corrected bedpostX/data imcp brain_mask bedpostX/nodif_brain_mask cp bvals bedpostX/bvals cp corrected.eddy_rotated_bvecs bedpostX/bvecs -bedposx_preproc.sh bedpostX - +bedpostx_preproc.sh bedpostX +#make the required directories +mkdir -p bedpostX.bedpostX/logs/monitor diff --git a/example_solution/scripts/run_dtifit.sh b/example_solution/scripts/run_dtifit.sh old mode 100755 new mode 100644 diff --git a/example_solution/scripts/run_eddy.sh b/example_solution/scripts/run_eddy.sh old mode 100755 new mode 100644 index 57bd3f2..896c9e9 --- a/example_solution/scripts/run_eddy.sh +++ b/example_solution/scripts/run_eddy.sh @@ -8,7 +8,7 @@ cd /bind/data_out eddy_cuda --mask=brain_mask \ --acqp=acqparams.txt \ --index=index.txt \ ---imain=merged_dwi \ +--imain=merged_dwi_cropped \ --bvecs=bvecs \ --bvals=bvals \ --out=corrected \ diff --git a/example_solution/scripts/run_eddy_mp.sh b/example_solution/scripts/run_eddy_mp.sh new file mode 100644 index 0000000..1c58f83 --- /dev/null +++ b/example_solution/scripts/run_eddy_mp.sh @@ -0,0 +1,20 @@ +#!/bin/bash +#Run eddy +#Assume the preprocessed inputs are in /bind/data_out +#and original source files are in /bind/data_in +#Multiband factor=3, top slice removed + +cd /bind/data_out +eddy_openmp --mask=brain_mask \ +--acqp=acqparams.txt \ +--index=index.txt \ +--imain=merged_dwi_cropped \ +--bvecs=bvecs \ +--bvals=bvals \ +--out=corrected \ +--mb=3 \ +--mb_offs=1 \ +--ol_type=gw \ +--cnr_maps \ +--repol \ +--topup=topup diff --git a/example_solution/scripts/run_topup.sh b/example_solution/scripts/run_topup.sh old mode 100755 new mode 100644 index 70d36f7..a04f6a2 --- a/example_solution/scripts/run_topup.sh +++ b/example_solution/scripts/run_topup.sh @@ -11,6 +11,9 @@ inputs=$1 INDIR=/bind/data_in OUTDIR=/bind/data_out +#clean up +rm ${OUTDIR}/index.txt +rm ${OUTDIR}/acqparams.txt extract_b0 () { @@ -23,9 +26,13 @@ extract_b0 () local rr=$$ local i=0 local index_i=$4 + eval local acq="$5" while [ $i -lt ${#bvals[@]} ]; do if [ ${bvals[$i]} -lt 51 ]; then + #extract this b0 fslroi $b0in `printf "${prefix}.${rr}.%03d $i 1" $i` + #write the corresponding acquistion parameter line + echo "$acq" >> ${OUTDIR}/acqparams.txt let index_i=index_i+1 fi let i=i+1 @@ -39,8 +46,8 @@ extract_b0 () #commands to merge everything cmd_merge_dwi="fslmerge -t ${OUTDIR}/merged_dwi " -cmd_merge_bval="join " -cmd_merge_bvec="join " +cmd_merge_bval="paste -d ' ' " +cmd_merge_bvec="paste -d ' ' " offset=0 @@ -50,9 +57,10 @@ while read line; do cmd_merge_dwi="$cmd_merge_dwi ${INDIR}/${a[0]}" cmd_merge_bval="$cmd_merge_bval ${INDIR}/${a[1]}" cmd_merge_bvec="$cmd_merge_bvec ${INDIR}/${a[2]}" - echo "${a[3]} ${a[4]} ${a[5]} ${a[6]}" >> ${OUTDIR}/acqparams.txt + acq="${a[3]} ${a[4]} ${a[5]} ${a[6]}" + #echo "$acq" >> ${OUTDIR}/acqparams.txt prefix=`printf "${OUTDIR}/blip_%03d" $offset` - extract_b0 ${INDIR}/${a[1]} ${INDIR}/${a[0]} $prefix $offset + extract_b0 ${INDIR}/${a[1]} ${INDIR}/${a[0]} $prefix $offset "\${acq}" let offset=offset+`fslnvols $prefix` done <<< "$(cat $inputs)" @@ -69,7 +77,7 @@ fslroi ${OUTDIR}/merged_dwi ${OUTDIR}/merged_dwi_cropped 0 -1 0 -1 0 110 0 -1 #topup cd $OUTDIR -topup --imain=b0_all_cropped --datain=acqparams.txt --config=b02b0.cnf --out=topup —iout=corrected_b0 +topup --imain=b0_all_cropped --datain=acqparams.txt --config=b02b0.cnf --out=topup --iout=corrected_b0 #create brain mask bet corrected_b0 brain -m diff --git a/example_solution/scripts/sbatch_bedpost.sh b/example_solution/scripts/sbatch_bedpost.sh old mode 100755 new mode 100644 index 284d95a..ea6ccee --- a/example_solution/scripts/sbatch_bedpost.sh +++ b/example_solution/scripts/sbatch_bedpost.sh @@ -16,7 +16,7 @@ export ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=1 #<= cpus-per-task #Define user paths NETID=$USER -PROJECT=hw4 +PROJECT=martin export DIR_BASE=/scratch/${NETID}/${PROJECT} export DIR_RESOURCES=${DIR_BASE}/resources #ro diff --git a/example_solution/scripts/sbatch_bedpost_post.sh b/example_solution/scripts/sbatch_bedpost_post.sh old mode 100755 new mode 100644 index 4ae91d9..e88a1da --- a/example_solution/scripts/sbatch_bedpost_post.sh +++ b/example_solution/scripts/sbatch_bedpost_post.sh @@ -16,12 +16,12 @@ export ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=1 #<= cpus-per-task #Define user paths NETID=$USER -PROJECT=hw4 +PROJECT=martin export DIR_BASE=/scratch/${NETID}/${PROJECT} export DIR_RESOURCES=${DIR_BASE}/resources #ro export DIR_DATA=${DIR_BASE}/data #rw data -export DIR_DATAIN=/scratch/birc_ro/ibrain_dwi/100206 #ro data +export DIR_DATAIN=${DIR_BASE}/data_in #ro data export DIR_DATAOUT=${DIR_BASE}/data_out #rw data export SUBJECTS_DIR=${DIR_BASE}/freesurfer #rw for Freesurfer export DIR_WORK=/work #rw /work on HPC is 40Gb local storage diff --git a/example_solution/scripts/sbatch_bedpost_pre.sh b/example_solution/scripts/sbatch_bedpost_pre.sh old mode 100755 new mode 100644 index d3891f4..c883a1c --- a/example_solution/scripts/sbatch_bedpost_pre.sh +++ b/example_solution/scripts/sbatch_bedpost_pre.sh @@ -16,12 +16,12 @@ export ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=1 #<= cpus-per-task #Define user paths NETID=$USER -PROJECT=hw4 +PROJECT=martin export DIR_BASE=/scratch/${NETID}/${PROJECT} export DIR_RESOURCES=${DIR_BASE}/resources #ro export DIR_DATA=${DIR_BASE}/data #rw data -export DIR_DATAIN=/scratch/birc_ro/ibrain_dwi/100206 #ro data +export DIR_DATAIN=${DIR_BASE}/data_in #ro data export DIR_DATAOUT=${DIR_BASE}/data_out #rw data export SUBJECTS_DIR=${DIR_BASE}/freesurfer #rw for Freesurfer export DIR_WORK=/work #rw /work on HPC is 40Gb local storage diff --git a/example_solution/scripts/sbatch_dtifit.sh b/example_solution/scripts/sbatch_dtifit.sh old mode 100755 new mode 100644 index 6cf75ce..216c0c2 --- a/example_solution/scripts/sbatch_dtifit.sh +++ b/example_solution/scripts/sbatch_dtifit.sh @@ -5,24 +5,23 @@ #SBATCH --ntasks=1 # Run a single serial task #SBATCH --cpus-per-task=1 # Number of cores to use #SBATCH --mem=2048mb # Memory limit -#SBATCH --time=00:20:00 # Time limit hh:mm:ss +#SBATCH --time=00:10:00 # Time limit hh:mm:ss #SBATCH -e error_%A_%a.log # Standard error #SBATCH -o output_%A_%a.log # Standard output #SBATCH --job-name=dtifit # Descriptive job name #SBATCH --partition=serial # Use a serial partition 24 cores/7days - -export OMP_NUM_THREADS=2 #<= cpus-per-task -export ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=2 #<= cpus-per-task +export OMP_NUM_THREADS=1 #<= cpus-per-task +export ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=1 #<= cpus-per-task ##### END OF JOB DEFINITION ##### #Define user paths NETID=$USER -PROJECT=hw4 +PROJECT=martin export DIR_BASE=/scratch/${NETID}/${PROJECT} export DIR_RESOURCES=${DIR_BASE}/resources #ro export DIR_DATA=${DIR_BASE}/data #rw data -export DIR_DATAIN=/scratch/birc_ro/ibrain_dwi/100206 #ro data +export DIR_DATAIN=${DIR_BASE}/data_in #ro data export DIR_DATAOUT=${DIR_BASE}/data_out #rw data export SUBJECTS_DIR=${DIR_BASE}/freesurfer #rw for Freesurfer export DIR_WORK=/work #rw /work on HPC is 40Gb local storage diff --git a/example_solution/scripts/sbatch_eddy.sh b/example_solution/scripts/sbatch_eddy.sh old mode 100755 new mode 100644 index f21c8e3..41f50e7 --- a/example_solution/scripts/sbatch_eddy.sh +++ b/example_solution/scripts/sbatch_eddy.sh @@ -3,6 +3,8 @@ #SBATCH --mail-user=First.Last@uconn.edu # Your email address #SBATCH --nodes=1 # OpenMP requires a single node #SBATCH --ntasks=1 # Run a single serial task +#SBATCH --cpus-per-task=1 # Number of cores to use +#SBATCH --mem=4096mb # Memory limit #SBATCH --time=04:00:00 # Time limit hh:mm:ss #SBATCH -e error_%A_%a.log # Standard error #SBATCH -o output_%A_%a.log # Standard output @@ -16,12 +18,12 @@ export ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=1 #<= cpus-per-task #Define user paths NETID=$USER -PROJECT=hw4 +PROJECT=martin export DIR_BASE=/scratch/${NETID}/${PROJECT} export DIR_RESOURCES=${DIR_BASE}/resources #ro export DIR_DATA=${DIR_BASE}/data #rw data -export DIR_DATAIN=/scratch/birc_ro/ibrain_dwi/100206 #ro data +export DIR_DATAIN=${DIR_BASE}/data_in #ro data export DIR_DATAOUT=${DIR_BASE}/data_out #rw data export SUBJECTS_DIR=${DIR_BASE}/freesurfer #rw for Freesurfer export DIR_WORK=/work #rw /work on HPC is 40Gb local storage @@ -41,4 +43,4 @@ export LM_LICENSE_FILE=/bind/matlablicense/uits.lic #wrapper will bind the appropriate paths #environment variables are passed to the container -./burc_wrapper.sh run_eddy.sh \ No newline at end of file +./burc_wrapper.sh run_eddy.sh diff --git a/example_solution/scripts/sbatch_eddy_mp.sh b/example_solution/scripts/sbatch_eddy_mp.sh new file mode 100644 index 0000000..5dfdbf8 --- /dev/null +++ b/example_solution/scripts/sbatch_eddy_mp.sh @@ -0,0 +1,45 @@ +#!/bin/bash +#SBATCH --mail-type=ALL # Mail events (NONE, BEGIN, END, FAIL, ALL) +#SBATCH --mail-user=First.Last@uconn.edu # Your email address +#SBATCH --nodes=1 # OpenMP requires a single node +#SBATCH --ntasks=1 # Run a single serial task +#SBATCH --cpus-per-task=8 # Number of cores to use +#SBATCH --mem=8192mb # Memory limit +#SBATCH --time=08:00:00 # Time limit hh:mm:ss +#SBATCH -e error_%A_%a.log # Standard error +#SBATCH -o output_%A_%a.log # Standard output +#SBATCH --job-name=eddy # Descriptive job name +#SBATCH --partition=serial + +export OMP_NUM_THREADS=8 #<= cpus-per-task +export ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=18 #<= cpus-per-task +##### END OF JOB DEFINITION ##### + +#Define user paths +NETID=$USER +PROJECT=martin + +export DIR_BASE=/scratch/${NETID}/${PROJECT} +export DIR_RESOURCES=${DIR_BASE}/resources #ro +export DIR_DATA=${DIR_BASE}/data #rw data +export DIR_DATAIN=${DIR_BASE}/data_in #ro data +export DIR_DATAOUT=${DIR_BASE}/data_out #rw data +export SUBJECTS_DIR=${DIR_BASE}/freesurfer #rw for Freesurfer +export DIR_WORK=/work #rw /work on HPC is 40Gb local storage +export DIR_SCRATCH=${DIR_BASE}/scratch #rw shared storage +export DIR_SCRIPTS=${DIR_BASE}/scripts #ro, prepended to PATH + + +# Load modules +module load cuda/8.0.61 #for GPU/CUDA +module load matlab/2017a #matlab binaries are bound +module load singularity/2.3.1-gcc #required to run the container + +#set the matlab license path to the path inside the container +export LM_LICENSE_FILE=/bind/matlablicense/uits.lic + +#finally call the container with any arguments for the job +#wrapper will bind the appropriate paths +#environment variables are passed to the container + +./burc_wrapper.sh run_eddy_mp.sh diff --git a/example_solution/scripts/sbatch_topup.sh b/example_solution/scripts/sbatch_topup.sh old mode 100755 new mode 100644 index 68d3a08..ed406c0 --- a/example_solution/scripts/sbatch_topup.sh +++ b/example_solution/scripts/sbatch_topup.sh @@ -17,12 +17,12 @@ export ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=2 #<= cpus-per-task #Define user paths NETID=$USER -PROJECT=hw4 +PROJECT=martin export DIR_BASE=/scratch/${NETID}/${PROJECT} export DIR_RESOURCES=${DIR_BASE}/resources #ro export DIR_DATA=${DIR_BASE}/data #rw data -export DIR_DATAIN=/scratch/birc_ro/ibrain_dwi/100206 #ro data +export DIR_DATAIN=${DIR_BASE}/data_in #ro data export DIR_DATAOUT=${DIR_BASE}/data_out #rw data export SUBJECTS_DIR=${DIR_BASE}/freesurfer #rw for Freesurfer export DIR_WORK=/work #rw /work on HPC is 40Gb local storage @@ -41,4 +41,4 @@ export LM_LICENSE_FILE=/bind/matlablicense/uits.lic #wrapper will bind the appropriate paths #environment variables are passed to the container -./burc_wrapper.sh run_topup.sh +./burc_wrapper.sh /bind/scripts/run_topup.sh /bind/scripts/inputs.txt From 5e0af996ec62419c259bb416ec296eea48d979fa Mon Sep 17 00:00:00 2001 From: rhancockn Date: Tue, 30 Jan 2018 17:13:28 -0500 Subject: [PATCH 4/7] Permissions --- example_solution/scripts/run_all.sh | 0 example_solution/scripts/run_bedpost.sh | 0 example_solution/scripts/run_bedpost_post.sh | 0 example_solution/scripts/run_bedpost_pre.sh | 0 example_solution/scripts/run_dtifit.sh | 0 example_solution/scripts/run_eddy.sh | 0 example_solution/scripts/run_eddy_mp.sh | 0 example_solution/scripts/run_topup.sh | 0 example_solution/scripts/sbatch_bedpost.sh | 0 example_solution/scripts/sbatch_bedpost_post.sh | 0 example_solution/scripts/sbatch_bedpost_pre.sh | 0 example_solution/scripts/sbatch_dtifit.sh | 0 example_solution/scripts/sbatch_eddy.sh | 0 example_solution/scripts/sbatch_eddy_mp.sh | 0 example_solution/scripts/sbatch_topup.sh | 0 15 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 example_solution/scripts/run_all.sh mode change 100644 => 100755 example_solution/scripts/run_bedpost.sh mode change 100644 => 100755 example_solution/scripts/run_bedpost_post.sh mode change 100644 => 100755 example_solution/scripts/run_bedpost_pre.sh mode change 100644 => 100755 example_solution/scripts/run_dtifit.sh mode change 100644 => 100755 example_solution/scripts/run_eddy.sh mode change 100644 => 100755 example_solution/scripts/run_eddy_mp.sh mode change 100644 => 100755 example_solution/scripts/run_topup.sh mode change 100644 => 100755 example_solution/scripts/sbatch_bedpost.sh mode change 100644 => 100755 example_solution/scripts/sbatch_bedpost_post.sh mode change 100644 => 100755 example_solution/scripts/sbatch_bedpost_pre.sh mode change 100644 => 100755 example_solution/scripts/sbatch_dtifit.sh mode change 100644 => 100755 example_solution/scripts/sbatch_eddy.sh mode change 100644 => 100755 example_solution/scripts/sbatch_eddy_mp.sh mode change 100644 => 100755 example_solution/scripts/sbatch_topup.sh diff --git a/example_solution/scripts/run_all.sh b/example_solution/scripts/run_all.sh old mode 100644 new mode 100755 diff --git a/example_solution/scripts/run_bedpost.sh b/example_solution/scripts/run_bedpost.sh old mode 100644 new mode 100755 diff --git a/example_solution/scripts/run_bedpost_post.sh b/example_solution/scripts/run_bedpost_post.sh old mode 100644 new mode 100755 diff --git a/example_solution/scripts/run_bedpost_pre.sh b/example_solution/scripts/run_bedpost_pre.sh old mode 100644 new mode 100755 diff --git a/example_solution/scripts/run_dtifit.sh b/example_solution/scripts/run_dtifit.sh old mode 100644 new mode 100755 diff --git a/example_solution/scripts/run_eddy.sh b/example_solution/scripts/run_eddy.sh old mode 100644 new mode 100755 diff --git a/example_solution/scripts/run_eddy_mp.sh b/example_solution/scripts/run_eddy_mp.sh old mode 100644 new mode 100755 diff --git a/example_solution/scripts/run_topup.sh b/example_solution/scripts/run_topup.sh old mode 100644 new mode 100755 diff --git a/example_solution/scripts/sbatch_bedpost.sh b/example_solution/scripts/sbatch_bedpost.sh old mode 100644 new mode 100755 diff --git a/example_solution/scripts/sbatch_bedpost_post.sh b/example_solution/scripts/sbatch_bedpost_post.sh old mode 100644 new mode 100755 diff --git a/example_solution/scripts/sbatch_bedpost_pre.sh b/example_solution/scripts/sbatch_bedpost_pre.sh old mode 100644 new mode 100755 diff --git a/example_solution/scripts/sbatch_dtifit.sh b/example_solution/scripts/sbatch_dtifit.sh old mode 100644 new mode 100755 diff --git a/example_solution/scripts/sbatch_eddy.sh b/example_solution/scripts/sbatch_eddy.sh old mode 100644 new mode 100755 diff --git a/example_solution/scripts/sbatch_eddy_mp.sh b/example_solution/scripts/sbatch_eddy_mp.sh old mode 100644 new mode 100755 diff --git a/example_solution/scripts/sbatch_topup.sh b/example_solution/scripts/sbatch_topup.sh old mode 100644 new mode 100755 From ca05e737de9abf12d168a875a9c0ab2a55cbe807 Mon Sep 17 00:00:00 2001 From: rhancockn Date: Wed, 31 Jan 2018 10:00:59 -0500 Subject: [PATCH 5/7] increasing bedpost time limit --- example_solution/scripts/sbatch_bedpost.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example_solution/scripts/sbatch_bedpost.sh b/example_solution/scripts/sbatch_bedpost.sh index ea6ccee..5db9eb3 100755 --- a/example_solution/scripts/sbatch_bedpost.sh +++ b/example_solution/scripts/sbatch_bedpost.sh @@ -3,7 +3,7 @@ #SBATCH --mail-user=First.Last@uconn.edu # Your email address #SBATCH --nodes=1 # OpenMP requires a single node #SBATCH --mem=2048mb # Memory limit -#SBATCH --time=04:00:00 # Time limit hh:mm:ss +#SBATCH --time=08:00:00 # Time limit hh:mm:ss #SBATCH -e error_%A_%a.log # Standard error #SBATCH -o output_%A_%a.log # Standard output #SBATCH --job-name=bedpostx # Descriptive job name From 19cae4a93afbf1cd444c5a7766e4fb1bb9bcb59e Mon Sep 17 00:00:00 2001 From: rhancockn Date: Thu, 1 Feb 2018 13:47:39 -0500 Subject: [PATCH 6/7] Fix eval error in run_topup.sh --- example_solution/scripts/run_topup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/example_solution/scripts/run_topup.sh b/example_solution/scripts/run_topup.sh index a04f6a2..eac3f5a 100755 --- a/example_solution/scripts/run_topup.sh +++ b/example_solution/scripts/run_topup.sh @@ -65,8 +65,8 @@ while read line; do done <<< "$(cat $inputs)" `$cmd_merge_dwi` -echo "$($cmd_merge_bvec)" > ${OUTDIR}/bvecs -echo "$($cmd_merge_bval)" > ${OUTDIR}/bvals +eval "$cmd_merge_bvec" > ${OUTDIR}/bvecs +eval "$cmd_merge_bval" > ${OUTDIR}/bvals #merge b0 fslmerge -t ${OUTDIR}/b0_all ${OUTDIR}/blip_* From fc62e76aa005dabb26d7448b8dc29872d35d64e7 Mon Sep 17 00:00:00 2001 From: Roeland Hancock Date: Fri, 2 Feb 2018 13:42:42 -0500 Subject: [PATCH 7/7] Update sbatch_eddy_mp.sh --- example_solution/scripts/sbatch_eddy_mp.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/example_solution/scripts/sbatch_eddy_mp.sh b/example_solution/scripts/sbatch_eddy_mp.sh index 5dfdbf8..53e708d 100755 --- a/example_solution/scripts/sbatch_eddy_mp.sh +++ b/example_solution/scripts/sbatch_eddy_mp.sh @@ -12,7 +12,7 @@ #SBATCH --partition=serial export OMP_NUM_THREADS=8 #<= cpus-per-task -export ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=18 #<= cpus-per-task +export ITK_GLOBAL_DEFAULT_NUMBER_OF_THREADS=8 #<= cpus-per-task ##### END OF JOB DEFINITION ##### #Define user paths