diff --git a/RTCP/Run/src/CNProcessing.sh b/RTCP/Run/src/CNProcessing.sh index 04f63383d03a681593228c7035180726cbc226c9..bead9b675f54c12fba4c1bcd6b73e5695aa70554 100755 --- a/RTCP/Run/src/CNProcessing.sh +++ b/RTCP/Run/src/CNProcessing.sh @@ -5,6 +5,9 @@ source locations.sh function start() { set_psetinfo + # make sure the log dir exists + mkdir -p "$LOGDIR" + TMPDIR="`mktemp -d`" PIDFILE="$TMPDIR/pid" @@ -12,7 +15,7 @@ function start() { mkfifo "$PIDFILE" (mpirun -mode VN -partition "$PARTITION" -env DCMF_COLLECTIVES=0 -env BG_MAPPING=XYZT -env LD_LIBRARY_PATH=/bgsys/drivers/ppcfloor/comm/lib:/bgsys/drivers/ppcfloor/runtime/SPI:/globalhome/romein/lib.bgp -cwd "$LOGSYMLINK" -exe "$CNPROC" 2>&1 & - echo $! > "$PIDFILE") | LOFAR/Logger.py $LOGPARAMS "$LOGSYMLINK/CNProc.log" & + echo $! > "$PIDFILE") | LOFAR/Logger.py $LOGPARAMS "$LOGDIR/CNProc.log" & PID=`cat "$PIDFILE"` rm -f "$PIDFILE" diff --git a/RTCP/Run/src/IONProcessing.sh b/RTCP/Run/src/IONProcessing.sh index edafb9922c138b7694b3e255a63cd1a8a968e25a..0126d41cad3d2aa255c8640fc46def912dcbc3db 100755 --- a/RTCP/Run/src/IONProcessing.sh +++ b/RTCP/Run/src/IONProcessing.sh @@ -5,10 +5,8 @@ source locations.sh function start() { set_psetinfo - # create a new log dir - rm -f "$LOGSYMLINK" || true + # make sure the log dir exists mkdir -p "$LOGDIR" - ln -s "$LOGDIR" "$LOGSYMLINK" TMPDIR=`mktemp -d` PIDFILE="$TMPDIR/pid" @@ -17,7 +15,7 @@ function start() { mkfifo "$PIDFILE" (/bgsys/LOFAR/openmpi-ion/bin/mpirun -host "$PSETS" --pernode -wd "$LOGDIR" "$IONPROC" "$ISPRODUCTION" 2>&1 & - echo $! > "$PIDFILE") | LOFAR/Logger.py $LOGPARAMS "$LOGSYMLINK/IONProc.log" & + echo $! > "$PIDFILE") | LOFAR/Logger.py $LOGPARAMS "$LOGDIR/IONProc.log" & PID=`cat $PIDFILE` rm -f "$PIDFILE" diff --git a/RTCP/Run/src/LOFAR/Locations.py b/RTCP/Run/src/LOFAR/Locations.py index 20c55b62a19cd7877b4a46c846322bc35b52476f..d415b939967b9c6194a4cbb81719419bd0486e82 100644 --- a/RTCP/Run/src/LOFAR/Locations.py +++ b/RTCP/Run/src/LOFAR/Locations.py @@ -65,25 +65,14 @@ class Locations: # the observation ID is included to allow parallel observations # where to store logs - "logdir": "${BASEDIR}/D${TIMESTAMP}", + "logdir": "${BASEDIR}/log", # where configuration files are kept "configdir": ".", - "storage_configdir": ".", - - # where to start the executables. rundir needs to be reachable - # for all sections. - "rundir": "${BASEDIR}/D${TIMESTAMP}", - - # symlink to create to latest log dir - "logsymlink": "${BASEDIR}/log", - - # symlink for each observation to relevant log dir - "obssymlink": "${BASEDIR}/D${YEAR}_${OBSID}", # parset name mas - "parset": "${LOGSYMLINK}/L${OBSID}.parset", # for communication with Storage and offline pipelines - "parset-ion": "${LOGSYMLINK}/L${OBSID}.parset", # for communication with the I/O nodes + "parset": "${LOGDIR}/L${OBSID}.parset", # for communication with Storage and offline pipelines + "parset-ion": "${LOGDIR}/L${OBSID}.parset", # for communication with the I/O nodes # location of the observation id counter "nextmsnumber": "/globalhome/lofarsystem/log/nextMSNumber", @@ -100,24 +89,14 @@ class Locations: # the locations of the main executables "storage": "/opt/storage/current/bin/%s" % (self.executables["Storage"],), - # where to start the executables. rundir needs to be reachable - # for all sections. - "rundir": "${HOME}/log/L${TIMESTAMP}", - # where to store logs - "logdir": "${HOME}/log/L${TIMESTAMP}", + "logdir": "${HOME}/log", # where to save the parset "parset-ion": "/bghome0/lofarsys/parsets/RTCP-${OBSID}.parset", # for communication to the IO nodes # where configuration files are kept "configdir": "${BASEDIR}/bgfen/etc", - "storage_configdir": "/opt/storage/current/etc", - - # symlink for each observation to relevant log dir - "obssymlink": "${HOME}/log/L${OBSID}", - - "logsymlink": "${HOME}/log/latest", # location of valgrind suppressions file "ionsuppfile": "", @@ -130,7 +109,6 @@ class Locations: # where configuration files are kept "configdir": "${BASEDIR}/RTCP/Run/src", - "storage_configdir": "${BASEDIR}/installed/%s/etc" % (self.buildvars["Storage"],), "storage": "${BASEDIR}/installed/%s/bin/%s" % (self.buildvars["Storage"],self.executables["Storage"]), diff --git a/RTCP/Run/src/gracefullyStopBGProcessing.sh b/RTCP/Run/src/gracefullyStopBGProcessing.sh index 81757ac2d5b826e19d3615bf0d29d138bd8e956a..5e7eeb016992c26953b09a98d01c058124d4cb1d 100644 --- a/RTCP/Run/src/gracefullyStopBGProcessing.sh +++ b/RTCP/Run/src/gracefullyStopBGProcessing.sh @@ -6,4 +6,4 @@ set_psetinfo echo "cancel all" > /dev/tcp/$FIRSTPSET/4000 2>/dev/null && echo "quit" > /dev/tcp/$FIRSTPSET/4000 2>/dev/null && -sleep 5 # allow processes to quit +sleep 10 # allow processes to quit diff --git a/RTCP/Run/src/locations.sh.in b/RTCP/Run/src/locations.sh.in index 16fe5a4bb6f4d630ef1fe8583080f3e4f5d733fd..daa31ff71ca29260b7a4cd17ada7a401496e9007 100644 --- a/RTCP/Run/src/locations.sh.in +++ b/RTCP/Run/src/locations.sh.in @@ -12,8 +12,7 @@ then IONPROC=$HOME/production/lofar/bgp_ion/bin/ION_Processing ETCDIR=/opt/lofar/etc - LOGDIR=$HOME/log/L$TIMESTAMP - LOGSYMLINK=$HOME/log/latest + LOGDIR=$HOME/log LOGPARAMS="-s ccu001:24500" else ISPRODUCTION=0 @@ -22,8 +21,7 @@ else IONPROC=$HOME/projects/LOFAR/installed/bgpion_opt/bin/ION_Processing ETCDIR=@CMAKE_INSTALL_PREFIX@/etc - LOGDIR=$HOME/projects/LOFAR/L$TIMESTAMP - LOGSYMLINK=$HOME/projects/LOFAR/log + LOGDIR=$HOME/projects/LOFAR/log LOGPARAMS="-v" fi diff --git a/RTCP/Run/src/runParset.py b/RTCP/Run/src/runParset.py index f852d56daee334449566d8bd97cc985a254e75e0..4b583522ef579c8181137b077270566c7ec82228 100755 --- a/RTCP/Run/src/runParset.py +++ b/RTCP/Run/src/runParset.py @@ -102,6 +102,7 @@ if __name__ == "__main__": parset.save() if not options.norun: + """ try: obsDir = os.path.dirname( os.path.realpath( parset.filename ) ) symlinkName = Locations.resolvePath( Locations.files["obssymlink"], parset ) @@ -112,6 +113,7 @@ if __name__ == "__main__": warning( "Failed to create symlink %s -> %s" % (symlinkName,obsDir) ) except OSError,msg: warning( "Failed to create symlink %s -> %s" % (symlinkName,obsDir) ) + """ # save in separate location for IO nodes, to prevent contention for NFS drives with other processes parset.setFilename( Locations.resolvePath( Locations.files["parset-ion"], parset ) ) diff --git a/RTCP/Run/src/watchlogs.sh b/RTCP/Run/src/watchlogs.sh index 742efbf856bf7aabd384f02be433351795dc0f5d..695a6c54fded0b4cf288b2352599565845b46a2c 100755 --- a/RTCP/Run/src/watchlogs.sh +++ b/RTCP/Run/src/watchlogs.sh @@ -1,49 +1,20 @@ #!/bin/bash +source locations.sh + FLAGS="-n 10000" -# ----- find multitail -PATH=$PATH:/globalhome/broekema/bin - -# ----- find the logging directory -# . = current directory, to check first -# $HOME/log/latest = default logging directory for production -# $HOME/projects/LOFAR/log = default logging directory for development - -function set_logdir { - LOGDIR=$1 - - CNPROC=$LOGDIR/CNProc.log - IONPROC=$LOGDIR/IONProc.log -} - -for d in . "$HOME/production/lofar/bgfen/log/latest" "$HOME/log/latest" "$HOME/projects/LOFAR/log" -do - set_logdir $d - if [ -e $IONPROC ] - then - break - fi -done - -# ----- find the configuration for multitail -for c in `dirname $0` /opt/lofar/etc $HOME/projects/LOFAR/RTCP/Run/src -do - CONFDIR=$c - if [ -e $CONFDIR/multitail-olap.conf ] - then - break - fi -done +CNPROC_LOG=$LOGDIR/CNProc.log +IONPROC_LOG=$LOGDIR/IONProc.log echo Reading logs from $LOGDIR -echo Reading multitail configuration from $CONFDIR +echo Reading multitail configuration from $ETCDIR ERRORLOGS= -if [ "$USER" == "lofarsys" ] +if [ $ISPRODUCTION -eq 1 ] then - for l in /opt/lofar/log/BlueGeneControl.log $HOME/log/run.runParset.py.log + for l in $LOGDIR/BlueGeneControl.log $LOGDIR/run.runParset.py.log do echo Reading additional error log $l ERRORLOGS="$ERRORLOGS $FLAGS -cS olap -fr errors -I $l" @@ -51,11 +22,11 @@ then fi -multitail --no-mark-change --follow-all --retry-all -m 10240 --basename -F $CONFDIR/multitail-olap.conf \ - $FLAGS -t "-- FLAGS --" -fr flags -ks flags -i $IONPROC \ - $FLAGS -t "-- ERRORS --" -fr errors -i $IONPROC \ - $FLAGS -fr errors -I $CNPROC \ +multitail --no-mark-change --follow-all --retry-all -m 10240 --basename -F $ETCDIR/multitail-olap.conf \ + $FLAGS -t "-- FLAGS --" -fr flags -ks flags -i $IONPROC_LOG \ + $FLAGS -t "-- ERRORS --" -fr errors -i $IONPROC_LOG \ + $FLAGS -fr errors -I $CNPROC_LOG \ $ERRORLOGS \ - $FLAGS -t "IONProc/Storage" -i $IONPROC \ - $FLAGS -t "CNProc" -wh 5 -i $CNPROC + $FLAGS -t "IONProc/Storage" -i $IONPROC_LOG \ + $FLAGS -t "CNProc" -wh 5 -i $CNPROC_LOG