Skip to content
Snippets Groups Projects
Commit 79c3c440 authored by Martin Gels's avatar Martin Gels
Browse files

bug 1005: Updated test environment.

parent b434b949
Branches
Tags
No related merge requests found
......@@ -51,18 +51,35 @@ namespace LOFAR
Composite comp(0, 0, "topComposite");
setComposite(comp); // tell the ApplicationHolder this is the top-level composite
int nrSubbands = itsParamSet.getInt32("Observation.NSubbands");
itsCS1PS = new CS1_Parset(&itsParamSet);
for (int subb=0; subb< nrSubbands; subb++)
int nrSubbands = itsCS1PS->nrSubbands();
uint nrSubbandsPerPset = itsCS1PS->nrSubbandsPerPset();
uint nrPsetsPerStorage = itsParamSet.getUint32("OLAP.psetsPerStorage");
uint nrWriters = nrSubbands / nrSubbandsPerPset / nrPsetsPerStorage;
ASSERT(nrSubbands % nrSubbandsPerPset == 0);
ASSERT(nrSubbands / nrSubbandsPerPset % nrPsetsPerStorage == 0);
LOG_TRACE_VAR_STR("Creating " << nrWriters << " subband writers ...");
for (unsigned nw = 0; nw < nrWriters; ++nw)
{
vector<uint> subbands; subbands.push_back(subb);
WH_SubbandWriter wh("storage1", subbands, itsParamSet);
vector<uint> sbIDs(nrSubbandsPerPset * nrPsetsPerStorage);
for (uint i = 0; i < nrSubbandsPerPset * nrPsetsPerStorage; ++i) {
sbIDs[i] = nrSubbandsPerPset * nrPsetsPerStorage * nw + i;
LOG_TRACE_LOOP_STR("Writer " << nw << ": sbIDs[" << i << "] = "
<< sbIDs[i]);
}
WH_SubbandWriter wh("storage1", sbIDs, itsCS1PS);
Step step(wh);
comp.addBlock(step);
for (int nr=0; nr < step.getNrInputs(); nr++)
{
DH_Visibilities* inDH = new DH_Visibilities("in_"+nr, itsParamSet);
DH_Visibilities* inDH = new DH_Visibilities("in_"+nr, itsCS1PS);
itsInDHs.push_back(inDH);
Connection* inConn = new Connection("in_"+nr,
......@@ -81,9 +98,9 @@ namespace LOFAR
}
void AH_TestStorage::setTestPattern(DH_Visibilities &dh, int factor) {
unsigned nrPolarizations = itsParamSet.getUint32("Observation.NPolarisations");
unsigned nrChannels = itsParamSet.getUint32("Observation.NChannels");
unsigned nrStations = itsParamSet.getUint32("Observation.NStations");
unsigned nrPolarizations = itsCS1PS->getUint32("Observation.nrPolarisations");
unsigned nrChannels = itsCS1PS->nrChannelsPerSubband();
unsigned nrStations = itsCS1PS->nrStations();
unsigned nrBaselines = (nrStations + 1) * nrStations / 2;
for (unsigned bl = 0; bl < nrBaselines; bl++) {
......@@ -141,6 +158,7 @@ namespace LOFAR
}
itsInDHs.clear();
itsInConns.clear();
delete itsCS1PS; itsCS1PS = 0;
}
void AH_TestStorage::quit() {
......
......@@ -24,6 +24,7 @@
#define LOFAR_CS1_AH_TESTSTORAGE_H
#include <CEPFrame/ApplicationHolder.h>
#include <CS1_Interface/CS1_Parset.h>
namespace LOFAR
{
......@@ -53,6 +54,7 @@ namespace LOFAR
vector<DH_Visibilities*> itsInDHs;
vector<Connection*> itsInConns;
CS1_Parset *itsCS1PS;
};
} // namespace CS1
......
This diff is collapsed.
......@@ -43,7 +43,7 @@ int main (int argc, const char** argv){
test.setarg(argc,argv);
test.baseDefine();
test.basePrerun();
int nrRuns = ps.getInt32("General.NRuns");
int nrRuns = atoi(argv[argc - 1]);
cout << "run " << nrRuns << " times" << endl;
test.baseRun(nrRuns);
test.basePostrun();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment