slurm prefix scripts, possible bug with exit codes. added checking of _command file

This commit is contained in:
ville rantanen
2014-08-26 21:17:49 +03:00
parent 9c8616f39f
commit aa6a30ca48
2 changed files with 36 additions and 0 deletions

View File

@@ -69,6 +69,20 @@ EXECPATH=$( pwd )
# create the jobfile
echo '#!/bin/bash' > "$JOBFILE"
chmod 755 "$JOBFILE"
# Find _command file
for (( i=1; i<=$#; i++ ))
do if [[ "${!i}" == */_command ]]
then echo 'retrys=0' >> "$JOBFILE"
echo 'while :
do [ -f "'${!i}'" ] && {
break
} || {
echo Waiting for _command file
sleep 1; [ "$retrys" -gt 15 ] && break;
}
done ' >> "$JOBFILE"
fi
done
echo 'echo Node: $HOSTNAME'" >> \"$STATFILE\" " >> "$JOBFILE"
echo "pwd >> \"$STATFILE\" " >> "$JOBFILE"
@@ -81,8 +95,14 @@ done
cat - >> "$STRMFILE"
echo -n ' < "'$STRMFILE'"' >> "$JOBFILE"
echo -e "\n" >> "$JOBFILE"
echo 'EC=$?' >> "$JOBFILE"
echo "date +'Stop: %s' >> \"$STATFILE\" " >> "$JOBFILE"
echo 'exit $EC' >> "$JOBFILE"
echo "The job file is in $JOBFILE"
# send the job
srun --nodelist=${NODELIST[$INDEX]} "$JOBFILE"

View File

@@ -64,6 +64,20 @@ EXECPATH=$( pwd )
# create the jobfile
echo '#!/bin/bash' > "$JOBFILE"
chmod 755 "$JOBFILE"
# Find _command file
for (( i=1; i<=$#; i++ ))
do if [[ "${!i}" == */_command ]]
then echo 'retrys=0' >> "$JOBFILE"
echo 'while :
do [ -f "'${!i}'" ] && {
break
} || {
echo Waiting for _command file
sleep 1; [ "$retrys" -gt 15 ] && break;
}
done ' >> "$JOBFILE"
fi
done
echo 'echo Node: $HOSTNAME'" >> \"$STATFILE\" " >> "$JOBFILE"
echo "pwd >> \"$STATFILE\" " >> "$JOBFILE"
@@ -76,7 +90,9 @@ done
cat - >> "$STRMFILE"
echo -n ' < "'$STRMFILE'"' >> "$JOBFILE"
echo -e "\n" >> "$JOBFILE"
echo 'EC=$?' >> "$JOBFILE"
echo "date +'Stop: %s' >> \"$STATFILE\" " >> "$JOBFILE"
echo 'exit $EC' >> "$JOBFILE"
echo "The job file is in $JOBFILE"
# send the job