Skip to content

Commit

Permalink
logging on//changephase/off functional for multiple machines
Browse files Browse the repository at this point in the history
  • Loading branch information
spennihana committed Oct 20, 2013
1 parent 43bdb45 commit c4fcae7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
17 changes: 8 additions & 9 deletions bench/runBench.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function doAlgo {

echo "Running $1 benchmark..."
echo "Changing little logger phase..."
bash startLoggers.sh ${JSON} changePhase $1
bash startloggers.sh ${JSON} changePhase $1

pyScript="BMscripts/"$1"Bench.py"
wait
Expand Down Expand Up @@ -139,8 +139,8 @@ then
echo $starttime > BMLogs/starttime

#Gentlemen...Start your loggers!
bash startLoggers.sh ${JSON} big
bash startLoggers.sh ${JSON} little
bash startloggers.sh ${JSON} big
bash startloggers.sh ${JSON} little
fi

if [ ${DEBUG} -eq 1 ]
Expand All @@ -165,13 +165,12 @@ else
wait
fi

bash startLoggers.sh ${JSON} stop_
bash startloggers.sh ${JSON} stop_

#remove annoying useless files
#rm pytest*flatfile*
#rm benchmark*log
rm pytest*flatfile*

#archive nohup
#if [ -a nohup.out ]; then
# mv nohup.out ${archive}/${h2oBuild}-${DATE}-nohup.out
#fi
if [ -a nohup.out ]; then
mv nohup.out ${archive}/${h2oBuild}-${DATE}-nohup.out
fi
13 changes: 6 additions & 7 deletions bench/startloggers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,23 @@ function startLittleLoggers {
function stopLittleLoggers {
for i in ${MACHINES[@]}
do
"Stopping little loggers on machine $i"
pids=`echo spencer@$i ps ax|grep bash|grep littleLogger|awk '{print $1}'| xargs`
echo "Changing little logger $i to phase $1"
pids=`ssh spencer@$i ps ax|grep bash|grep littleLogger|awk '{print $1}'| xargs`
ssh spencer@$i kill $pids
done
}

function stopAllLoggers {
for i in ${MACHINES[@]}
do
"Stopping all loggers on machine $i"
pids=`echo ssh spencer@$i ps ax|grep bash|grep Logger|awk '{print $1}'| xargs`
echo "Stopping all loggers on machine $i"
pids=`ssh spencer@$i ps ax|grep bash|grep Logger|awk '{print $1}'| xargs`
ssh spencer@$i kill $pids
done
}

function changePhase {
echo "Stopping little loggers"
stopLittleLoggers >/dev/null
stopLittleLoggers $1
newPhase=$1
startLittleLoggers $1 >/dev/null
}
Expand All @@ -59,7 +58,7 @@ fi

if [ $2 = "changePhase" ]
then
changePhase $3 >/dev/null
changePhase $3
fi

if [ $2 = "stop_" ]
Expand Down

0 comments on commit c4fcae7

Please sign in to comment.