Skip to content

Commit

Permalink
Adjust memory limits to fail less often
Browse files Browse the repository at this point in the history
fix globbing, so globbing does happen if subjects/cases are read
  • Loading branch information
dkuegler committed Dec 1, 2023
1 parent 57f8f16 commit f45bfea
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
26 changes: 22 additions & 4 deletions srun_fastsurfer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ EOF
# voxel size of the image, here we use values proven to work for 0.7mm (and also 0.8 and 1m)
mem_seg_cpu=10 # in GB, seg on cpu, actually required: 9G
mem_seg_gpu=7 # in GB, seg on gpu, actually required: 6G
mem_surf_parallel=16 # in GB, hemi in parallel
mem_surf_noparallel=14 # in GB, hemi in series
mem_surf_parallel=20 # in GB, hemi in parallel
mem_surf_noparallel=18 # in GB, hemi in series
num_cpus_surf=2 # base number of cpus to use for surfaces (doubled if --parallel)

do_parallel="false"
Expand Down Expand Up @@ -376,8 +376,8 @@ then
if [[ "$do_parallel" == "true" ]]; then echo "--parallel"; fi
for p in "${POSITIONAL_FASTSURFER[@]}"
do
if [[ "$p" = --* ]]; then printf "\n%s" "$p";
else printf " %s" '$p';
if [[ "$p" == --* ]]; then printf "\n%s" "$p";
else printf " %s" "$p";
fi
done
echo ""
Expand Down Expand Up @@ -450,6 +450,24 @@ else
fi
num_cases=$(echo "$cases" | wc -l)

if [[ "$num_cases" -lt 1 ]] || [[ -z "$cases" ]]
then
wait
echo "WARNING: No cases found using the parameters provided. Aborting job submission!"
if [[ "$submit_jobs" == "true" ]] && [[ "$do_cleanup" == "true" ]]
then
echo "Cleaning temporary work directory!"
rm -R "$hpc_work/images"
rm -R "$hpc_work/scripts"
if [[ "$delete_hpc_work" == "false" ]]
then
rm -R "$hpc_work"
fi
fi
exit 0
fi


if [[ "$submit_jobs" != "true" ]]
then
echo "Copying singularity image and scripts..."
Expand Down
2 changes: 1 addition & 1 deletion stools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function read_cases ()
{ pushd "$1" > /dev/null || (echo "Could not go to $1" && exit 1)} >&2
# pattern without fixed postfixes, e.g. */mri/orig.mgz -> *
no_fixed_postfix="${2/%\/[^*{[]*}"
for file_match in ./$2; do
for file_match in $(eval echo "./$2"); do
if [[ -e "$file_match" ]]
then
file_match="${file_match/#.\/}"
Expand Down

0 comments on commit f45bfea

Please sign in to comment.