PPSS now reports total processing time.

This commit is contained in:
Louwrentius 2010-02-13 23:00:49 +00:00
parent a2fdbba0c4
commit 53deba3d63
2 changed files with 14 additions and 3 deletions

15
ppss
View File

@ -25,7 +25,7 @@ trap 'kill_process' SIGINT
# Setting some vars. # Setting some vars.
SCRIPT_NAME="Distributed Parallel Processing Shell Script" SCRIPT_NAME="Distributed Parallel Processing Shell Script"
SCRIPT_VERSION="2.56b2" SCRIPT_VERSION="2.56b3"
# The first argument to this script can be a mode. # The first argument to this script can be a mode.
MODES="node start config stop pause continue deploy status erase kill" MODES="node start config stop pause continue deploy status erase kill"
@ -68,6 +68,8 @@ PROCESSORS=""
STOP_KEY="$RANDOM$RANDOM$RANDOM" # This is a signal to the listener to stop. STOP_KEY="$RANDOM$RANDOM$RANDOM" # This is a signal to the listener to stop.
KILL_KEY="$RANDOM$RANDOM$RANDOM" # This is a signal to stop immediately and kill KILL_KEY="$RANDOM$RANDOM$RANDOM" # This is a signal to stop immediately and kill
RECURSION="1" # all running processes. RECURSION="1" # all running processes.
START_PPSS="$(date +%s)"
STOP_PPSS=""
SSH_SERVER="" # Remote server or 'master'. SSH_SERVER="" # Remote server or 'master'.
SSH_KEY="" # SSH key for ssh account. SSH_KEY="" # SSH key for ssh account.
@ -1372,6 +1374,12 @@ start_single_worker () {
fi fi
} }
stop-ppss () {
STOP_PPSS="$(date +%s)"
elapsed "$START_PPSS" "$STOP_PPSS"
}
elapsed () { elapsed () {
@ -1386,7 +1394,8 @@ elapsed () {
SECS="$(expr $REMAINDER % 60)" SECS="$(expr $REMAINDER % 60)"
MINS="$(expr $(expr $REMAINDER - $SECS) / 60)" MINS="$(expr $(expr $REMAINDER - $SECS) / 60)"
echo "Elapsed time (h:m:s): $HOURS:$MINS:$SECS" RES=`printf 'Total processing time: %02d:%02d:%02d' $HOURS $MINS $SECS`
log DSPLY "$RES"
} }
commando () { commando () {
@ -1645,9 +1654,11 @@ listen_for_job () {
if [ ! "$PERCENT" == "100" ] if [ ! "$PERCENT" == "100" ]
then then
echo echo
stop-ppss
log DSPLY "Finished. Consult $JOB_LOG_DIR for job output." log DSPLY "Finished. Consult $JOB_LOG_DIR for job output."
log DSPLY "Press ENTER to continue." log DSPLY "Press ENTER to continue."
else else
stop-ppss
log DSPLY "Finished. Consult $JOB_LOG_DIR for job output." log DSPLY "Finished. Consult $JOB_LOG_DIR for job output."
fi fi
cleanup cleanup

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
DEBUG="$1" DEBUG="$1"
VERSION="2.56b2" VERSION="2.56b3"
TMP_DIR="ppss" TMP_DIR="ppss"
PPSS=./ppss PPSS=./ppss
PPSS_DIR=ppss_dir PPSS_DIR=ppss_dir