Skip to content
Snippets Groups Projects
Commit 9fcc45cb authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist: Committed by Paul McCarthy
Browse files

RF: Use an array instead of separate vars for extra arguments

parent 20ff9ee8
No related branches found
No related tags found
1 merge request!42Update runEddy script to work with new multi-threaded version.
......@@ -30,7 +30,7 @@ set -e
# added by this script.
exedir="$1"; shift;
outdir="$1"; shift;
eddy_args="$@"
eddy_args=("$@")
# Find all eddy_cuda* executables
cuda_exes=""
......@@ -71,15 +71,13 @@ do
if [[ "${exe_name}" == *"cuda"* ]]; then
fsl_sub="fsl_sub -l ${outdir} --coprocessor=cuda"
exe="${exe_name}"
extra_args=""
else
# unpack eddy_cpu_nthr_N
# into eddy_cpu --nthr=N
fsl_sub="fsl_sub -l ${outdir} -q long.q"
exe="${exe_name%_nthr*}"
nthr="${exe_name#eddy_cpu_nthr_}"
extra_args="--nthr=${nthr}"
eddy_args+=("--nthr=${nthr}")
if [ "${nthr}" != "1" ]; then
fsl_sub="${fsl_sub} -s openmp,${nthr}"
fi
......@@ -89,7 +87,7 @@ do
# output a job id) if we try to run a
# cuda exe on a non-cuda-capable machine
# or queue. So we allow it to fail.
jid=$(${fsl_sub} ${exe} --out=${outdir}/eddyOutput_${variant} ${extra_args} ${eddy_args} || true)
jid=$(${fsl_sub} ${exe} --out=${outdir}/eddyOutput_${variant} ${eddy_args} || true)
if [ "${jid}" == "" ]; then
echo "Error submitting ${exe_name} - skipping"
continue
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment