From e3e01465fd7b1327e7140a94736a8b5df182b6a7 Mon Sep 17 00:00:00 2001 From: Jan David Mol <mol@astron.nl> Date: Tue, 11 May 2010 12:57:47 +0000 Subject: [PATCH] bug 1362: repaired stopBGL.sh by providing the obsid to start/stopBGL.sh --- MAC/APL/Appl_Controller/ApplController.cc | 1 + MAC/APL/Appl_Controller/PR_BGL.cc | 9 ++++++--- MAC/APL/Appl_Controller/PR_BGL.h | 1 + MAC/APL/Appl_Controller/startBGL.sh | 1 + MAC/APL/Appl_Controller/stopBGL.sh | 17 ++++++++++++----- 5 files changed, 21 insertions(+), 8 deletions(-) diff --git a/MAC/APL/Appl_Controller/ApplController.cc b/MAC/APL/Appl_Controller/ApplController.cc index d717b2f0a10..4de617a9640 100644 --- a/MAC/APL/Appl_Controller/ApplController.cc +++ b/MAC/APL/Appl_Controller/ApplController.cc @@ -395,6 +395,7 @@ void ApplController::createParSubsets() basePS.getString("OLAP.CNProc.partition"), basePS.getString(procPrefix + "._executable"), basePS.getString(procPrefix + ".workingdir"), + basePS.getString("Observation.ObsID"), fileName, nrProcs)); writeParSubset(basePS, procName, fileName); diff --git a/MAC/APL/Appl_Controller/PR_BGL.cc b/MAC/APL/Appl_Controller/PR_BGL.cc index abad6644b76..f0bf2fc89d2 100644 --- a/MAC/APL/Appl_Controller/PR_BGL.cc +++ b/MAC/APL/Appl_Controller/PR_BGL.cc @@ -37,21 +37,24 @@ namespace LOFAR { const string& aPartition, const string& aExecutable, const string& aWorkingDir, + const string& aObservationID, const string& aParamFile, const uint numberOfNodes) : ProcRule("BGLjob", aPartition, aExecutable, aParamFile) { - itsStartCmd = formatString("./startBGL.sh %s %s %s %s %s %d", + itsStartCmd = formatString("./startBGL.sh %s %s %s %s %s %s %d", aJobName.c_str(), aPartition.c_str(), aExecutable.c_str(), aWorkingDir.c_str(), aParamFile.c_str(), + aObservationID.c_str(), numberOfNodes); - itsStopCmd = formatString("./stopBGL.sh %s %s", + itsStopCmd = formatString("./stopBGL.sh %s %s %s", + aJobName.c_str(), aPartition.c_str(), - aJobName.c_str()); + aObservationID.c_str()); } PR_BGL::PR_BGL(const PR_BGL& other) : diff --git a/MAC/APL/Appl_Controller/PR_BGL.h b/MAC/APL/Appl_Controller/PR_BGL.h index d3f939d0791..977a0a79c06 100644 --- a/MAC/APL/Appl_Controller/PR_BGL.h +++ b/MAC/APL/Appl_Controller/PR_BGL.h @@ -45,6 +45,7 @@ namespace LOFAR { const string& aPartition, const string& aExecutable, const string& aWorkingDir, + const string& aObservationID, const string& aParamfile, const uint numberOfNodes); diff --git a/MAC/APL/Appl_Controller/startBGL.sh b/MAC/APL/Appl_Controller/startBGL.sh index cac1f1752c2..4fb6d0071c9 100755 --- a/MAC/APL/Appl_Controller/startBGL.sh +++ b/MAC/APL/Appl_Controller/startBGL.sh @@ -4,6 +4,7 @@ # partition # executable executable file (should be in a place that is readable from BG/L) # workingDir directory for output files (should be readable by BG/L) +# observationID observation number # parameterfile jobName.ps # noNodes number of nodes of the partition to use # diff --git a/MAC/APL/Appl_Controller/stopBGL.sh b/MAC/APL/Appl_Controller/stopBGL.sh index 99e6ee9b4d5..5dc16d21a71 100755 --- a/MAC/APL/Appl_Controller/stopBGL.sh +++ b/MAC/APL/Appl_Controller/stopBGL.sh @@ -1,14 +1,21 @@ # stopAP.sh partition jobName # -# partition BG/L partition the job is running on -# jobName The name of the job +# jobName The name of the job +# partition BG/L partition the job is running on +# observationID Observation number # #echo -n "Killing job " $2 #killjob $1 `cat $2.jobID` #rm -f $2.pid $2.ps -JOB=$2 -PARTITION=$1 +JOB=$1 +PARTITION=$2 +OBSID=$3 -/opt/lofar/bin/commandOLAP.py -P $PARTITION cancel $JOB +# stopBGL.sh is used both to abort an observation and at the end of +# an observation. Sleep a bit so that OLAP can temrinate on its own +# in the latter case. +sleep 10 + +/opt/lofar/bin/commandOLAP.py -P $PARTITION cancel $OBSID -- GitLab