Skip to content
Snippets Groups Projects
Commit 21a8c99b authored by Jan David Mol's avatar Jan David Mol
Browse files

bug 1303: removed need for baseline in cn_processingplan, and bugfix

parent 0707d1fd
No related branches found
No related tags found
No related merge requests found
...@@ -130,18 +130,18 @@ template <typename SAMPLE_TYPE> void CN_Processing<SAMPLE_TYPE>::preprocess(CN_C ...@@ -130,18 +130,18 @@ template <typename SAMPLE_TYPE> void CN_Processing<SAMPLE_TYPE>::preprocess(CN_C
itsNrStations = configuration.nrStations(); itsNrStations = configuration.nrStations();
itsNrBeamFormedStations = configuration.nrMergedStations();
itsNrPencilBeams = configuration.nrPencilBeams(); itsNrPencilBeams = configuration.nrPencilBeams();
itsNrSubbands = configuration.nrSubbands(); itsNrSubbands = configuration.nrSubbands();
itsNrSubbandsPerPset = configuration.nrSubbandsPerPset(); itsNrSubbandsPerPset = configuration.nrSubbandsPerPset();
itsNrStokes = configuration.nrStokes(); itsNrStokes = configuration.nrStokes();
itsOutputPsetSize = outputPsets.size(); itsOutputPsetSize = outputPsets.size();
itsCenterFrequencies = configuration.refFreqs(); itsCenterFrequencies = configuration.refFreqs();
itsFlysEye = configuration.flysEye();
unsigned nrChannels = configuration.nrChannelsPerSubband(); unsigned nrChannels = configuration.nrChannelsPerSubband();
unsigned nrSamplesPerIntegration = configuration.nrSamplesPerIntegration(); unsigned nrSamplesPerIntegration = configuration.nrSamplesPerIntegration();
unsigned nrSamplesPerStokesIntegration = configuration.nrSamplesPerStokesIntegration(); unsigned nrSamplesPerStokesIntegration = configuration.nrSamplesPerStokesIntegration();
unsigned nrBeamFormedStations = configuration.nrMergedStations();
unsigned nrBaselines = nrBeamFormedStations * (nrBeamFormedStations + 1) / 2;
// Each phase (e.g., transpose, PPF, correlator) reads from an input data // Each phase (e.g., transpose, PPF, correlator) reads from an input data
// set and writes to an output data set. To save memory, a few memory buffers // set and writes to an output data set. To save memory, a few memory buffers
...@@ -150,7 +150,7 @@ template <typename SAMPLE_TYPE> void CN_Processing<SAMPLE_TYPE>::preprocess(CN_C ...@@ -150,7 +150,7 @@ template <typename SAMPLE_TYPE> void CN_Processing<SAMPLE_TYPE>::preprocess(CN_C
// Since some buffers (arenas) are used multiple times, we use multiple // Since some buffers (arenas) are used multiple times, we use multiple
// Allocators for a single arena. // Allocators for a single arena.
itsPlan = new CN_ProcessingPlan<SAMPLE_TYPE>( configuration, itsIsTransposeInput, itsIsTransposeOutput, nrBaselines ); itsPlan = new CN_ProcessingPlan<SAMPLE_TYPE>( configuration, itsIsTransposeInput, itsIsTransposeOutput );
// calculate what to calculate, what goes where, etc // calculate what to calculate, what goes where, etc
itsPlan->assignArenas(); itsPlan->assignArenas();
...@@ -321,7 +321,7 @@ template <typename SAMPLE_TYPE> void CN_Processing<SAMPLE_TYPE>::calculateCohere ...@@ -321,7 +321,7 @@ template <typename SAMPLE_TYPE> void CN_Processing<SAMPLE_TYPE>::calculateCohere
LOG_DEBUG(std::setprecision(12) << "core " << itsLocationInfo.rank() << ": start calculating coherent Stokes at " << MPI_Wtime()); LOG_DEBUG(std::setprecision(12) << "core " << itsLocationInfo.rank() << ": start calculating coherent Stokes at " << MPI_Wtime());
#endif // HAVE_MPI #endif // HAVE_MPI
computeTimer.start(); computeTimer.start();
itsCoherentStokes->calculateCoherent(itsPlan->itsBeamFormedData,itsPlan->itsCoherentStokesData,itsNrPencilBeams); itsCoherentStokes->calculateCoherent(itsPlan->itsBeamFormedData,itsPlan->itsCoherentStokesData,itsFlysEye ? itsNrBeamFormedStations : itsNrPencilBeams);
computeTimer.stop(); computeTimer.stop();
} }
......
...@@ -92,6 +92,8 @@ template <typename SAMPLE_TYPE> class CN_Processing : public CN_Processing_Base, ...@@ -92,6 +92,8 @@ template <typename SAMPLE_TYPE> class CN_Processing : public CN_Processing_Base,
#endif #endif
unsigned itsNrStations; unsigned itsNrStations;
unsigned itsNrBeamFormedStations;
bool itsFlysEye;
unsigned itsNrPencilBeams; unsigned itsNrPencilBeams;
unsigned itsNrSubbands; unsigned itsNrSubbands;
unsigned itsNrSubbandsPerPset; unsigned itsNrSubbandsPerPset;
......
...@@ -71,7 +71,7 @@ void OutputSection::preprocess(const Parset *ps) ...@@ -71,7 +71,7 @@ void OutputSection::preprocess(const Parset *ps)
CN_Configuration configuration(*ps); CN_Configuration configuration(*ps);
// allocate output structures and temporary data holders // allocate output structures and temporary data holders
itsPlan = new CN_ProcessingPlan<>( configuration, false, true, ps->nrBaselines() ); itsPlan = new CN_ProcessingPlan<>( configuration, false, true );
itsPlan->removeNonOutputs(); itsPlan->removeNonOutputs();
itsPlan->allocateOutputs( hugeMemoryAllocator ); itsPlan->allocateOutputs( hugeMemoryAllocator );
itsOutputs.resize(itsPlan->nrOutputs()); itsOutputs.resize(itsPlan->nrOutputs());
...@@ -92,7 +92,7 @@ void OutputSection::preprocess(const Parset *ps) ...@@ -92,7 +92,7 @@ void OutputSection::preprocess(const Parset *ps)
unsigned subbandNumber = itsPsetIndex * itsNrSubbandsPerPset + subband; unsigned subbandNumber = itsPsetIndex * itsNrSubbandsPerPset + subband;
if (subbandNumber < itsNrSubbands) { if (subbandNumber < itsNrSubbands) {
itsSumPlans[subband] = new CN_ProcessingPlan<>( configuration, false, true, ps->nrBaselines() ); itsSumPlans[subband] = new CN_ProcessingPlan<>( configuration, false, true );
itsSumPlans[subband]->removeNonOutputs(); itsSumPlans[subband]->removeNonOutputs();
// create data structures to accumulate data, if needed // create data structures to accumulate data, if needed
......
...@@ -54,7 +54,7 @@ OutputThread::OutputThread(const unsigned subband, const Parset &ps ) ...@@ -54,7 +54,7 @@ OutputThread::OutputThread(const unsigned subband, const Parset &ps )
// transpose the data holders: create queues streams for the output streams // transpose the data holders: create queues streams for the output streams
// itsPlans is the owner of the pointers to sample data structures // itsPlans is the owner of the pointers to sample data structures
for (unsigned i = 0; i < maxSendQueueSize; i ++) { for (unsigned i = 0; i < maxSendQueueSize; i ++) {
CN_ProcessingPlan<> *plan = new CN_ProcessingPlan<>( configuration, false, true, ps.nrBaselines() ); CN_ProcessingPlan<> *plan = new CN_ProcessingPlan<>( configuration, false, true );
plan->removeNonOutputs(); plan->removeNonOutputs();
plan->allocateOutputs( hugeMemoryAllocator ); plan->allocateOutputs( hugeMemoryAllocator );
......
...@@ -48,12 +48,11 @@ namespace RTCP { ...@@ -48,12 +48,11 @@ namespace RTCP {
template <typename SAMPLE_TYPE = i8complex> class CN_ProcessingPlan: public ProcessingPlan template <typename SAMPLE_TYPE = i8complex> class CN_ProcessingPlan: public ProcessingPlan
{ {
public: public:
CN_ProcessingPlan( CN_Configuration &configuration, bool isInput, bool isOutput, unsigned nrBaselines ); CN_ProcessingPlan( CN_Configuration &configuration, bool isInput, bool isOutput );
virtual ~CN_ProcessingPlan(); virtual ~CN_ProcessingPlan();
const bool itsIsTransposeInput; const bool itsIsTransposeInput;
const bool itsIsTransposeOutput; const bool itsIsTransposeOutput;
const unsigned itsNrBaselines;
InputData<SAMPLE_TYPE> *itsInputData; InputData<SAMPLE_TYPE> *itsInputData;
SubbandMetaData *itsInputSubbandMetaData; SubbandMetaData *itsInputSubbandMetaData;
......
...@@ -109,7 +109,6 @@ public: ...@@ -109,7 +109,6 @@ public:
string getMSBaseDir() const; string getMSBaseDir() const;
string getTransportType(const string& prefix) const; string getTransportType(const string& prefix) const;
string getModeName() const; string getModeName() const;
bool outputIncoherentStokesI() const;
bool outputFilteredData() const; bool outputFilteredData() const;
bool outputCorrelatedData() const; bool outputCorrelatedData() const;
...@@ -304,7 +303,7 @@ inline unsigned Parset::nrStokes() const ...@@ -304,7 +303,7 @@ inline unsigned Parset::nrStokes() const
{ {
if( getModeName() == "IncoherentStokesI" if( getModeName() == "IncoherentStokesI"
|| getModeName() == "CoherentStokesI" || getModeName() == "CoherentStokesI"
|| getBool("Observation.outputIncoherentStokesI") ) { || getBool("Observation.outputIncoherentStokesI",false) ) {
return 1; return 1;
} else if( getModeName() == "IncoherentAllStokes" } else if( getModeName() == "IncoherentAllStokes"
|| getModeName() == "CoherentAllStokes" ) { || getModeName() == "CoherentAllStokes" ) {
......
...@@ -29,10 +29,10 @@ namespace RTCP { ...@@ -29,10 +29,10 @@ namespace RTCP {
// shortcut to automatically name the data sets // shortcut to automatically name the data sets
#define TRANSFORM(source,set) transform(source,set,#set) #define TRANSFORM(source,set) transform(source,set,#set)
template <typename SAMPLE_TYPE> CN_ProcessingPlan<SAMPLE_TYPE>::CN_ProcessingPlan( CN_Configuration &configuration, bool isInput, bool isOutput, unsigned nrBaselines ): template <typename SAMPLE_TYPE> CN_ProcessingPlan<SAMPLE_TYPE>::CN_ProcessingPlan( CN_Configuration &configuration, bool isInput, bool isOutput )
:
itsIsTransposeInput(isInput), itsIsTransposeInput(isInput),
itsIsTransposeOutput(isOutput), itsIsTransposeOutput(isOutput),
itsNrBaselines(nrBaselines),
itsInputData(0), itsInputData(0),
itsInputSubbandMetaData(0), itsInputSubbandMetaData(0),
itsSubbandMetaData(0), itsSubbandMetaData(0),
...@@ -48,6 +48,8 @@ template <typename SAMPLE_TYPE> CN_ProcessingPlan<SAMPLE_TYPE>::CN_ProcessingPla ...@@ -48,6 +48,8 @@ template <typename SAMPLE_TYPE> CN_ProcessingPlan<SAMPLE_TYPE>::CN_ProcessingPla
// in fly's eye mode, every station is a beam // in fly's eye mode, every station is a beam
const unsigned nrBeams = configuration.flysEye() ? configuration.nrMergedStations() : configuration.nrPencilBeams(); const unsigned nrBeams = configuration.flysEye() ? configuration.nrMergedStations() : configuration.nrPencilBeams();
const unsigned nrBaselines = configuration.nrMergedStations() * (configuration.nrMergedStations() + 1)/2;
if (itsIsTransposeInput) { if (itsIsTransposeInput) {
std::vector<unsigned> &outputPsets = configuration.outputPsets(); std::vector<unsigned> &outputPsets = configuration.outputPsets();
...@@ -77,7 +79,7 @@ template <typename SAMPLE_TYPE> CN_ProcessingPlan<SAMPLE_TYPE>::CN_ProcessingPla ...@@ -77,7 +79,7 @@ template <typename SAMPLE_TYPE> CN_ProcessingPlan<SAMPLE_TYPE>::CN_ProcessingPla
); );
itsCorrelatedData = new CorrelatedData( itsCorrelatedData = new CorrelatedData(
itsNrBaselines, nrBaselines,
configuration.nrChannelsPerSubband() configuration.nrChannelsPerSubband()
); );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment