Skip to content
Snippets Groups Projects

RF: Allow eddy tests to run if eddy_openmp(/eddy_cpu) is not installed.

Merged Paul McCarthy requested to merge rf/eddy into master
5 files
+ 197
140
Compare changes
  • Side-by-side
  • Inline
Files
5
@@ -30,7 +30,7 @@ fi
@@ -30,7 +30,7 @@ fi
# Find all eddy_cuda* executables
# Find all eddy_cuda* executables
cuda_exes=""
cuda_exes=""
openmp_exe=""
cpu_exe=""
for cuda_exe in ${exedir}/eddy_cuda*;
for cuda_exe in ${exedir}/eddy_cuda*;
do
do
if [ -x "${cuda_exe}" ]; then
if [ -x "${cuda_exe}" ]; then
@@ -38,12 +38,12 @@ do
@@ -38,12 +38,12 @@ do
fi
fi
done
done
# Find the eddy_openmp executable
# Find the eddy_cpu executable
if [ -x "${exedir}/eddy_openmp" ]; then
if [ -x "${exedir}/eddy_openmp" ]; then
openmp_exe="${exedir}/eddy_openmp"
cpu_exe="${exedir}/eddy_openmp"
fi
fi
if [ "${cuda_exes}" == "" ] && [ "${openmp_exe}" == "" ]; then
if [ "${cuda_exes}" == "" ] && [ "${cpu_exe}" == "" ]; then
echo "Cannot find any eddy executables in ${exedir}!"
echo "Cannot find any eddy executables in ${exedir}!"
exit 1
exit 1
fi
fi
@@ -67,31 +67,37 @@ do
@@ -67,31 +67,37 @@ do
cuda_jid="$cuda_jid `fsl_sub -l ${odir} -q cuda.q ${cuda_exe} --imain=${indir}/EddyHigh_b_TestData/eddyData/testData --mask=${indir}/EddyHigh_b_TestData/eddyData/testMask --bvals=${indir}/EddyHigh_b_TestData/eddyData/testBvals --bvecs=${indir}/EddyHigh_b_TestData/eddyData/testBvecs --index=${indir}/EddyHigh_b_TestData/eddyData/testIndex --acqp=${indir}/EddyHigh_b_TestData/eddyData/testAcqparams --topup=${indir}/EddyHigh_b_TestData/eddyData/testTopup --nvoxhp=5000 --repol --fwhm=10,0,0,0,0 --dont_peas --out=${odir}/eddyCudaOutput${version} --very_verbose`"
cuda_jid="$cuda_jid `fsl_sub -l ${odir} -q cuda.q ${cuda_exe} --imain=${indir}/EddyHigh_b_TestData/eddyData/testData --mask=${indir}/EddyHigh_b_TestData/eddyData/testMask --bvals=${indir}/EddyHigh_b_TestData/eddyData/testBvals --bvecs=${indir}/EddyHigh_b_TestData/eddyData/testBvecs --index=${indir}/EddyHigh_b_TestData/eddyData/testIndex --acqp=${indir}/EddyHigh_b_TestData/eddyData/testAcqparams --topup=${indir}/EddyHigh_b_TestData/eddyData/testTopup --nvoxhp=5000 --repol --fwhm=10,0,0,0,0 --dont_peas --out=${odir}/eddyCudaOutput${version} --very_verbose`"
done
done
omp_jid=`fsl_sub -l ${odir} -q long.q -s openmp,6 ${exedir}/eddy_openmp --imain=${indir}/EddyHigh_b_TestData/eddyData/testData --mask=${indir}/EddyHigh_b_TestData/eddyData/testMask --bvals=${indir}/EddyHigh_b_TestData/eddyData/testBvals --bvecs=${indir}/EddyHigh_b_TestData/eddyData/testBvecs --index=${indir}/EddyHigh_b_TestData/eddyData/testIndex --acqp=${indir}/EddyHigh_b_TestData/eddyData/testAcqparams --topup=${indir}/EddyHigh_b_TestData/eddyData/testTopup --nvoxhp=5000 --repol --fwhm=10,0,0,0,0 --dont_peas --out=${odir}/eddyOmpOutput --very_verbose`
if [ "${cpu_exe}" != "" ]; then
 
cpu_jid=`fsl_sub -l ${odir} -q long.q -s openmp,6 ${cpu_exe} --imain=${indir}/EddyHigh_b_TestData/eddyData/testData --mask=${indir}/EddyHigh_b_TestData/eddyData/testMask --bvals=${indir}/EddyHigh_b_TestData/eddyData/testBvals --bvecs=${indir}/EddyHigh_b_TestData/eddyData/testBvecs --index=${indir}/EddyHigh_b_TestData/eddyData/testIndex --acqp=${indir}/EddyHigh_b_TestData/eddyData/testAcqparams --topup=${indir}/EddyHigh_b_TestData/eddyData/testTopup --nvoxhp=5000 --repol --fwhm=10,0,0,0,0 --dont_peas --out=${odir}/eddyCpuOutput --very_verbose`
 
fi
# If running on a cluster, ensure that
# If running on a cluster, ensure that
# slots are being reserved on the queue,
# slots are being reserved on the queue,
# and wait until all jobs have finished
# and wait until all jobs have finished
if [ ! -z "${SGE_ROOT}" ]; then
if [ ! -z "${SGE_ROOT}" ]; then
qalter ${omp_jid} -R y
if [ "${cpu_exe}" != "" ]; then
while [ : ]; do
qalter ${cpu_jid} -R y
for jid in ${cuda_jid};
fi
do
while [ : ]; do
tmp=`qstat -j ${jid} | wc`
for jid in ${cuda_jid};
tmp=`echo $tmp | awk '{print $1}'`
do
if [ $tmp -ne 0 ]; then
tmp=`qstat -j ${jid} | wc`
break
tmp=`echo $tmp | awk '{print $1}'`
fi
if [ $tmp -ne 0 ]; then
done
break
 
fi
 
done
 
if [ "${cpu_exe}" != "" ]; then
 
if [ $tmp -eq 0 ]; then
 
tmp=`qstat -j ${cpu_jid} | wc`
 
tmp=`echo $tmp | awk '{print $1}'`
if [ $tmp -eq 0 ]; then
if [ $tmp -eq 0 ]; then
tmp=`qstat -j ${omp_jid} | wc`
break
tmp=`echo $tmp | awk '{print $1}'`
if [ $tmp -eq 0 ]; then
break
fi
fi
fi
sleep 5m
fi
done
fi
 
sleep 5m
 
done
fi
fi
# Check that eddy output exists
# Check that eddy output exists
@@ -104,8 +110,11 @@ do
@@ -104,8 +110,11 @@ do
exit 1
exit 1
fi
fi
done
done
if [ ! -f ${odir}/eddyOmpOutput.nii* ]; then
if [ "${cpu_exe}" != "" ]; then
 
if [ ! -f ${odir}/eddyCpuOutput.nii* ]; then
 
echo "eddyCpuOutput missing"
exit 1
exit 1
 
fi
fi
fi
# Define some constants
# Define some constants
@@ -124,11 +133,13 @@ do
@@ -124,11 +133,13 @@ do
cuda_exit_status=$(($cuda_exit_status + $?))
cuda_exit_status=$(($cuda_exit_status + $?))
done
done
./EddyHigh_b_Feeds.py ${odir} Omp `imglob -extension ${indir}/EddyHigh_b_TestData/eddyData/testMask` `imglob -extension ${odir}/eddyOmpOutput` `imglob -extension ${indir}/EddyHigh_b_TestData/eddyData/Precomputed/eddy_openmp_output` $max_mean_ima_diff $max_max_ima_diff
cpu_exit_status=0
if [ "${cpu_exe}" != "" ]; then
omp_exit_status=$?
./EddyHigh_b_Feeds.py ${odir} Cpu `imglob -extension ${indir}/EddyHigh_b_TestData/eddyData/testMask` `imglob -extension ${odir}/eddyCpuOutput` `imglob -extension ${indir}/EddyHigh_b_TestData/eddyData/Precomputed/eddy_openmp_output` $max_mean_ima_diff $max_max_ima_diff
 
cpu_exit_status=$?
 
fi
if [ $cuda_exit_status -gt 0 ] || [ $omp_exit_status -gt 0 ]; then
if [ $cuda_exit_status -gt 0 ] || [ $cpu_exit_status -gt 0 ]; then
echo "Test failed"
echo "Test failed"
exit 1
exit 1
else
else
Loading