From 263e1111d8607b8ddf0cebc1f0b0ad6c1b84c92d Mon Sep 17 00:00:00 2001 From: Jan David Mol <mol@astron.nl> Date: Tue, 7 Oct 2014 09:43:16 +0000 Subject: [PATCH] Task #5892: Refactoring: replaced a few Parset functions by direct calls to the settings struct. --- RTCP/Cobalt/CoInterface/src/Parset.cc | 64 +------------------ RTCP/Cobalt/CoInterface/src/Parset.h | 22 ------- RTCP/Cobalt/CoInterface/src/TABTranspose.cc | 7 +- RTCP/Cobalt/CoInterface/test/tParset.cc | 8 --- .../CobaltTest/test/tManyPartTABOutput.cc | 2 +- .../CobaltTest/test/tMultiPartTABOutput.cc | 2 +- .../GPUProc/share/gpu/kernels/Correlator.cu | 2 + .../GPUProc/src/Station/StationInput.cc | 10 +-- .../src/cuda/Kernels/BeamFormerKernel.cc | 2 +- .../cuda/Kernels/BeamFormerTransposeKernel.cc | 2 +- .../GPUProc/src/cuda/Pipelines/Pipeline.cc | 4 +- RTCP/Cobalt/GPUProc/src/rtcp.cc | 10 +-- .../test/Kernels/tBandPassCorrectionKernel.cc | 2 +- .../Kernels/tBandPassCorrectionKernel2.cc | 2 +- .../GPUProc/test/Kernels/tFIR_FilterKernel.cc | 6 +- .../tCorrelatorPipelineProcessObs.cc | 2 +- ...entStokesBeamFormerSubbandProcProcessSb.cc | 6 +- .../tCorrelatorSubbandProcProcessSb.cc | 6 +- .../tFlysEyeBeamFormerSubbandProcProcessSb.cc | 4 +- RTCP/Cobalt/GPUProc/test/tMPIReceive.cc | 6 +- RTCP/Cobalt/GPUProc/test/tStationInput.cc | 2 +- RTCP/Cobalt/InputProc/src/Delays/Delays.cc | 2 +- .../InputProc/src/Delays/printDelays.cc | 2 +- RTCP/Cobalt/OutputProc/src/GPUProcIO.cc | 2 +- RTCP/Cobalt/OutputProc/src/MSWriterDAL.cc | 6 +- .../OutputProc/src/MeasurementSetFormat.cc | 10 +-- RTCP/Cobalt/OutputProc/src/OutputThread.cc | 8 +-- 27 files changed, 54 insertions(+), 147 deletions(-) diff --git a/RTCP/Cobalt/CoInterface/src/Parset.cc b/RTCP/Cobalt/CoInterface/src/Parset.cc index 75b1bef9902..8bbcfbb7538 100644 --- a/RTCP/Cobalt/CoInterface/src/Parset.cc +++ b/RTCP/Cobalt/CoInterface/src/Parset.cc @@ -951,12 +951,8 @@ namespace LOFAR return nrPolarisations * nrPolarisations; } - size_t ObservationSettings::nrSamplesPerSubband() const { - return blockSize; - } - double ObservationSettings::blockDuration() const { - return nrSamplesPerSubband() * sampleDuration(); + return blockSize * sampleDuration(); } vector<unsigned> ObservationSettings::SAP::subbandIndices() const { @@ -1074,12 +1070,6 @@ namespace LOFAR } - bool Parset::correctClocks() const - { - return settings.corrections.clock; - } - - std::string Parset::getHostName(OutputType outputType, unsigned streamNr) const { if (outputType == CORRELATED_DATA) @@ -1134,12 +1124,6 @@ namespace LOFAR } - unsigned Parset::nrBeams() const - { - return settings.SAPs.size(); - } - - std::vector<double> Parset::centroidPos(const std::string &stations) const { std::vector<double> Centroid, posList, pos; @@ -1297,31 +1281,11 @@ namespace LOFAR } } - unsigned Parset::nrSamplesPerSubband() const - { - return settings.nrSamplesPerSubband(); - } - - size_t Parset::nrSubbands() const - { - return settings.subbands.size(); - } - - bool Parset::delayCompensation() const - { - return settings.delayCompensation.enabled; - } - string Parset::positionType() const { return "ITRF"; } - bool Parset::correctBandPass() const - { - return settings.corrections.bandPass; - } - double Parset::channel0Frequency(size_t subband, size_t nrChannels) const { const double sbFreq = settings.subbands[subband].centralFrequency; @@ -1335,35 +1299,9 @@ namespace LOFAR return sbFreq - 0.5 * settings.subbandWidth(); } - bool Parset::realTime() const - { - return settings.realTime; - } - - string Parset::bandFilter() const - { - return settings.bandFilter; - } - - string Parset::antennaSet() const - { - return settings.antennaSet; - } - string Parset::PVSS_TempObsName() const { return getString("_DPname", "LOFAR_ObsSW_TempObs_Unk"); } - - - size_t ObservationSettings::BeamFormer::SAP::nrCoherentTAB() const - { - return nrCoherent; - } - - size_t ObservationSettings::BeamFormer::SAP::nrIncoherentTAB() const - { - return nrIncoherent; - } } // namespace Cobalt } // namespace LOFAR diff --git a/RTCP/Cobalt/CoInterface/src/Parset.h b/RTCP/Cobalt/CoInterface/src/Parset.h index 79a969be7c4..781c9c33486 100644 --- a/RTCP/Cobalt/CoInterface/src/Parset.h +++ b/RTCP/Cobalt/CoInterface/src/Parset.h @@ -106,9 +106,6 @@ namespace LOFAR size_t nrBlocks() const; - // Alias for blockSize - size_t nrSamplesPerSubband() const; - // The number of seconds represented by each block. double blockDuration() const; @@ -529,12 +526,6 @@ namespace LOFAR // size: Observation.Beam[sap].nrTiedArrayBeams std::vector<struct TAB> TABs; - // Return the number of coherentstokes tabs, - size_t nrCoherentTAB() const; - - // Return the number of incoherentstokes tabs - size_t nrIncoherentTAB() const; - // calculated at construction time size_t nrCoherent; size_t nrIncoherent; @@ -683,10 +674,6 @@ namespace LOFAR std::string positionType() const; unsigned dedispersionFFTsize() const; - unsigned nrSamplesPerSubband() const; - bool delayCompensation() const; - bool correctClocks() const; - bool correctBandPass() const; std::vector<std::string> allStationNames() const; bool outputThisType(OutputType) const; @@ -696,17 +683,8 @@ namespace LOFAR std::string getFileName(OutputType, unsigned streamNr) const; std::string getDirectoryName(OutputType, unsigned streamNr) const; - std::string bandFilter() const; - std::string antennaSet() const; - - unsigned nrBeams() const; - - size_t nrSubbands() const; - double channel0Frequency( size_t subband, size_t nrChannels ) const; - bool realTime() const; - std::vector<double> itsStPositions; std::string PVSS_TempObsName() const; diff --git a/RTCP/Cobalt/CoInterface/src/TABTranspose.cc b/RTCP/Cobalt/CoInterface/src/TABTranspose.cc index 64d182e4f62..0c4b21fd3f0 100644 --- a/RTCP/Cobalt/CoInterface/src/TABTranspose.cc +++ b/RTCP/Cobalt/CoInterface/src/TABTranspose.cc @@ -612,7 +612,7 @@ MultiSender::MultiSender( const HostMap &hostMap, const Parset &parset, MultiSender::~MultiSender() { - LOG_INFO_STR("MultiSender: realTime = " << itsParset.realTime() << ", maxRetentionTime = " << maxRetentionTime); + LOG_INFO_STR("MultiSender: realTime = " << itsParset.settings.realTime << ", maxRetentionTime = " << maxRetentionTime); for (HostMap::const_iterator i = hostMap.begin(); i != hostMap.end(); ++i) { LOG_INFO_STR("MultiSender: [file " << i->first << " to " << i->second.hostName << "] Dropped " << drop_rates.at(i->first).mean() << "% of the data"); } @@ -676,13 +676,10 @@ bool MultiSender::append( SmartPtr<struct Subband> &subband ) SmartPtr< Queue< SmartPtr<struct Subband> > > &queue = queues.at(host); - const size_t globalSubbandIdx = subband->id.subband + - itsParset.settings.beamFormer.files[fileIdx].firstSubbandIdx; - bool dropped = false; // If oldest packet in queue is too old, drop it in lieu of this new one - if (itsParset.realTime() && TimeSpec::now() - queue->oldest() > maxRetentionTime) { + if (itsParset.settings.realTime && TimeSpec::now() - queue->oldest() > maxRetentionTime) { drop_rates.at(fileIdx).push(100.0); // remove oldest item diff --git a/RTCP/Cobalt/CoInterface/test/tParset.cc b/RTCP/Cobalt/CoInterface/test/tParset.cc index 2fe63414500..d2034252547 100644 --- a/RTCP/Cobalt/CoInterface/test/tParset.cc +++ b/RTCP/Cobalt/CoInterface/test/tParset.cc @@ -87,7 +87,6 @@ TEST(realTime) { Parset ps = makeDefaultTestParset("Cobalt.realTime", valstr); CHECK_EQUAL(val, ps.settings.realTime); - CHECK_EQUAL(val, ps.realTime()); } } @@ -173,7 +172,6 @@ SUITE(corrections) { Parset ps = makeDefaultTestParset("Cobalt.correctBandPass", valstr); CHECK_EQUAL(val, ps.settings.corrections.bandPass); - CHECK_EQUAL(val, ps.correctBandPass()); } } @@ -182,7 +180,6 @@ SUITE(corrections) { Parset ps = makeDefaultTestParset("Cobalt.correctClocks", valstr); CHECK_EQUAL(val, ps.settings.corrections.clock); - CHECK_EQUAL(val, ps.correctClocks()); } } @@ -201,7 +198,6 @@ SUITE(delayCompensation) { Parset ps = makeDefaultTestParset("Cobalt.delayCompensation", valstr); CHECK_EQUAL(val, ps.settings.delayCompensation.enabled); - CHECK_EQUAL(val, ps.delayCompensation()); } } @@ -230,7 +226,6 @@ TEST(antennaSetLBA) { ps.replace("Observation.bandFilter", "LBA_30_70"); CHECK_EQUAL(*i, ps.settings.antennaSet); - CHECK_EQUAL(*i, ps.antennaSet()); } } @@ -250,7 +245,6 @@ TEST(antennaSetHBA) { ps.replace("Observation.bandFilter", "HBA_110_190"); CHECK_EQUAL(*i, ps.settings.antennaSet); - CHECK_EQUAL(*i, ps.antennaSet()); } } @@ -267,8 +261,6 @@ TEST(bandFilter) { Parset ps = makeDefaultTestParset("Observation.bandFilter", i->first); CHECK_EQUAL(i->first, ps.settings.bandFilter); - CHECK_EQUAL(i->first, ps.bandFilter()); - CHECK_EQUAL(i->second, ps.settings.nyquistZone()); } } diff --git a/RTCP/Cobalt/CobaltTest/test/tManyPartTABOutput.cc b/RTCP/Cobalt/CobaltTest/test/tManyPartTABOutput.cc index 150d4f7abfc..2559b79747c 100644 --- a/RTCP/Cobalt/CobaltTest/test/tManyPartTABOutput.cc +++ b/RTCP/Cobalt/CobaltTest/test/tManyPartTABOutput.cc @@ -79,7 +79,7 @@ int main() vector<gpu::Device> devices = gpu::Platform().devices(); gpu::Context ctx(devices[0]); - const unsigned nrSubbands = ps.nrSubbands(); + const unsigned nrSubbands = ps.settings.subbands.size(); // Create BF Pipeline. We're the only rank: do all the subbands. // So for the rest of the test code globalSubbandIdx equals localSubbandIdx. diff --git a/RTCP/Cobalt/CobaltTest/test/tMultiPartTABOutput.cc b/RTCP/Cobalt/CobaltTest/test/tMultiPartTABOutput.cc index 07db72cd8dd..21d6d417017 100644 --- a/RTCP/Cobalt/CobaltTest/test/tMultiPartTABOutput.cc +++ b/RTCP/Cobalt/CobaltTest/test/tMultiPartTABOutput.cc @@ -79,7 +79,7 @@ int main() vector<gpu::Device> devices = gpu::Platform().devices(); gpu::Context ctx(devices[0]); - const unsigned nrSubbands = ps.nrSubbands(); + const unsigned nrSubbands = ps.settings.subbands.size(); // Create BF Pipeline. We're the only rank: do all the subbands. // So for the rest of the test code globalSubbandIdx equals localSubbandIdx. diff --git a/RTCP/Cobalt/GPUProc/share/gpu/kernels/Correlator.cu b/RTCP/Cobalt/GPUProc/share/gpu/kernels/Correlator.cu index 83d95f27727..cee57f32213 100644 --- a/RTCP/Cobalt/GPUProc/share/gpu/kernels/Correlator.cu +++ b/RTCP/Cobalt/GPUProc/share/gpu/kernels/Correlator.cu @@ -38,6 +38,8 @@ # define BLOCK_SIZE 16 #endif +// TODO: Asssert NR_SAMPLES_PER_INTEGRATION % BLOCK_SIZE == 0 + typedef float2 fcomplex; typedef float4 fcomplex2; diff --git a/RTCP/Cobalt/GPUProc/src/Station/StationInput.cc b/RTCP/Cobalt/GPUProc/src/Station/StationInput.cc index ccbf19dd686..46d071c4979 100644 --- a/RTCP/Cobalt/GPUProc/src/Station/StationInput.cc +++ b/RTCP/Cobalt/GPUProc/src/Station/StationInput.cc @@ -196,7 +196,7 @@ namespace LOFAR { for(size_t n = 0; n < result.num_elements(); ++n) result.origin()[n] = -1; - for(size_t i = 0; i < ps.nrSubbands(); ++i) { + for(size_t i = 0; i < targetSubbands.size(); ++i) { // The subband stored at position i const size_t sb = targetSubbands.at(i); @@ -512,7 +512,7 @@ namespace LOFAR { { OMPThreadSet packetReaderThreads; - if (ps.realTime()) { + if (ps.settings.realTime) { // Each board has its own pool to reduce lock contention for (size_t board = 0; board < nrBoards; ++board) for (size_t i = 0; i < 16; ++i) @@ -541,7 +541,7 @@ namespace LOFAR { { LOG_INFO_STR(logPrefix << "Processing packets"); - if (ps.realTime()) { + if (ps.settings.realTime) { #pragma omp parallel for num_threads(nrBoards) for(size_t board = 0; board < nrBoards; board++) { OMPThreadSet::ScopedRun sr(packetReaderThreads); @@ -575,7 +575,7 @@ namespace LOFAR { while((current = next ? next : inputQueue.remove()) != NULL) { next = inputQueue.remove(); - if (ps.realTime()) { + if (ps.settings.realTime) { writeRSPRealTime<SampleT>(*current, next); } else { writeRSPNonRealTime<SampleT>(*current, next); @@ -598,7 +598,7 @@ namespace LOFAR { for (size_t i = 0; i < nrBoards; ++i) rspDataPool[i]->free.prepend(NULL); - if (ps.realTime()) { + if (ps.settings.realTime) { // kill reader threads LOG_INFO_STR( logPrefix << "Stopping all boards" ); packetReaderThreads.killAll(); diff --git a/RTCP/Cobalt/GPUProc/src/cuda/Kernels/BeamFormerKernel.cc b/RTCP/Cobalt/GPUProc/src/cuda/Kernels/BeamFormerKernel.cc index bd126690aae..78887b2bf85 100644 --- a/RTCP/Cobalt/GPUProc/src/cuda/Kernels/BeamFormerKernel.cc +++ b/RTCP/Cobalt/GPUProc/src/cuda/Kernels/BeamFormerKernel.cc @@ -49,7 +49,7 @@ namespace LOFAR nrStations(ps.settings.antennaFields.size()), nrChannels(ps.settings.beamFormer.nrHighResolutionChannels), - nrSamplesPerChannel(ps.nrSamplesPerSubband() / nrChannels), + nrSamplesPerChannel(ps.settings.blockSize / nrChannels), nrSAPs(ps.settings.beamFormer.SAPs.size()), nrTABs(ps.settings.beamFormer.maxNrCoherentTABsPerSAP()), diff --git a/RTCP/Cobalt/GPUProc/src/cuda/Kernels/BeamFormerTransposeKernel.cc b/RTCP/Cobalt/GPUProc/src/cuda/Kernels/BeamFormerTransposeKernel.cc index b982e178a90..fff5f02513c 100644 --- a/RTCP/Cobalt/GPUProc/src/cuda/Kernels/BeamFormerTransposeKernel.cc +++ b/RTCP/Cobalt/GPUProc/src/cuda/Kernels/BeamFormerTransposeKernel.cc @@ -47,7 +47,7 @@ namespace LOFAR BeamFormerTransposeKernel::Parameters::Parameters(const Parset& ps) : Kernel::Parameters("beamFormerTranspose"), nrChannels(ps.settings.beamFormer.nrHighResolutionChannels), - nrSamplesPerChannel(ps.nrSamplesPerSubband() / nrChannels), + nrSamplesPerChannel(ps.settings.blockSize / nrChannels), nrTABs(ps.settings.beamFormer.maxNrCoherentTABsPerSAP()) { dumpBuffers = diff --git a/RTCP/Cobalt/GPUProc/src/cuda/Pipelines/Pipeline.cc b/RTCP/Cobalt/GPUProc/src/cuda/Pipelines/Pipeline.cc index 39753f1c91d..46feaa62094 100644 --- a/RTCP/Cobalt/GPUProc/src/cuda/Pipelines/Pipeline.cc +++ b/RTCP/Cobalt/GPUProc/src/cuda/Pipelines/Pipeline.cc @@ -284,7 +284,7 @@ namespace LOFAR // Wait for data to propagate towards outputProc, // and kill lingering outputThreads. - if (ps.realTime()) { + if (ps.settings.realTime) { struct timespec deadline = TimeSpec::now(); TimeSpec::inc(deadline, outputFlushTimeout); @@ -698,7 +698,7 @@ namespace LOFAR forwardTimer.stop(); // If `subband' is still alive, it has been dropped instead of sent. - ASSERT(ps.realTime() || !subband); + ASSERT(ps.settings.realTime || !subband); } } diff --git a/RTCP/Cobalt/GPUProc/src/rtcp.cc b/RTCP/Cobalt/GPUProc/src/rtcp.cc index a2f3d5d8b65..b1e23790d87 100644 --- a/RTCP/Cobalt/GPUProc/src/rtcp.cc +++ b/RTCP/Cobalt/GPUProc/src/rtcp.cc @@ -237,7 +237,7 @@ int main(int argc, char **argv) "\n outputProcTimeout : " << outputProcTimeout << "s" << "\n rtcpTimeout : " << rtcpTimeout << "s"); - if (ps.realTime() && getenv("COBALT_NO_ALARM") == NULL) { + if (ps.settings.realTime && getenv("COBALT_NO_ALARM") == NULL) { // First of all, make sure we can't freeze for too long // by scheduling an alarm() some time after the observation // ends. @@ -284,7 +284,7 @@ int main(int argc, char **argv) if (mpi.rank() == 0) { LOG_INFO_STR("nr stations = " << ps.nrStations()); - LOG_INFO_STR("nr subbands = " << ps.nrSubbands()); + LOG_INFO_STR("nr subbands = " << ps.settings.subbands.size()); LOG_INFO_STR("bitmode = " << ps.nrBitsPerSample()); } @@ -387,7 +387,7 @@ int main(int argc, char **argv) // Distribute the subbands over the MPI ranks SubbandDistribution subbandDistribution; // rank -> [subbands] - for( size_t subband = 0; subband < ps.nrSubbands(); ++subband) { + for( size_t subband = 0; subband < ps.settings.subbands.size(); ++subband) { int receiverRank = subband % mpi.size(); subbandDistribution[receiverRank].push_back(subband); @@ -401,7 +401,7 @@ int main(int argc, char **argv) subbandIndices, std::find(subbandIndices.begin(), subbandIndices.end(), 0U) != subbandIndices.end(), - ps.nrSamplesPerSubband(), + ps.settings.blockSize, ps.nrStations(), ps.nrBitsPerSample()); @@ -484,7 +484,7 @@ int main(int argc, char **argv) * THE OBSERVATION */ - if (ps.realTime()) { + if (ps.settings.realTime) { // Wait just before the obs starts to allocate resources, // both the UDP sockets and the GPU buffers! LOG_INFO_STR("Waiting to start obs running from " << TimeStamp::convert(ps.settings.startTime, ps.settings.clockHz()) << " to " << TimeStamp::convert(ps.settings.stopTime, ps.settings.clockHz())); diff --git a/RTCP/Cobalt/GPUProc/test/Kernels/tBandPassCorrectionKernel.cc b/RTCP/Cobalt/GPUProc/test/Kernels/tBandPassCorrectionKernel.cc index 15f34aeef52..ec80820c04c 100644 --- a/RTCP/Cobalt/GPUProc/test/Kernels/tBandPassCorrectionKernel.cc +++ b/RTCP/Cobalt/GPUProc/test/Kernels/tBandPassCorrectionKernel.cc @@ -53,7 +53,7 @@ int main() { params.nrDelayCompensationChannels = 64; // unused params.nrHighResolutionChannels = 4096; params.nrSamplesPerChannel = - ps.nrSamplesPerSubband() / params.nrHighResolutionChannels; + ps.settings.blockSize / params.nrHighResolutionChannels; KernelFactory<BandPassCorrectionKernel> factory(params); diff --git a/RTCP/Cobalt/GPUProc/test/Kernels/tBandPassCorrectionKernel2.cc b/RTCP/Cobalt/GPUProc/test/Kernels/tBandPassCorrectionKernel2.cc index cfdf9f00ad5..1ee32b50352 100644 --- a/RTCP/Cobalt/GPUProc/test/Kernels/tBandPassCorrectionKernel2.cc +++ b/RTCP/Cobalt/GPUProc/test/Kernels/tBandPassCorrectionKernel2.cc @@ -40,7 +40,7 @@ struct TestFixture params.nrDelayCompensationChannels = 64; // unused params.nrHighResolutionChannels = 4096; params.nrSamplesPerChannel = - ps.nrSamplesPerSubband() / params.nrHighResolutionChannels; + ps.settings.blockSize / params.nrHighResolutionChannels; factory = new KernelFactory<BandPassCorrectionKernel>(params); } diff --git a/RTCP/Cobalt/GPUProc/test/Kernels/tFIR_FilterKernel.cc b/RTCP/Cobalt/GPUProc/test/Kernels/tFIR_FilterKernel.cc index 3968c1d8e60..cab91d049e1 100644 --- a/RTCP/Cobalt/GPUProc/test/Kernels/tFIR_FilterKernel.cc +++ b/RTCP/Cobalt/GPUProc/test/Kernels/tFIR_FilterKernel.cc @@ -164,7 +164,7 @@ TEST(HistoryFlags) // Flag only the last sample inputFlags[0].reset(); - inputFlags[0].include(ps.nrSamplesPerSubband() - 1); + inputFlags[0].include(ps.settings.blockSize - 1); // insert and update history flags kernel->prefixHistoryFlags(inputFlags, 0); @@ -190,12 +190,12 @@ TEST(HistoryFlags) // next block inputFlags[0].reset(); - inputFlags[0].include(0, ps.nrSamplesPerSubband()); + inputFlags[0].include(0, ps.settings.blockSize); kernel->prefixHistoryFlags(inputFlags, 0); // the number of flagged samples should have remained unchanged (the last // block had no flags) - CHECK_EQUAL(ps.nrSamplesPerSubband(), inputFlags[0].count()); + CHECK_EQUAL(ps.settings.blockSize, inputFlags[0].count()); /* * Block 3: no samples are flagged diff --git a/RTCP/Cobalt/GPUProc/test/Pipelines/tCorrelatorPipelineProcessObs.cc b/RTCP/Cobalt/GPUProc/test/Pipelines/tCorrelatorPipelineProcessObs.cc index 77c16050ce3..c96f6e78bd0 100644 --- a/RTCP/Cobalt/GPUProc/test/Pipelines/tCorrelatorPipelineProcessObs.cc +++ b/RTCP/Cobalt/GPUProc/test/Pipelines/tCorrelatorPipelineProcessObs.cc @@ -66,7 +66,7 @@ int main(int argc, char *argv[]) { // "distribute" subbands over 1 node vector<size_t> subbands; - for (size_t sb = 0; sb < ps.nrSubbands(); sb++) + for (size_t sb = 0; sb < ps.settings.subbands.size(); sb++) { subbands.push_back(sb); } diff --git a/RTCP/Cobalt/GPUProc/test/SubbandProcs/tCoherentStokesBeamFormerSubbandProcProcessSb.cc b/RTCP/Cobalt/GPUProc/test/SubbandProcs/tCoherentStokesBeamFormerSubbandProcProcessSb.cc index 2924f7e99cd..377400a75b9 100644 --- a/RTCP/Cobalt/GPUProc/test/SubbandProcs/tCoherentStokesBeamFormerSubbandProcProcessSb.cc +++ b/RTCP/Cobalt/GPUProc/test/SubbandProcs/tCoherentStokesBeamFormerSubbandProcProcessSb.cc @@ -91,11 +91,11 @@ int main(/*int argc, char *argv[]*/) { */ // Input array sizes - const size_t nrBeams = ps.nrBeams(); - const size_t nrStations = ps.nrStations(); + const size_t nrBeams = ps.settings.SAPs.size(); + const size_t nrStations = ps.settings.antennaFields.size(); const size_t nrPolarisations = ps.settings.nrPolarisations; const size_t maxNrTABsPerSAP = ps.settings.beamFormer.maxNrTABsPerSAP(); - const size_t nrSamplesPerSubband = ps.nrSamplesPerSubband(); + const size_t nrSamplesPerSubband = ps.settings.blockSize; const size_t nrBitsPerSample = ps.settings.nrBitsPerSample; const size_t nrBytesPerComplexSample = ps.nrBytesPerComplexSample(); diff --git a/RTCP/Cobalt/GPUProc/test/SubbandProcs/tCorrelatorSubbandProcProcessSb.cc b/RTCP/Cobalt/GPUProc/test/SubbandProcs/tCorrelatorSubbandProcProcessSb.cc index fc6eee72c15..bd14f401529 100644 --- a/RTCP/Cobalt/GPUProc/test/SubbandProcs/tCorrelatorSubbandProcProcessSb.cc +++ b/RTCP/Cobalt/GPUProc/test/SubbandProcs/tCorrelatorSubbandProcProcessSb.cc @@ -51,12 +51,12 @@ int main() { Parset ps("tCorrelatorSubbandProcProcessSb.parset"); // Input info - const size_t nrBeams = ps.nrBeams(); - const size_t nrStations = ps.nrStations(); + const size_t nrBeams = ps.settings.SAPs.size(); + const size_t nrStations = ps.settings.antennaFields.size(); const size_t nrPolarisations = ps.settings.nrPolarisations; const size_t maxNrTABsPerSAP = ps.settings.beamFormer.maxNrTABsPerSAP(); const size_t nrSamplesPerChannel = ps.settings.correlator.nrSamplesPerIntegration(); - const size_t nrSamplesPerSubband = ps.nrSamplesPerSubband(); + const size_t nrSamplesPerSubband = ps.settings.blockSize; const size_t nrBitsPerSample = ps.settings.nrBitsPerSample; const size_t nrBytesPerComplexSample = ps.nrBytesPerComplexSample(); const fcomplex inputValue(1,1); diff --git a/RTCP/Cobalt/GPUProc/test/SubbandProcs/tFlysEyeBeamFormerSubbandProcProcessSb.cc b/RTCP/Cobalt/GPUProc/test/SubbandProcs/tFlysEyeBeamFormerSubbandProcProcessSb.cc index c746e079f14..407ce5ed07a 100644 --- a/RTCP/Cobalt/GPUProc/test/SubbandProcs/tFlysEyeBeamFormerSubbandProcProcessSb.cc +++ b/RTCP/Cobalt/GPUProc/test/SubbandProcs/tFlysEyeBeamFormerSubbandProcProcessSb.cc @@ -74,11 +74,11 @@ int main() { Parset ps("tFlysEyeBeamFormerSubbandProcProcessSb.parset"); // Input array sizes - const size_t nrBeams = ps.nrBeams(); + const size_t nrBeams = ps.settings.SAPs.size(); const size_t nrStations = ps.nrStations(); const size_t nrPolarisations = ps.settings.nrPolarisations; const size_t maxNrTABsPerSAP = ps.settings.beamFormer.maxNrTABsPerSAP(); - const size_t nrSamplesPerSubband = ps.nrSamplesPerSubband(); + const size_t nrSamplesPerSubband = ps.settings.blockSize; const size_t nrBitsPerSample = ps.settings.nrBitsPerSample; const size_t nrBytesPerComplexSample = ps.nrBytesPerComplexSample(); diff --git a/RTCP/Cobalt/GPUProc/test/tMPIReceive.cc b/RTCP/Cobalt/GPUProc/test/tMPIReceive.cc index 46f91b99cbb..cb04c4cef3e 100644 --- a/RTCP/Cobalt/GPUProc/test/tMPIReceive.cc +++ b/RTCP/Cobalt/GPUProc/test/tMPIReceive.cc @@ -47,7 +47,7 @@ int main(int argc, char **argv) Parset ps(parsetFile); SubbandDistribution subbandDistribution; // rank -> [subbands] - for (size_t subband = 0; subband < ps.nrSubbands(); ++subband) + for (size_t subband = 0; subband < ps.settings.subbands.size(); ++subband) { int receiverRank = subband % mpi.size(); subbandDistribution[receiverRank].push_back(subband); @@ -77,8 +77,8 @@ int main(int argc, char **argv) MPIReceiver MPI_receiver(MPI_receive_pool, // pool to insert data into subbandIndices, // what to process isThisSubbandZero, - ps.nrSamplesPerSubband(), - ps.nrStations(), + ps.settings.blockSize, + ps.settings.antennaFields.size(), ps.nrBitsPerSample()); cout << "Processing subbands " << subbandDistribution[mpi.rank()] << endl; diff --git a/RTCP/Cobalt/GPUProc/test/tStationInput.cc b/RTCP/Cobalt/GPUProc/test/tStationInput.cc index 155ecb683b2..f39931daf70 100644 --- a/RTCP/Cobalt/GPUProc/test/tStationInput.cc +++ b/RTCP/Cobalt/GPUProc/test/tStationInput.cc @@ -240,7 +240,7 @@ SUITE(StationMetaData) { // Just send everything to rank 0 SubbandDistribution subbandDistribution; - for (size_t sb = 0; sb < ps.nrSubbands(); ++sb) + for (size_t sb = 0; sb < ps.settings.subbands.size(); ++sb) subbandDistribution[0].push_back(sb); // Compute meta data diff --git a/RTCP/Cobalt/InputProc/src/Delays/Delays.cc b/RTCP/Cobalt/InputProc/src/Delays/Delays.cc index ab6928971b0..08281b7501c 100644 --- a/RTCP/Cobalt/InputProc/src/Delays/Delays.cc +++ b/RTCP/Cobalt/InputProc/src/Delays/Delays.cc @@ -69,7 +69,7 @@ namespace LOFAR const struct ObservationSettings::BeamFormer::SAP &bfSap = parset.settings.beamFormer.SAPs[sap]; // Reserve room for coherent TABs only - SAPs[sap].TABs.resize(bfSap.nrCoherentTAB()); + SAPs[sap].TABs.resize(bfSap.nrCoherent); } } } diff --git a/RTCP/Cobalt/InputProc/src/Delays/printDelays.cc b/RTCP/Cobalt/InputProc/src/Delays/printDelays.cc index 7cbf232f673..c42c1936334 100644 --- a/RTCP/Cobalt/InputProc/src/Delays/printDelays.cc +++ b/RTCP/Cobalt/InputProc/src/Delays/printDelays.cc @@ -63,7 +63,7 @@ int main( int argc, char **argv ) const TimeStamp from(ps.settings.startTime * ps.settings.subbandWidth(), ps.settings.clockHz()); const TimeStamp to(ps.settings.stopTime * ps.settings.subbandWidth(), ps.settings.clockHz()); ssize_t block = -1; - size_t blockSize = ps.nrSamplesPerSubband(); + size_t blockSize = ps.settings.blockSize; /* Print header */ cout << "# Parset: " << argv[1] << endl; diff --git a/RTCP/Cobalt/OutputProc/src/GPUProcIO.cc b/RTCP/Cobalt/OutputProc/src/GPUProcIO.cc index d2f421d83e4..ae33e9595ee 100644 --- a/RTCP/Cobalt/OutputProc/src/GPUProcIO.cc +++ b/RTCP/Cobalt/OutputProc/src/GPUProcIO.cc @@ -189,7 +189,7 @@ bool process(Stream &controlStream, unsigned myRank) LOG_ERROR_STR("Failed to read broken tile information: " << err); } - if (parset.realTime()) { + if (parset.settings.realTime) { // Real-time observations: stop now. MultiReceiver::kill // will stop the TABWriters. mr.kill(0); diff --git a/RTCP/Cobalt/OutputProc/src/MSWriterDAL.cc b/RTCP/Cobalt/OutputProc/src/MSWriterDAL.cc index 75177eaf844..a495fea7ce8 100644 --- a/RTCP/Cobalt/OutputProc/src/MSWriterDAL.cc +++ b/RTCP/Cobalt/OutputProc/src/MSWriterDAL.cc @@ -140,7 +140,7 @@ namespace LOFAR unsigned nrSubbands = f.lastSubbandIdx - f.firstSubbandIdx; itsNrChannels = stokesSet.nrChannels * nrSubbands; - itsNrSamples = parset.settings.nrSamplesPerSubband() / + itsNrSamples = parset.settings.blockSize / stokesSet.nrChannels / stokesSet.timeIntegrationFactor; itsBlockSize = itsNrSamples * itsNrChannels; @@ -226,8 +226,8 @@ namespace LOFAR double frequencyOffsetPPF = stokesSet.nrChannels > 1 ? 0.5 * channelBandwidth : 0.0; // TODO: cover both CS and IS! // For the whole obs, regardless which SAP and subbands (parts) this file contains. - vector<double> subbandCenterFrequencies(parset.nrSubbands()); - for(size_t sb = 0; sb < parset.nrSubbands(); ++sb) + vector<double> subbandCenterFrequencies(parset.settings.subbands.size()); + for(size_t sb = 0; sb < parset.settings.subbands.size(); ++sb) subbandCenterFrequencies[sb] = parset.settings.subbands[sb].centralFrequency; double min_centerfrequency = *min_element( subbandCenterFrequencies.begin(), subbandCenterFrequencies.end() ); diff --git a/RTCP/Cobalt/OutputProc/src/MeasurementSetFormat.cc b/RTCP/Cobalt/OutputProc/src/MeasurementSetFormat.cc index e4c0d458b31..02bed27130a 100644 --- a/RTCP/Cobalt/OutputProc/src/MeasurementSetFormat.cc +++ b/RTCP/Cobalt/OutputProc/src/MeasurementSetFormat.cc @@ -198,7 +198,7 @@ namespace LOFAR configLocator.getPath()); // Fill the tables containing the beam info. BeamTables::fill(*itsMS, - itsPS.antennaSet(), + itsPS.settings.antennaSet, configLocator.locate("AntennaSets.conf"), configLocator.locate("StaticMetaData"), configLocator.locate("StaticMetaData")); @@ -405,8 +405,8 @@ namespace LOFAR timeRange[1] = itsStartTime + itsNrTimes * itsTimeStep; // Get minimum and maximum frequency. - vector<double> freqs(itsPS.nrSubbands()); - for(size_t sb = 0; sb < itsPS.nrSubbands(); ++sb) + vector<double> freqs(itsPS.settings.subbands.size()); + for(size_t sb = 0; sb < itsPS.settings.subbands.size(); ++sb) freqs[sb] = itsPS.settings.subbands[sb].centralFrequency; ASSERT( freqs.size() > 0 ); @@ -467,8 +467,8 @@ namespace LOFAR msobsCol.observationFrequencyCenterQuant().put(0, Quantity(0.5 * (minFreq + maxFreq), "Hz")); msobsCol.subArrayPointing().put(0, subarray); msobsCol.nofBitsPerSample().put(0, itsPS.nrBitsPerSample()); - msobsCol.antennaSet().put(0, itsPS.antennaSet()); - msobsCol.filterSelection().put(0, itsPS.bandFilter()); + msobsCol.antennaSet().put(0, itsPS.settings.antennaSet); + msobsCol.filterSelection().put(0, itsPS.settings.bandFilter); msobsCol.clockFrequencyQuant().put(0, Quantity(itsPS.settings.clockHz(), "Hz")); msobsCol.target().put(0, ctargets); msobsCol.systemVersion().put(0, Version::getInfo<OutputProcVersion>("OutputProc", diff --git a/RTCP/Cobalt/OutputProc/src/OutputThread.cc b/RTCP/Cobalt/OutputProc/src/OutputThread.cc index 5c5743216db..04d0e49b01a 100644 --- a/RTCP/Cobalt/OutputProc/src/OutputThread.cc +++ b/RTCP/Cobalt/OutputProc/src/OutputThread.cc @@ -276,7 +276,7 @@ namespace LOFAR catch (Exception &ex) { LOG_ERROR_STR(itsLogPrefix << "Cannot open " << path << ": " << ex); - if ( !itsParset.realTime()) + if ( !itsParset.settings.realTime) THROW(StorageException, ex); itsWriter = new MSWriterNull(itsParset); @@ -286,7 +286,7 @@ namespace LOFAR { LOG_ERROR_STR(itsLogPrefix << "Caught AipsError: " << ex.what()); - if (!itsParset.realTime()) + if (!itsParset.settings.realTime) THROW(StorageException, ex.what()); itsWriter = new MSWriterNull(itsParset); @@ -350,7 +350,7 @@ namespace LOFAR catch (Exception &ex) { LOG_ERROR_STR(itsLogPrefix << "Cannot open " << path << ": " << ex); - if (!itsParset.realTime()) + if (!itsParset.settings.realTime) THROW(StorageException, ex); itsWriter = new MSWriterNull(itsParset); @@ -359,7 +359,7 @@ namespace LOFAR catch (casa::AipsError &ex) { LOG_ERROR_STR(itsLogPrefix << "Caught AipsError: " << ex.what()); - if ( !itsParset.realTime()) + if ( !itsParset.settings.realTime) THROW(StorageException, ex.what()); itsWriter = new MSWriterNull(itsParset); -- GitLab