diff --git a/.gitattributes b/.gitattributes index af1e825585bc177ed64e244a2c2c2ef353e4e7bc..c1c3a13084ce0c231ac18d9e707da1c262353cce 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4863,7 +4863,10 @@ SAS/OTDB/test/t_getTreeGroup.run -text SAS/OTDB/test/t_getTreeGroup.sh -text SAS/OTDB/test/unittest_db.dump.gz -text svneol=unset#application/x-gzip SAS/OTDB_Services/CMakeLists.txt -text +SAS/OTDB_Services/OTDB_Services.ini -text +SAS/OTDB_Services/TreeService.ini -text SAS/OTDB_Services/TreeService.py -text +SAS/OTDB_Services/TreeStatusEvents.ini -text SAS/OTDB_Services/TreeStatusEvents.py -text SAS/OTDB_Services/test/CMakeLists.txt -text SAS/OTDB_Services/test/t_TreeService.py -text diff --git a/CEP/Calibration/pystationresponse/src/pystationresponse.cc b/CEP/Calibration/pystationresponse/src/pystationresponse.cc index e8f29bbc21c1cd59445496438ab5aa59b0826d33..6e890d176d59c0f08a966a817a3807f3706cc45e 100755 --- a/CEP/Calibration/pystationresponse/src/pystationresponse.cc +++ b/CEP/Calibration/pystationresponse/src/pystationresponse.cc @@ -415,8 +415,8 @@ namespace BBS ASSERT (vh_station0.dataType() == TpArrayDouble); ASSERT (vh_tile0.dataType() == TpArrayDouble); Array<Double> arr_dir(vh_direction.asArrayDouble()); - Array<Double> st0_dir(vh_direction.asArrayDouble()); - Array<Double> tile_dir(vh_direction.asArrayDouble()); + Array<Double> st0_dir(vh_station0.asArrayDouble()); + Array<Double> tile_dir(vh_tile0.asArrayDouble()); vector3r_t direction={{arr_dir.data()[0],arr_dir.data()[1],arr_dir.data()[2]}}; vector3r_t station0 ={{st0_dir.data()[0],st0_dir.data()[1],st0_dir.data()[2]}}; vector3r_t tile0 ={{tile_dir.data()[0],tile_dir.data()[1],tile_dir.data()[2]}}; @@ -651,7 +651,8 @@ namespace BBS boost::python::arg("freq"))) .def ("evaluate4", &PyStationResponse::evaluate4, (boost::python::arg("time"), boost::python::arg("station"), - boost::python::arg("freq"), boost::python::arg("direction"))) + boost::python::arg("freq"), boost::python::arg("direction"), + boost::python::arg("station0"), boost::python::arg("tile0"))) ; } diff --git a/CEP/DP3/DPPP/include/DPPP/ApplyCal.h b/CEP/DP3/DPPP/include/DPPP/ApplyCal.h index f25b4d3a82262be10450453cc5088d0e169cd3f8..6ecfa01bf965a18d25eb9b7039f99660ce31e8c7 100644 --- a/CEP/DP3/DPPP/include/DPPP/ApplyCal.h +++ b/CEP/DP3/DPPP/include/DPPP/ApplyCal.h @@ -47,7 +47,10 @@ namespace LOFAR { public: // Construct the object. // Parameters are obtained from the parset using the given prefix. - ApplyCal (DPInput*, const ParameterSet&, const string& prefix); + ApplyCal (DPInput*, const ParameterSet&, const string& prefix, + bool substep=false); + + ApplyCal(); virtual ~ApplyCal(); @@ -68,6 +71,10 @@ namespace LOFAR { // Show the timings. virtual void showTimings (std::ostream&, double duration) const; + bool invert() { + return itsInvert; + } + // Invert a 2x2 matrix in place static void invert (casa::DComplex* v, double sigmaMMSE=0); diff --git a/CEP/DP3/DPPP/include/DPPP/Predict.h b/CEP/DP3/DPPP/include/DPPP/Predict.h index e0fc248b31df32809c74c695e3d0d2c7368672a7..237c2d6b91ac302fb0bbe90cd0d9275753b25e61 100644 --- a/CEP/DP3/DPPP/include/DPPP/Predict.h +++ b/CEP/DP3/DPPP/include/DPPP/Predict.h @@ -93,11 +93,17 @@ namespace LOFAR { string itsName; DPBuffer itsBuffer; string itsSourceDBName; + string itsOperation; bool itsApplyBeam; bool itsUseChannelFreq; bool itsOneBeamPerPatch; Position itsPhaseRef; + bool itsDoApplyCal; + ApplyCal itsApplyCalStep; + DPBuffer itsTempBuffer; + ResultStep* itsResultStep; // For catching results from ApplyCal + uint itsDebugLevel; vector<Baseline> itsBaselines; @@ -121,7 +127,6 @@ namespace LOFAR { vector<casa::Cube<dcomplex> > itsModelVis; // one for every thread vector<casa::Cube<dcomplex> > itsModelVisPatch; - string itsOperation; NSTimer itsTimer; NSTimer itsTimerPredict; diff --git a/CEP/DP3/DPPP/src/ApplyCal.cc b/CEP/DP3/DPPP/src/ApplyCal.cc index 24c2a593298d7d37c87a3052b374e9a001148e9c..7a715bd40e18b3ddc073dbef318158a808b890b0 100644 --- a/CEP/DP3/DPPP/src/ApplyCal.cc +++ b/CEP/DP3/DPPP/src/ApplyCal.cc @@ -44,12 +44,12 @@ namespace LOFAR { ApplyCal::ApplyCal (DPInput* input, const ParameterSet& parset, - const string& prefix) + const string& prefix, + bool substep) : itsInput (input), itsName (prefix), itsParmDBName (parset.getString (prefix + "parmdb")), itsCorrectType (toLower(parset.getString (prefix + "correction", "gain"))), - itsInvert (parset.getBool (prefix + "invert", true)), itsTimeSlotsPerParmUpdate (parset.getInt (prefix + "timeslotsperparmupdate", 500)), itsSigmaMMSE (parset.getDouble (prefix + "MMSE.Sigma", 0)), @@ -61,11 +61,19 @@ namespace LOFAR { itsUseAP (false) { ASSERT (!itsParmDBName.empty()); + if (substep) { + itsInvert=false; + } else { + itsInvert=parset.getBool (prefix + "invert", true); + } if (itsCorrectType=="fulljones" && itsUpdateWeights) { ASSERTSTR (itsInvert, "Updating weights has not been implemented for invert=false and fulljones"); } } + ApplyCal::ApplyCal() + {} + ApplyCal::~ApplyCal() {} @@ -109,7 +117,7 @@ namespace LOFAR { // Defvalues with :Ampl present itsUseAP = true; } else { - THROW (Exception, "No gains found in parmdb"); + THROW (Exception, "No gains found in parmdb "+itsParmDBName); } } diff --git a/CEP/DP3/DPPP/src/DPRun.cc b/CEP/DP3/DPPP/src/DPRun.cc index 83e712773e08411d463c2ef2bca2e781e097bf0f..d504b7f83f9d1d9634b9fcdf53e7c58265e179d5 100644 --- a/CEP/DP3/DPPP/src/DPRun.cc +++ b/CEP/DP3/DPPP/src/DPRun.cc @@ -49,6 +49,7 @@ #include <DPPP/DPLogger.h> #include <Common/Timer.h> #include <Common/StreamUtil.h> +#include <Common/OpenMP.h> #include <casa/OS/Path.h> #include <casa/OS/DirectoryIterator.h> @@ -122,6 +123,9 @@ namespace LOFAR { bool showcounts = parset.getBool ("showcounts", true); + uint numThreads = parset.getInt("numthreads", OpenMP::maxThreads()); + OpenMP::setNumThreads(numThreads); + // Create the steps and fill their DPInfo objects. DPStep::ShPtr firstStep = makeSteps (parset); // Show the steps. diff --git a/CEP/DP3/DPPP/src/GainCal.cc b/CEP/DP3/DPPP/src/GainCal.cc index de6fd66510ba4183157fc1a6a24c6034b65bfca6..602343cf43aa09f43343fe89d3560e2f8b6f4786 100644 --- a/CEP/DP3/DPPP/src/GainCal.cc +++ b/CEP/DP3/DPPP/src/GainCal.cc @@ -451,7 +451,7 @@ namespace LOFAR { iS.h(st,3)=conj(iS.g(st,3)); } -#pragma omp parallel for +//#pragma omp parallel for for (uint st1=0;st1<nSt;++st1) { uint thread=OpenMP::threadNum(); DComplex* vis_p; @@ -518,7 +518,7 @@ namespace LOFAR { for (uint st=0;st<nUn;++st) { iS.h(st,0)=conj(iS.g(st,0)); } -#pragma omp parallel for +//#pragma omp parallel for for (uint st1=0;st1<nUn;++st1) { uint thread=OpenMP::threadNum(); DComplex* vis_p; diff --git a/CEP/DP3/DPPP/src/Predict.cc b/CEP/DP3/DPPP/src/Predict.cc index c42413b4b83e2848199688d39a366edd8021aff7..64db694225cb1c64de98ff83ee4ae1bf083777fd 100644 --- a/CEP/DP3/DPPP/src/Predict.cc +++ b/CEP/DP3/DPPP/src/Predict.cc @@ -66,7 +66,8 @@ namespace LOFAR { const string& prefix) : itsInput (input), itsName (prefix), - itsSourceDBName (parset.getString (prefix + "sourcedb")), + itsSourceDBName (parset.getString (prefix + "sourcedb")), + itsOperation (parset.getString (prefix + "operation", "replace")), itsApplyBeam (parset.getBool (prefix + "usebeammodel", false)), itsDebugLevel (parset.getInt (prefix + "debuglevel", 0)), itsPatchList () @@ -78,6 +79,9 @@ namespace LOFAR { vector<string> patchNames=makePatchList(sourceDB, sourcePatterns); itsPatchList = makePatches (sourceDB, patchNames, patchNames.size()); + ASSERT(itsOperation=="replace" || itsOperation=="add" || + itsOperation=="subtract"); + if (itsApplyBeam) { itsUseChannelFreq=parset.getBool (prefix + "usechannelfreq", true); itsOneBeamPerPatch=parset.getBool (prefix + "onebeamperpatch", true); @@ -100,6 +104,16 @@ namespace LOFAR { } } + if (parset.isDefined(prefix + "applycal.parmdb")) { + itsDoApplyCal=true; + itsApplyCalStep=ApplyCal(input, parset, prefix + "applycal.", true); + ASSERT(!(itsOperation!="replace" && + parset.getBool(prefix + "applycal.updateweights", false))); + itsResultStep=new ResultStep(); + itsApplyCalStep.setNextStep(DPStep::ShPtr(itsResultStep)); + } else { + itsDoApplyCal=false; + } itsSourceList = makeSourceList(itsPatchList); } @@ -160,6 +174,10 @@ namespace LOFAR { itsInput->fillBeamInfo (itsAntBeamInfo[thread], info().antennaNames()); } } + + if (itsDoApplyCal) { + info()=itsApplyCalStep.setInfo(info()); + } } void Predict::show (std::ostream& os) const @@ -180,7 +198,11 @@ namespace LOFAR { os << " use channelfreq: " << boolalpha << itsUseChannelFreq << endl; os << " one beam per patch:" << boolalpha << itsOneBeamPerPatch << endl; } + os << " operation: "<<itsOperation << endl; os << " threads: "<<OpenMP::maxThreads()<<endl; + if (itsDoApplyCal) { + itsApplyCalStep.show(os); + } } void Predict::showTimings (std::ostream& os, double duration) const @@ -193,11 +215,9 @@ namespace LOFAR { bool Predict::process (const DPBuffer& bufin) { itsTimer.start(); - itsBuffer.copy (bufin); - Complex* data=itsBuffer.getData().data(); - itsInput->fetchUVW(bufin, itsBuffer, itsTimer); - ///?? itsInput->fetchWeights(bufin, itsBuffer, itsTimer); - ///??itsInput->fetchFullResFlags(bufin, itsBuffer, itsTimer); + itsTempBuffer.copy (bufin); + itsInput->fetchUVW(bufin, itsTempBuffer, itsTimer); + itsInput->fetchWeights(bufin, itsTempBuffer, itsTimer); // Determine the various sizes. //const size_t nDr = itsPatchList.size(); @@ -207,11 +227,11 @@ namespace LOFAR { const size_t nCr = 4; const size_t nSamples = nBl * nCh * nCr; - double time = itsBuffer.getTime(); + double time = itsTempBuffer.getTime(); itsTimerPredict.start(); - nsplitUVW(itsUVWSplitIndex, itsBaselines, itsBuffer.getUVW(), itsUVW); + nsplitUVW(itsUVWSplitIndex, itsBaselines, itsTempBuffer.getUVW(), itsUVW); //Set up directions for beam evaluation StationResponse::vector3r_t refdir, tiledir; @@ -243,6 +263,7 @@ namespace LOFAR { Patch::ConstPtr curPatch; #pragma omp for for (uint i=0;i<itsSourceList.size();++i) { + // Keep on predicting, only apply beam when an entire patch is done if (itsApplyBeam && curPatch!=itsSourceList[i].second && curPatch!=0) { addBeamToData (curPatch, time, refdir, tiledir, thread, nSamples, itsModelVisPatch[thread].data()); @@ -251,17 +272,41 @@ namespace LOFAR { curPatch=itsSourceList[i].second; } + // Apply beam to the last patch if (itsApplyBeam && curPatch!=0) { addBeamToData (curPatch, time, refdir, tiledir, thread, nSamples, itsModelVisPatch[thread].data()); } } - //Add all thread model data to one buffer - itsBuffer.getData()=Complex(); + // Add all thread model data to one buffer + itsTempBuffer.getData()=Complex(); + Complex* tdata=itsTempBuffer.getData().data(); for (uint thread=0;thread<OpenMP::maxThreads();++thread) { - std::transform(data, data+nSamples, itsModelVis[thread].data(), - data, std::plus<dcomplex>()); + std::transform(tdata, tdata+nSamples, itsModelVis[thread].data(), + tdata, std::plus<dcomplex>()); + } + + // Call ApplyCal step + if (itsDoApplyCal) { + itsApplyCalStep.process(itsTempBuffer); + itsTempBuffer=itsResultStep->get(); + tdata=itsTempBuffer.getData().data(); + } + + // Put predict result from temp buffer into the 'real' buffer + if (itsOperation=="replace") { + itsBuffer=itsTempBuffer; + } else { + itsBuffer.copy(bufin); + Complex* data=itsBuffer.getData().data(); + if (itsOperation=="add") { + std::transform(data, data+nSamples, tdata, + data, std::plus<dcomplex>()); + } else if (itsOperation=="subtract") { + std::transform(data, data+nSamples, tdata, + data, std::minus<dcomplex>()); + } } itsTimerPredict.stop(); diff --git a/CEP/DP3/DPPP/test/tPredict.run b/CEP/DP3/DPPP/test/tPredict.run index 2c39ce99167233c76a918029b4b350c14604a81c..c5a240a07a0c4807bacec683683e2688751f2283 100755 --- a/CEP/DP3/DPPP/test/tPredict.run +++ b/CEP/DP3/DPPP/test/tPredict.run @@ -23,6 +23,29 @@ tar zxf ${srcdir}/tPredict.tab.tgz # Create expected taql output. echo " select result of 0 rows" > taql.ref +echo; echo "Test with beam, subtract"; echo +../../src/NDPPP msin=tNDPPP-generic.MS msout=. msout.datacolumn=MODEL_DATA steps=[predict] predict.sourcedb=tNDPPP-generic.MS/sky predict.usebeammodel=true predict.operation=subtract +# Compare the MODEL_DATA column of the output MS with the original data minus the BBS reference output. +$taqlexe 'select from tNDPPP-generic.MS t1, tPredict.tab t2 where not all(near(t1.MODEL_DATA,t1.DATA-t2.PREDICT_beam,5e-2) || (isnan(t1.DATA) && isnan(t2.PREDICT_beam)))' > taql.out +diff taql.out taql.ref || exit 1 + +echo; echo "Test without beam, add"; echo +../../src/NDPPP msin=tNDPPP-generic.MS msout=. msout.datacolumn=MODEL_DATA steps=[predict] predict.sourcedb=tNDPPP-generic.MS/sky predict.usebeammodel=false predict.operation=add +# Compare the MODEL_DATA column of the output MS with the original data plus the BBS reference output. +$taqlexe 'select from tNDPPP-generic.MS t1, tPredict.tab t2 where not all(near(t1.MODEL_DATA,t1.DATA+t2.PREDICT_nobeam,5e-2) || (isnan(t1.DATA) && isnan(t2.PREDICT_beam)))' > taql.out +diff taql.out taql.ref || exit 1 + +echo; echo "Test without beam, with applycal, subtract (like peeling)"; echo +../../../../ParmDB/src/parmdbm <<EOL +open table="tPredict.parmdb" +adddef Gain:0:0:Real values=3. +adddef Gain:1:1:Real values=3. +EOL +../../src/NDPPP msin=tNDPPP-generic.MS msout=. msout.datacolumn=MODEL_DATA steps=[predict] predict.sourcedb=tNDPPP-generic.MS/sky predict.applycal.parmdb=tPredict.parmdb predict.operation=subtract +# Compare the MODEL_DATA column of the output MS with the original data minus the BBS reference output. +$taqlexe 'select from tNDPPP-generic.MS t1, tPredict.tab t2 where not all(near(t1.MODEL_DATA,t1.DATA-9.0*t2.PREDICT_nobeam,5e-2) || (isnan(t1.DATA) && isnan(t2.PREDICT_nobeam)))' > taql.out +diff taql.out taql.ref || exit 1 + echo; echo "Test without beam"; echo ../../src/NDPPP msin=tNDPPP-generic.MS msout=. steps=[predict] predict.sourcedb=tNDPPP-generic.MS/sky # Compare the DATA column of the output MS with the BBS reference output. @@ -35,4 +58,3 @@ echo; echo "Test with beam"; echo # Compare the DATA column of the output MS with the BBS reference output. $taqlexe 'select from tNDPPP-generic.MS t1, tPredict.tab t2 where not all(near(t1.DATA,t2.PREDICT_beam,5e-2) || (isnan(t1.DATA) && isnan(t2.PREDICT_beam)))' > taql.out diff taql.out taql.ref || exit 1 - diff --git a/CEP/DP3/DPPP/test/tPredict_ref b/CEP/DP3/DPPP/test/tPredict_ref index 31e6e24cedfd58bb6030262b31ba76ccb9b8c1b2..5c5cd3d6e998c76dab39927947c4a1cec2908350 100755 --- a/CEP/DP3/DPPP/test/tPredict_ref +++ b/CEP/DP3/DPPP/test/tPredict_ref @@ -44,8 +44,22 @@ bbs-reducer --sourcedb=tNDPPP-generic.MS/sky tNDPPP-generic.MS tPredict-bbs-beam rm tPredict-bbs-beam.parset +#### Run BBS, corrupt data with beam, subtract from data + +cat > tPredict-bbs-beam-subtract.parset <<EOF +Strategy.ChunkSize=100 +Strategy.Steps=[subtract_beam] + +Step.subtract_beam.Operation=PREDICT +Step.subtract_beam.Model.Beam.Enable=TRUE +Step.subtract_beam.Model.Beam.UseChannelFreq=TRUE +Step.subtract_beam.Output.Column=SUBTRACT_beam +EOF + +bbs-reducer --sourcedb=tNDPPP-generic.MS/sky tNDPPP-generic.MS tPredict-bbs-beam.parset + #### Store output from BBS in separate table -taql 'select from (select PREDICT_nobeam, PREDICT_beam from tNDPPP-generic.MS giving tPredict.tab as plain)' +taql 'select from (select PREDICT_nobeam, PREDICT_beam, SUBTRACT_BEAM from tNDPPP-generic.MS giving tPredict.tab as plain)' tar czf tPredict.tab.tgz tPredict.tab diff --git a/CEP/Pipeline/recipes/sip/master/executable_args.py b/CEP/Pipeline/recipes/sip/master/executable_args.py index 1b1e55b919ecc5c3abf2ecc184931caf27e6f062..4c07727745f06af08cdf6b0b8a608335383d6800 100644 --- a/CEP/Pipeline/recipes/sip/master/executable_args.py +++ b/CEP/Pipeline/recipes/sip/master/executable_args.py @@ -171,6 +171,12 @@ class executable_args(BaseRecipe, RemoteCommandRecipeMixIn): '--environment', help="Update environment variables for this step.", optional=True + ), + 'error_tolerance': ingredient.BoolField( + '--error_tolerance', + help="Controls if the program exits on the first error or continues with succeeded MS.", + default=True, + optional=True ) } @@ -313,7 +319,18 @@ class executable_args(BaseRecipe, RemoteCommandRecipeMixIn): # ******************************************************************** # Call the node side of the recipe # Create and schedule the compute jobs - command = "python %s" % (self.__file__.replace('master', 'nodes')).replace('executable_args', self.inputs['nodescript']) + #command = "python %s" % (self.__file__.replace('master', 'nodes')).replace('executable_args', self.inputs['nodescript']) + recipe_dir_str = str(self.config.get('DEFAULT', 'recipe_directories')) + recipe_directories = recipe_dir_str.rstrip(']').lstrip('[').split(',') + pylist = os.getenv('PYTHONPATH').split(':') + command = None + for pl in pylist: + if os.path.isfile(os.path.join(pl,'lofarpipe/recipes/nodes/'+self.inputs['nodescript']+'.py')): + command = "python %s" % os.path.join(pl,'lofarpipe/recipes/nodes/'+self.inputs['nodescript']+'.py') + for pl in recipe_directories: + if os.path.isfile(os.path.join(pl,'nodes/'+self.inputs['nodescript']+'.py')): + command = "python %s" % os.path.join(pl,'nodes/'+self.inputs['nodescript']+'.py') + inputmapfiles[0].iterator = outputmapfiles[0].iterator = DataMap.SkipIterator jobs = [] for i, (outp, inp,) in enumerate(zip( @@ -362,6 +379,9 @@ class executable_args(BaseRecipe, RemoteCommandRecipeMixIn): for job, outp in zip(jobs, outputmapfiles[0]): if job.results['returncode'] != 0: outp.skip = True + if not self.inputs['error_tolerance']: + self.logger.error("A job has failed and error_tolerance is not set. Bailing out!") + return 1 for k, v in job.results.items(): if not k in jobresultdict: jobresultdict[k] = [] diff --git a/CEP/Pipeline/recipes/sip/nodes/imager_create_dbs.py b/CEP/Pipeline/recipes/sip/nodes/imager_create_dbs.py index e258f8c279fc47beeee0e06edf418d645c6a58d2..0fe1189ac51332120f88f65854d1e77c9d9c4234 100644 --- a/CEP/Pipeline/recipes/sip/nodes/imager_create_dbs.py +++ b/CEP/Pipeline/recipes/sip/nodes/imager_create_dbs.py @@ -322,6 +322,11 @@ class imager_create_dbs(LOFARnodeTCP): row. All exceptions thrown are caught and logged, return None if reading failed """ + + table = None; + field = None; + ra_and_decl = None; + try: # open the ms, get the phase direction table = pt.table(measurement_set) @@ -336,10 +341,14 @@ class imager_create_dbs(LOFARnodeTCP): raise exception finally: - field.close() - table.close() + if field is not None: + field.close() + if table is not None: + table.close() # Return the ra and decl + if ra_and_decl is None: + return None if len(ra_and_decl) != 2: self.logger.error( "returned PHASE_DIR data did not contain two values") diff --git a/LCS/MessageDaemons/ObservationStartListener/src/ObservationStartListener.py b/LCS/MessageDaemons/ObservationStartListener/src/ObservationStartListener.py index fd8700f02c7fbdc3c07d7b5020de1dc5e8f0b9d4..6a8c0f787bfc3fd7f293c2df5d04e4ce013c5aab 100755 --- a/LCS/MessageDaemons/ObservationStartListener/src/ObservationStartListener.py +++ b/LCS/MessageDaemons/ObservationStartListener/src/ObservationStartListener.py @@ -191,27 +191,22 @@ def getModuleName(): return name def initLogger(logfilename, quiet): - # RootLogger may have already been set up by an imported LOFAR pkg (broken). - # If so, reuse its log format. Else, set up something reasonable. + # Log to file. Optional to stderr. File-only is better for a system service. global logger - logger = logging.getLogger() - if logger.handlers: - sh = logger.handlers[0] - fmt = sh.formatter - else: - logger = logging.getLogger(getModuleName()) - logger.setLevel(logging.INFO) - sh = logging.StreamHandler() # stderr by default - fmt = logging.Formatter('%(asctime)s %(levelname)s %(message)s') - sh.setFormatter(fmt) + logger = logging.getLogger(getModuleName()) + logger.setLevel(logging.INFO) + fmt = logging.Formatter('%(asctime)s %(levelname)s %(message)s') - # Always make fh handler 0 to easily hook up created processes to it. fh = logging.FileHandler(logfilename) # appends or creates, may raise fh.setLevel(logging.INFO) fh.setFormatter(fmt) - logger.handlers[0] = fh + logger.addHandler(fh) # created process logic expects file logger first if not quiet: + sh = logging.StreamHandler() # stderr by default + sh.setLevel(logging.INFO) + sh.setFormatter(fmt) logger.addHandler(sh) + return fh def registerCmdOptions(parser): @@ -316,7 +311,7 @@ def main(args): logger.info('Exiting due to SIGTERM (status was %d)', status) os.kill(os.getpid(), signal.SIGTERM) else: - logger.warn('KeyboardInterrupt') + logger.info('KeyboardInterrupt') status = 1 # maybe need os.kill() too, but Python exits 1 on kbint logger.info('Exiting with status %d', status) diff --git a/MAC/Deployment/data/StaticMetaData/RSPConnections_Cobalt.dat b/MAC/Deployment/data/StaticMetaData/RSPConnections_Cobalt.dat index 38dbc036b2de2c5f6d4f460265722ebd9534dacb..af07cb061d32eb072d8f9c7117572d1b1704b171 100644 --- a/MAC/Deployment/data/StaticMetaData/RSPConnections_Cobalt.dat +++ b/MAC/Deployment/data/StaticMetaData/RSPConnections_Cobalt.dat @@ -9,213 +9,181 @@ # 1x48 HBA tiles, one for 2x24 HBA tiles. These have two separate # entries in this file. # +# International stations have one entry per VLAN. Each set of entries +# must be duplicated to obtain the settings for the 4 RSP boards that +# send data. +# # IMPORTANT !!!!!! BEWARE # # The items in the seperate lines of this file must be seperated by either a SINGLE whitespace or a single tab!!!! # Furthermore, this file is read by PVSS controllers to fill in the database, ANY change could possibly have an impact # on PVSS, so please double check. In case of doubt, contact the PVSS maintainer # -# Reroute to Cobalt, valid from 2013-10-29. -# The Cobalt machines are put behind the BG-x switches, replacing R01. -# # The network configuration is as follows: # -# BG0 -> cbt001 -# BG0 -> cbt002 -# BG1 -> cbt003 -# BG1 -> cbt004 -# BG2 -> cbt005 -# BG2 -> cbt006 -# BG3 -> cbt007 -# BG3 -> cbt008 -# BG2 -> cbt009 - -# CS001 -> BG3 +# RD1 -> cbt001 +# RD1 -> cbt002 +# RD0 -> cbt003 +# RD0 -> cbt004 +# RD0 -> cbt005 +# RD1 -> cbt006 +# RD1 -> cbt007 +# RD0 -> cbt008 +# RD0 -> cbt009 +# RD1 -> cbt010 + CS001 RSP_0 cbt007-10GB01 10.168.102.1 A0:36:9F:1F:79:04 CS001 RSP_1 cbt007-10GB01 10.168.102.1 A0:36:9F:1F:79:04 -# CS002 -> BG1 CS002 RSP_0 cbt003-10GB01 10.168.98.1 A0:36:9F:1F:78:0C CS002 RSP_1 cbt003-10GB01 10.168.98.1 A0:36:9F:1F:78:0C -# CS003 -> BG2 CS003 RSP_0 cbt005-10GB01 10.168.100.1 A0:36:9F:1F:7B:74 CS003 RSP_1 cbt005-10GB01 10.168.100.1 A0:36:9F:1F:7B:74 -# CS004 -> BG3 CS004 RSP_0 cbt008-10GB01 10.168.103.1 A0:36:9F:1F:79:00 CS004 RSP_1 cbt008-10GB01 10.168.103.1 A0:36:9F:1F:79:00 -# CS005 -> BG0 CS005 RSP_0 cbt001-10GB01 10.168.96.1 A0:36:9F:1F:78:A4 CS005 RSP_1 cbt001-10GB01 10.168.96.1 A0:36:9F:1F:78:A4 -# CS006 -> BG1 CS006 RSP_0 cbt004-10GB01 10.168.99.1 A0:36:9F:1F:79:94 CS006 RSP_1 cbt004-10GB01 10.168.99.1 A0:36:9F:1F:79:94 -# CS007 -> BG2 CS007 RSP_0 cbt006-10GB01 10.168.101.1 A0:36:9F:1F:79:A4 CS007 RSP_1 cbt006-10GB01 10.168.101.1 A0:36:9F:1F:79:A4 -# CS011 -> BG1 CS011 RSP_0 cbt003-10GB02 10.168.98.2 A0:36:9F:1F:78:0E CS011 RSP_1 cbt003-10GB02 10.168.98.2 A0:36:9F:1F:78:0E -# CS013 -> BG2 CS013 RSP_0 cbt005-10GB02 10.168.100.2 A0:36:9F:1F:7B:76 CS013 RSP_1 cbt005-10GB02 10.168.100.2 A0:36:9F:1F:7B:76 -# CS017 -> BG0 CS017 RSP_0 cbt002-10GB01 10.168.97.1 A0:36:9F:1F:73:40 CS017 RSP_1 cbt002-10GB01 10.168.97.1 A0:36:9F:1F:73:40 -# CS021 -> BG0 CS021 RSP_0 cbt001-10GB02 10.168.96.2 A0:36:9F:1F:78:A6 CS021 RSP_1 cbt001-10GB02 10.168.96.2 A0:36:9F:1F:78:A6 -# CS024 -> BG3 CS024 RSP_0 cbt007-10GB02 10.168.102.2 A0:36:9F:1F:79:06 CS024 RSP_1 cbt007-10GB02 10.168.102.2 A0:36:9F:1F:79:06 -# CS026 -> BG1 CS026 RSP_0 cbt004-10GB02 10.168.99.2 A0:36:9F:1F:79:96 CS026 RSP_1 cbt004-10GB02 10.168.99.2 A0:36:9F:1F:79:96 -# CS028 -> BG1 CS028 RSP_0 cbt003-10GB03 10.168.98.3 A0:36:9F:1F:7B:40 CS028 RSP_1 cbt003-10GB03 10.168.98.3 A0:36:9F:1F:7B:40 -# CS030 -> BG2 CS030 RSP_0 cbt006-10GB02 10.168.101.2 A0:36:9F:1F:79:A6 CS030 RSP_1 cbt006-10GB02 10.168.101.2 A0:36:9F:1F:79:A6 -# CS031 -> BG1 CS031 RSP_0 cbt004-10GB03 10.168.99.3 A0:36:9F:1F:7A:04 CS031 RSP_1 cbt004-10GB03 10.168.99.3 A0:36:9F:1F:7A:04 -# CS032 -> BG0 CS032 RSP_0 cbt002-10GB02 10.168.97.2 A0:36:9F:1F:73:42 CS032 RSP_1 cbt002-10GB02 10.168.97.2 A0:36:9F:1F:73:42 -# CS101 -> BG0 CS101 RSP_0 cbt001-10GB03 10.168.96.3 A0:36:9F:1F:7B:44 CS101 RSP_1 cbt001-10GB03 10.168.96.3 A0:36:9F:1F:7B:44 -# CS103 -> BG3 CS103 RSP_0 cbt008-10GB02 10.168.103.2 A0:36:9F:1F:79:02 CS103 RSP_1 cbt008-10GB02 10.168.103.2 A0:36:9F:1F:79:02 -# CS201 -> BG1 -CS201 RSP_0 cbt003-10GB02 10.168.98.2 A0:36:9F:1F:78:0E -CS201 RSP_1 cbt003-10GB04 10.168.98.4 A0:36:9F:1F:7B:42 +CS201 RSP_0 cbt003-10GB01 10.168.98.1 A0:36:9F:1F:78:0C +CS201 RSP_1 cbt003-10GB02 10.168.98.2 A0:36:9F:1F:78:0E -# CS301 -> BG2 CS301 RSP_0 cbt005-10GB03 10.168.100.3 A0:36:9F:1F:79:E0 CS301 RSP_1 cbt005-10GB03 10.168.100.3 A0:36:9F:1F:79:E0 -# CS302 -> BG1 CS302 RSP_0 cbt004-10GB01 10.168.99.1 A0:36:9F:1F:79:94 CS302 RSP_1 cbt004-10GB02 10.168.99.2 A0:36:9F:1F:79:96 -# CS401 -> BG3 CS401 RSP_0 cbt007-10GB03 10.168.102.3 A0:36:9F:1F:7B:3C CS401 RSP_1 cbt007-10GB03 10.168.102.3 A0:36:9F:1F:7B:3C -# CS501 -> BG2 CS501 RSP_0 cbt006-10GB03 10.168.101.3 A0:36:9F:1F:7A:34 CS501 RSP_1 cbt006-10GB03 10.168.101.3 A0:36:9F:1F:7A:34 -# RS104 -> BG0 RS104 RSP_0 cbt002-10GB03 10.168.97.3 A0:36:9F:1F:79:A0 -# RS106 -> BG3 RS106 RSP_0 cbt008-10GB03 10.168.103.3 A0:36:9F:1F:7B:68 -# RS205 -> BG3 RS205 RSP_0 cbt007-10GB04 10.168.102.4 A0:36:9F:1F:7B:3E -# RS208 -> BG0 RS208 RSP_0 cbt001-10GB04 10.168.96.4 A0:36:9F:1F:7B:46 -# RS210 -> BG2 RS210 RSP_0 cbt005-10GB03 10.168.100.3 A0:36:9F:1F:79:E0 -# RS305 -> BG2 RS305 RSP_0 cbt006-10GB04 10.168.101.4 A0:36:9F:1F:7A:36 -# RS306 -> BG2 RS306 RSP_0 cbt005-10GB01 10.168.100.1 A0:36:9F:1F:7B:74 -# RS307 -> BG3 RS307 RSP_0 cbt008-10GB01 10.168.103.1 A0:36:9F:1F:79:00 -# RS310 -> BG0 RS310 RSP_0 cbt002-10GB04 10.168.97.4 A0:36:9F:1F:79:A2 -# RS406 -> BG3 RS406 RSP_0 cbt007-10GB03 10.168.102.3 A0:36:9F:1F:7B:3C -# RS407 -> BG0 RS407 RSP_0 cbt001-10GB04 10.168.96.4 A0:36:9F:1F:7B:46 -# RS409 -> BG0 RS409 RSP_0 cbt002-10GB03 10.168.97.3 A0:36:9F:1F:79:A0 -# RS410 -> BG0 RS410 RSP_0 cbt002-10GB04 10.168.97.4 A0:36:9F:1F:79:A2 -# RS503 -> BG2 RS503 RSP_0 cbt006-10GB04 10.168.101.4 A0:36:9F:1F:7A:36 -# RS508 -> BG3 RS508 RSP_0 cbt008-10GB03 10.168.103.3 A0:36:9F:1F:7B:68 -# RS509 -> BG3 RS509 RSP_0 cbt007-10GB04 10.168.102.4 A0:36:9F:1F:7B:3E -# DE601 -> BG3 DE601 RSP_0 cbt008-10GB04 10.211.1.108 A0:36:9F:1F:7B:6A DE601 RSP_0 cbt008-10GB04 10.212.1.108 A0:36:9F:1F:7B:6A DE601 RSP_0 cbt008-10GB04 10.213.1.108 A0:36:9F:1F:7B:6A DE601 RSP_0 cbt008-10GB04 10.214.1.108 A0:36:9F:1F:7B:6A -# DE602 -> BG1 DE602 RSP_0 cbt003-10GB04 10.200.41.103 A0:36:9F:1F:7B:42 -# DE603 -> BG1 DE603 RSP_0 cbt004-10GB04 10.211.1.104 A0:36:9F:1F:7A:06 DE603 RSP_0 cbt004-10GB04 10.212.1.104 A0:36:9F:1F:7A:06 DE603 RSP_0 cbt004-10GB04 10.213.1.104 A0:36:9F:1F:7A:06 DE603 RSP_0 cbt004-10GB04 10.214.1.104 A0:36:9F:1F:7A:06 -# DE604 -> BG1 DE604 RSP_0 cbt003-10GB04 10.200.81.103 A0:36:9F:1F:7B:42 -# DE605 -> BG3 DE605 RSP_0 cbt008-10GB04 10.211.1.108 A0:36:9F:1F:7B:6A DE605 RSP_0 cbt008-10GB04 10.212.1.108 A0:36:9F:1F:7B:6A DE605 RSP_0 cbt008-10GB04 10.213.1.108 A0:36:9F:1F:7B:6A DE605 RSP_0 cbt008-10GB04 10.214.1.108 A0:36:9F:1F:7B:6A -# FR606 -> BG2 FR606 RSP_0 cbt005-10GB04 10.211.1.105 A0:36:9F:1F:79:E2 FR606 RSP_0 cbt005-10GB04 10.212.1.105 A0:36:9F:1F:79:E2 FR606 RSP_0 cbt005-10GB04 10.213.1.105 A0:36:9F:1F:79:E2 FR606 RSP_0 cbt005-10GB04 10.214.1.105 A0:36:9F:1F:79:E2 -# SE607 -> BG2 SE607 RSP_0 cbt004-10GB04 10.211.1.104 A0:36:9F:1F:7A:06 SE607 RSP_0 cbt004-10GB04 10.212.1.104 A0:36:9F:1F:7A:06 SE607 RSP_0 cbt004-10GB04 10.213.1.104 A0:36:9F:1F:7A:06 SE607 RSP_0 cbt004-10GB04 10.214.1.104 A0:36:9F:1F:7A:06 -# UK608 -> BG2 UK608 RSP_0 cbt005-10GB04 10.211.1.105 A0:36:9F:1F:79:E2 UK608 RSP_0 cbt005-10GB04 10.212.1.105 A0:36:9F:1F:79:E2 UK608 RSP_0 cbt005-10GB04 10.213.1.105 A0:36:9F:1F:79:E2 UK608 RSP_0 cbt005-10GB04 10.214.1.105 A0:36:9F:1F:79:E2 -# DE609 -> BG2 DE609 RSP_0 cbt008-10GB04 10.200.91.108 A0:36:9F:1F:7B:6A DE609 RSP_0 cbt008-10GB04 10.200.92.108 A0:36:9F:1F:7B:6A + +PL610 RSP_0 cbt003-10GB04 10.211.1.103 A0:36:9F:1F:7B:42 +PL610 RSP_0 cbt003-10GB04 10.212.1.103 A0:36:9F:1F:7B:42 +PL610 RSP_0 cbt003-10GB04 10.213.1.103 A0:36:9F:1F:7B:42 +PL610 RSP_0 cbt003-10GB04 10.214.1.103 A0:36:9F:1F:7B:42 + +PL611 RSP_0 cbt004-10GB04 10.211.1.104 A0:36:9F:1F:7A:06 +PL611 RSP_0 cbt004-10GB04 10.212.1.104 A0:36:9F:1F:7A:06 +PL611 RSP_0 cbt004-10GB04 10.213.1.104 A0:36:9F:1F:7A:06 +PL611 RSP_0 cbt004-10GB04 10.214.1.104 A0:36:9F:1F:7A:06 + +PL612 RSP_0 cbt005-10GB04 10.211.1.105 A0:36:9F:1F:79:E2 +PL612 RSP_0 cbt005-10GB04 10.212.1.105 A0:36:9F:1F:79:E2 +PL612 RSP_0 cbt005-10GB04 10.213.1.105 A0:36:9F:1F:79:E2 +PL612 RSP_0 cbt005-10GB04 10.214.1.105 A0:36:9F:1F:79:E2 diff --git a/MAC/Tools/Power/poweruphba.sh b/MAC/Tools/Power/poweruphba.sh index 02054bad3abf9abfa8465c18fc888fb5cd51c14f..1852b2b6dee00e5daa78492b68fdbb5f4581665e 100755 --- a/MAC/Tools/Power/poweruphba.sh +++ b/MAC/Tools/Power/poweruphba.sh @@ -1,63 +1,154 @@ #!/bin/bash # -# V3.1, M.J.Norden, 17-11-2015 -# usage: ./poweruphba.sh 5 (or 6 or 7) -# Power up of the HBA Tiles needs to be slowed down because of high rush-in current. +# V4.0, A.P. Schoenmakers, 07-01-2016 + +# usage: poweruphba.sh RCUMODE (5, 6 or 7) or +# poweruphba.sh [-a] -m RCUMODE (5, 6, or 7) +# +# Power up of the HBA Tiles. # for rcumode 6 you need to switch the clock seperately (rspctl --clock=160) # from MAC version V2_12 and higher you can directly switch between rcumodes # The setting of hbadelays with 253 is needed for the new HBA-FE that are default off # # - automatic clock switch when needed -# - automatic disble broken tiles from PVSS database +# - optionally automatic disble broken tiles from PVSS database +SyntaxError() +{ + Msg=$1 -clock=`rspctl --clock 2>&1|grep "Sample frequency"|sed -e 's/.*clock=\(...\)MHz/\1/'` + [ -z "${Msg}" ] || echo "ERROR: ${Msg}" + echo "" + echo "Syntax: $(basename $0) [-a] [-m RCU mode] or $(basename $0) [RCU mode]" + echo "-a: Power up all RCUs, do not check broken tile info" + echo "-m: RCU mode to use (5,6 or 7)" + echo "" + echo "If only one argument provided, that is interpreted as the requested RCU mode." + echo "No check for broken tile info will occur then." + echo "" + exit 0 +} + +HandleArgs() +{ + # Handle arguments + if [ "$#" -eq 0 ]; then + SyntaxError + fi + + while getopts "am:" flag + do + case "$flag" in + a) + checkbroken=0 + ;; + m) + hbamode=$OPTARG + ;; + h) + SyntaxError + ;; + *) + SyntaxError + ;; + esac + done +} + +# --- MAIN --- -if [ "$1" != "" ]; then - if [ $1 -lt 5 ]; then - echo -e "Usage: ./poweruphba.sh 5 (or 6 or 7)\n" - exit - elif [ $1 -gt 7 ]; then - echo -e "Usage: ./poweruphba.sh 5 (or 6 or 7)\n" - exit - else - if [ $clock = "160" ]; then - echo "wait 30 seconds for 200MHz clock switch" - rspctl --clock=200 - sleep 30 - fi - hbamode=$1 - fi +# first check if swlevel < 6, otherwise this script will not funstion properly +level=`swlevel -S` + +if [ $level -lt 2 -o $level -gt 5 ]; then + echo "First set swlevel between 2 and 5 (current is $level)" + exit 0 +fi + +#Initialize parameters +checkbroken=1 +hbamode=0 + +if [ "$#" -eq 1 ]; then + hbamode=$1 + checkbroken=0 else - echo -e "Usage: ./poweruphba.sh 5 (or 6 or 7)\n" - exit + HandleArgs $* +fi + + +if [ $hbamode -lt 5 -o $hbamode -gt 7 ]; then + echo "RCUMode must be 5,6, or 7" + exit 0 fi -if [ $hbamode -eq 6 ]; then - if [ $clock = "200" ]; then - echo "wait 30 seconds for 160MHz clock switch" - rspctl --clock=160 - sleep 30 - fi -fi +# Find current clock setting +clock=`rspctl --clock 2>&1|grep "Sample frequency"|sed -e 's/.*clock=\(...\)MHz/\1/'` + +# Set clock to proper value +if [ $hbamode -eq 6 ]; then + if [ "$clock" == "200" ]; then + echo "wait 30 seconds for 160MHz clock switch" + rspctl --clock=160 + sleep 30 + fi +else + if [ "$clock" == "160" ]; then + echo "wait 30 seconds for 200MHz clock switch" + rspctl --clock=200 + sleep 30 + fi +fi + +# Set selected mode and switch on HBAs rspctl --rcumode=$hbamode sleep 1 rspctl --rcuenable=1 sleep 1 -DISABLED_RCU_LIST=`/opt/lofar/sbin/disabledRCUlist $hbamode 2</dev/null` -if test "$DISABLED_RCU_LIST" == ""; then - echo "no disabled HBA tiles" +# Determine broken tiles. On International stations in local mode we need to read a file +# called /localhome/stationtest/DISABLED/disabled-mode5.txt +# For NL stations and international stations in ILT mode we can query PVSS + +DISABLED_RCU_LIST="" +if [ $checkbroken -eq 1 ]; then + mode=`stationswitch -s` + if [[ $mode =~ ilt ]]; then + if [ -e /opt/lofar/sbin/disabledRCUlist ]; then + DISABLED_RCU_LIST=`/opt/lofar/sbin/disabledRCUlist $hbamode 2</dev/null` + else + echo "Cannot determine broken RCUs; missing /opt/lofar/sbin/disabledRCUlist" + fi + else + if [ -e /localhome/stationtest/DISABLED/disabled-mode5.txt ]; then + DISABLED_RCU_LIST=`cat /localhome/stationtest/DISABLED/disabled-mode5.txt` + else + echo "Cannot determine broken RCUs; missing file /localhome/stationtest/DISABLED/disabled-mode5.txt" + fi + fi +fi + +# Switch off broken tiles (if any) +if [ "$DISABLED_RCU_LIST" == "" ]; then + echo "Using all available RCUs" else - rspctl --rcumode=0 --sel=$DISABLED_RCU_LIST + echo "List of disabled RCUs: "$DISABLED_RCU_LIST + rspctl --rcumode=0 --select=$DISABLED_RCU_LIST sleep 1 rspctl --rcuenable=0 --select=$DISABLED_RCU_LIST sleep 1 fi + +# Set delay values rspctl --hbadelays=253,253,253,253,253,253,253,253,253,253,253,253,253,253,253,253 +sleep 1 +# Set spectral Inversion properly if [ $hbamode -eq 5 ]; then rspctl --specinv=1 else rspctl --specinv=0 fi +sleep 1 + +echo "Done" diff --git a/RTCP/Cobalt/GPUProc/etc/parset-additions.d/default/StationStreams.parset b/RTCP/Cobalt/GPUProc/etc/parset-additions.d/default/StationStreams.parset index e1f86d069fc8cca339bb9df01f4a225534a28468..cdc1ca47a9514cc167bd071aa31ed415c6d130cd 100644 --- a/RTCP/Cobalt/GPUProc/etc/parset-additions.d/default/StationStreams.parset +++ b/RTCP/Cobalt/GPUProc/etc/parset-additions.d/default/StationStreams.parset @@ -151,13 +151,13 @@ PIC.Core.CS103HBA1.RSP.ports = [udp:cbt008-10GB02:11036, udp:cbt008-10GB02:11 PIC.Core.CS103HBA1.RSP.receiver = cbt008_0 PIC.Core.CS103LBA.RSP.ports = [udp:cbt008-10GB02:11030, udp:cbt008-10GB02:11031, udp:cbt008-10GB02:11032, udp:cbt008-10GB02:11033] PIC.Core.CS103LBA.RSP.receiver = cbt008_0 -PIC.Core.CS201HBA.RSP.ports = [udp:cbt003-10GB02:12010, udp:cbt003-10GB02:12011, udp:cbt003-10GB02:12012, udp:cbt003-10GB02:12013] +PIC.Core.CS201HBA.RSP.ports = [udp:cbt003-10GB01:12010, udp:cbt003-10GB01:12011, udp:cbt003-10GB01:12012, udp:cbt003-10GB01:12013] PIC.Core.CS201HBA.RSP.receiver = cbt003_0 -PIC.Core.CS201HBA0.RSP.ports = [udp:cbt003-10GB02:12010, udp:cbt003-10GB02:12011, udp:cbt003-10GB02:12012, udp:cbt003-10GB02:12013] +PIC.Core.CS201HBA0.RSP.ports = [udp:cbt003-10GB01:12010, udp:cbt003-10GB01:12011, udp:cbt003-10GB01:12012, udp:cbt003-10GB01:12013] PIC.Core.CS201HBA0.RSP.receiver = cbt003_0 -PIC.Core.CS201HBA1.RSP.ports = [udp:cbt003-10GB04:12016, udp:cbt003-10GB04:12017, udp:cbt003-10GB04:12018, udp:cbt003-10GB04:12019] -PIC.Core.CS201HBA1.RSP.receiver = cbt003_1 -PIC.Core.CS201LBA.RSP.ports = [udp:cbt003-10GB02:12010, udp:cbt003-10GB02:12011, udp:cbt003-10GB02:12012, udp:cbt003-10GB02:12013] +PIC.Core.CS201HBA1.RSP.ports = [udp:cbt003-10GB02:12016, udp:cbt003-10GB02:12017, udp:cbt003-10GB02:12018, udp:cbt003-10GB02:12019] +PIC.Core.CS201HBA1.RSP.receiver = cbt003_0 +PIC.Core.CS201LBA.RSP.ports = [udp:cbt003-10GB01:12010, udp:cbt003-10GB01:12011, udp:cbt003-10GB01:12012, udp:cbt003-10GB01:12013] PIC.Core.CS201LBA.RSP.receiver = cbt003_0 PIC.Core.CS301HBA.RSP.ports = [udp:cbt005-10GB03:13010, udp:cbt005-10GB03:13011, udp:cbt005-10GB03:13012, udp:cbt005-10GB03:13013] PIC.Core.CS301HBA.RSP.receiver = cbt005_1 @@ -219,6 +219,18 @@ PIC.Core.FR606HBA.RSP.ports = [udp:10.211.1.105:16060, udp:10.212.1.105:1606 PIC.Core.FR606HBA.RSP.receiver = cbt005_1 PIC.Core.FR606LBA.RSP.ports = [udp:10.211.1.105:16060, udp:10.212.1.105:16061, udp:10.213.1.105:16062, udp:10.214.1.105:16063] PIC.Core.FR606LBA.RSP.receiver = cbt005_1 +PIC.Core.PL610HBA.RSP.ports = [udp:10.211.1.103:16100, udp:10.212.1.103:16101, udp:10.213.1.103:16102, udp:10.214.1.103:16103] +PIC.Core.PL610HBA.RSP.receiver = cbt003_1 +PIC.Core.PL610LBA.RSP.ports = [udp:10.211.1.103:16100, udp:10.212.1.103:16101, udp:10.213.1.103:16102, udp:10.214.1.103:16103] +PIC.Core.PL610LBA.RSP.receiver = cbt003_1 +PIC.Core.PL611HBA.RSP.ports = [udp:10.211.1.104:16110, udp:10.212.1.104:16111, udp:10.213.1.104:16112, udp:10.214.1.104:16113] +PIC.Core.PL611HBA.RSP.receiver = cbt004_1 +PIC.Core.PL611LBA.RSP.ports = [udp:10.211.1.104:16110, udp:10.212.1.104:16111, udp:10.213.1.104:16112, udp:10.214.1.104:16113] +PIC.Core.PL611LBA.RSP.receiver = cbt004_1 +PIC.Core.PL612HBA.RSP.ports = [udp:10.211.1.105:16120, udp:10.212.1.105:16121, udp:10.213.1.105:16122, udp:10.214.1.105:16123] +PIC.Core.PL612HBA.RSP.receiver = cbt005_1 +PIC.Core.PL612LBA.RSP.ports = [udp:10.211.1.105:16120, udp:10.212.1.105:16121, udp:10.213.1.105:16122, udp:10.214.1.105:16123] +PIC.Core.PL612LBA.RSP.receiver = cbt005_1 PIC.Core.RS104HBA.RSP.ports = [udp:cbt002-10GB03:11040, udp:cbt002-10GB03:11041, udp:cbt002-10GB03:11042, udp:cbt002-10GB03:11043] PIC.Core.RS104HBA.RSP.receiver = cbt002_1 PIC.Core.RS104LBA.RSP.ports = [udp:cbt002-10GB03:11040, udp:cbt002-10GB03:11041, udp:cbt002-10GB03:11042, udp:cbt002-10GB03:11043] diff --git a/SAS/OTDB_Services/CMakeLists.txt b/SAS/OTDB_Services/CMakeLists.txt index 4c6ee650e826b7185f0c7b77ef3b3fe18a777ee5..f6c6b22d26992ab5ebd37de7aba1a431905536ce 100644 --- a/SAS/OTDB_Services/CMakeLists.txt +++ b/SAS/OTDB_Services/CMakeLists.txt @@ -1,6 +1,6 @@ # $Id$ -#lofar_package(OTDB_Services 1.0 DEPENDS PyMessaging OTDB) +lofar_package(OTDB_Services 1.0 DEPENDS PyMessaging) include(PythonInstall) @@ -9,6 +9,13 @@ lofar_add_bin_scripts( TreeStatusEvents.py ) +# supervisord config files +install(FILES + TreeService.ini + TreeStatusEvents.ini + OTDB_Services.ini + DESTINATION etc/supervisord.d) + add_subdirectory(test) diff --git a/SAS/OTDB_Services/OTDB_Services.ini b/SAS/OTDB_Services/OTDB_Services.ini new file mode 100644 index 0000000000000000000000000000000000000000..534b024993e59f38311576b366f9eba20f05a2de --- /dev/null +++ b/SAS/OTDB_Services/OTDB_Services.ini @@ -0,0 +1,3 @@ +[group:OTDB_Services] +programs=TreeService,TreeStatusEvents +priority=100 diff --git a/SAS/OTDB_Services/TreeService.ini b/SAS/OTDB_Services/TreeService.ini new file mode 100644 index 0000000000000000000000000000000000000000..a116e6494e582c2424c7bab6e106cdacb5de94a0 --- /dev/null +++ b/SAS/OTDB_Services/TreeService.ini @@ -0,0 +1,6 @@ +[program:TreeService] +command=/bin/bash -c 'source $LOFARROOT/lofarinit.sh;TreeService.py --hostname=sasdb --database=LOFAR_4' +user=lofarsys +stopsignal=INT ; KeyboardInterrupt +stdout_logfile=%{program_name)s.stdout +stderr_logfile=%{program_name)s.stderr diff --git a/SAS/OTDB_Services/TreeStatusEvents.ini b/SAS/OTDB_Services/TreeStatusEvents.ini new file mode 100644 index 0000000000000000000000000000000000000000..3eb140b7361ef6dba04d87a0f3651cfb33d3196b --- /dev/null +++ b/SAS/OTDB_Services/TreeStatusEvents.ini @@ -0,0 +1,6 @@ +[program:TreeStatusEvents] +command=/bin/bash -c 'source $LOFARROOT/lofarinit.sh;TreeStatusEvents.py --hostname=sasdb --database=LOFAR_4 --busname lofar.otdb.status' +user=lofarsys +stopsignal=INT ; KeyboardInterrupt +stdout_logfile=%{program_name)s.stdout +stderr_logfile=%{program_name)s.stderr diff --git a/SAS/OTDB_Services/test/CMakeLists.txt b/SAS/OTDB_Services/test/CMakeLists.txt index f5796145f0c26c0dfdf4d61b0b7efa3ab4f7f524..d520d61ca2a532fb0478e8466005be958498a0a7 100644 --- a/SAS/OTDB_Services/test/CMakeLists.txt +++ b/SAS/OTDB_Services/test/CMakeLists.txt @@ -2,6 +2,8 @@ include(LofarCTest) +lofar_find_package(Python REQUIRED) + lofar_add_test(t_TreeService) lofar_add_test(t_TreeStatusEvents)