Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
chunk_stitching
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 87 lines (81 sloc) 2.05 KB
#!/bin/bash -l
set -e
code_dir=$(dirname "$0")
# Parse command line args
rerun=false
for i in "$@"
do
case $i in
--mpicmd=*)
mpicmd="${i#*=}"
shift
;;
--partition=*)
partition="${i#*=}"
shift
;;
--stitching-slurm=*)
stitching_slurm="${i#*=}"
shift
;;
--stitching-args=*)
stitching_args="${i#*=}"
shift
;;
--rerun)
rerun=true
shift
;;
*)
sepia="$i"
shift
;;
esac
done
if [[ $debug = true ]]; then
set -x
fi
sepia_dirs=($(ls -d "$sepia"*"/"))
queenframes=()
for sepia_dir in "${sepia_dirs[@]}"; do
basename=$(basename "$sepia_dir")
queenframe="$sepia_dir/${basename#*-}".queenframe
queenframes+=("$queenframe")
done
stitching="$sepia.stitching"
stitching_log="$sepia.stitching.log"
dirname=$(dirname "$sepia")
check_stitching_jobid=$(sbatch \
$(if [[ ! -z ${partition+x} ]]; then
echo --partition="$partition"
fi) \
--kill-on-invalid-dep=yes \
--job-name=check-stitching \
-o"$dirname/%j.out" \
$code_dir/check_filedeps.sh \
--optional \
"${queenframes[@]}" \
--output="$stitching" \
$(if [[ $rerun_stitching = true ]]; then
echo "--skip-mtime"
fi) \
| awk '{print $4}';
if [[ "${PIPESTATUS[0]}" -eq "0" ]]; then true; else false; fi)
stitching_jobid=$(sbatch \
$(if [[ ! -z ${partition+x} ]]; then
echo --partition="$partition"
fi) \
$stitching_slurm \
--dependency=afterok:$check_stitching_jobid \
--kill-on-invalid-dep=yes \
--job-name=stitching \
-o"$stitching_log" \
$code_dir/run_stitching.sh \
--mpicmd="$mpicmd" \
--code-dir="$code_dir" \
--chunks="${queenframes[*]}" \
--stitching="$stitching" \
--stitching-args="$stitching_args" \
| awk '{print $4}';
if [[ "${PIPESTATUS[0]}" -eq "0" ]]; then true; else false; fi)
echo "STITCHING_JOBID=$stitching_jobid"