Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix memory limitation and subject/case globbing on slurm script #407

Merged
merged 2 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ Tutorial
Docker/Dockerfile*
*.txt
venv
/srun_fastsurfer.sh
28 changes: 23 additions & 5 deletions srun_fastsurfer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,9 @@ 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
num_cpus_surf=2 # base number of cpus to use for surfaces (doubled if --parallel)
mem_surf_parallel=20 # in GB, hemi in parallel
mem_surf_noparallel=18 # in GB, hemi in series
num_cpus_surf=1 # 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