Skip to content

Commit

Permalink
Prints status of jobs.
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-kaspar committed Jan 24, 2018
1 parent b3eaee3 commit 049c52c
Showing 1 changed file with 22 additions and 10 deletions.
32 changes: 22 additions & 10 deletions run
Original file line number Diff line number Diff line change
Expand Up @@ -104,20 +104,32 @@ make "$src_file" || exit 2
#----------------------------------------------------------------------------------------------------
# execute

function ExecuteOneWithStatus()
{
echo "* $label: running"

cd "$d"
"$cwd/$src_file" $run_options &> "$src_file.log"
if [ $? -ne 0 ]
then
echo "* $label: run error"
else
echo "* $label: done"
fi
cd - > /dev/null
}

function ExecuteOne()
{
local dir="$1"
dir="$1"

cwd="`pwd -P`"

local cwd="`pwd -P`"
label="'$src_file' in '$d'"

if [ "$lxbatch" == "n" ]
then
echo "* '$src_file' in '$d': running"

cwd=`pwd -P`
cd "$d"
"$cwd/$src_file" $run_options &> "$src_file.log" &
cd - > /dev/null
ExecuteOneWithStatus &
else
cat "job_template" | sed " \
s|\$CMSSW_BASE|$CMSSW_BASE|;\
Expand All @@ -131,9 +143,9 @@ function ExecuteOne()
if [ "$submit" == "y" ]
then
result=`bsub -R "$bsub_options" -q "$bsub_queue" -o /dev/null -e /dev/null "$cwd/$dir/.$src_file.job"`
echo "* '$src_file' in '$d': $result"
echo "* $label: $result"
else
echo "* '$src_file' in '$d': would be submitted ($bsub_queue)"
echo "* $label: would be submitted ($bsub_queue)"
fi
fi
}
Expand Down

0 comments on commit 049c52c

Please sign in to comment.