slurm-cake to verify job file exists
This commit is contained in:
27
anduril/slurm-cake
Executable file
27
anduril/slurm-cake
Executable file
@@ -0,0 +1,27 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
[ -z "$2" ] && { echo 'Usage: $0 "file" "some" "command"
|
||||||
|
Runs the command when file exists. waits for max 5 minutes'
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
fname="$1"
|
||||||
|
shift 1
|
||||||
|
otime=1
|
||||||
|
while :
|
||||||
|
do [ -e "$fname" ] || {
|
||||||
|
echo -n "File: $fname not found! "
|
||||||
|
date
|
||||||
|
}
|
||||||
|
[ -e "$fname" ] && {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
otime=$(( $otime + 1 ))
|
||||||
|
sleep 1
|
||||||
|
[ $otime -gt 300 ] && {
|
||||||
|
echo "File $fname still missing after 5 minutes!"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
done
|
||||||
|
|
||||||
|
eval "$@"
|
||||||
@@ -112,4 +112,4 @@ fi
|
|||||||
|
|
||||||
echo "The job file is in $JOBFILE"
|
echo "The job file is in $JOBFILE"
|
||||||
# send the job
|
# send the job
|
||||||
srun --nodelist=${NODELIST[$INDEX]} "$JOBFILE"
|
srun --nodelist=${NODELIST[$INDEX]} slurm-cake "$JOBFILE"
|
||||||
|
|||||||
@@ -107,6 +107,6 @@ fi
|
|||||||
|
|
||||||
echo "The job file is in $JOBFILE"
|
echo "The job file is in $JOBFILE"
|
||||||
# send the job
|
# send the job
|
||||||
srun --nodelist=${NODELIST[$INDEX]} "$JOBFILE"
|
srun --nodelist=${NODELIST[$INDEX]} slurm-cake "$JOBFILE"
|
||||||
|
|
||||||
wait
|
wait
|
||||||
|
|||||||
Reference in New Issue
Block a user