Skip to content

Commit

Permalink
Update caffepredict.sh
Browse files Browse the repository at this point in the history
Fix an issue where caffepredict couldn't fail
  • Loading branch information
redistributer authored Jun 12, 2019
1 parent 117f94a commit 85ac901
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions caffepredict.sh
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ for line in `cat $parallel_job_file`; do # EACH LINE IN THE parallel.jobs FI
((job_count++)) # ADD A JOB
if [ $job_count == $gpucount ]; then # IF THE job_count HAS REACHED IT'S MAX (gpucount)
parallel --no-notice -j $gpucount < $cmdlets # RUN THE CURRENT JOB QUEUE
ecode=$?
if [ $ecode != 0 ] ; then
fatal_error "$out_dir" "ERROR non-zero exit code ($ecode) from running predict_seg_new.bin" 6
fi
job_count=0 # RESET THE JOB COUNT
cat $cmdlets >> $cmdsran # TRACK THE COMMANDS THAT WERE RUN
rm -f $cmdlets # CLEAN OLD COMMANDS
Expand All @@ -203,15 +207,14 @@ done # END - for line in `cat $parallel_job_file`; do
# CHECK TO SEE IF THERE ARE ANY JOBS STILL PENDING AND RUN THEM
if [ $job_count -gt 0 ]; then
parallel --no-notice -j $gpucount < $cmdlets
ecode=$?
if [ $ecode != 0 ] ; then
fatal_error "$out_dir" "ERROR non-zero exit code ($ecode) from running predict_seg_new.bin" 6
fi
cat $cmdlets >> $cmdsran
rm -f $cmdlets
fi

ecode=$?
if [ $ecode != 0 ] ; then
fatal_error "$out_dir" "ERROR non-zero exit code ($ecode) from running predict_seg_new.bin" 6
fi

echo ""

echo -e "Success\n0" >> "$done_file"
Expand Down

0 comments on commit 85ac901

Please sign in to comment.