diff --git a/RTCP/Storage/test/AH_TestStorage.cc b/RTCP/Storage/test/AH_TestStorage.cc deleted file mode 100644 index a3e2c08c7d722d8d181e7b152ca92b2a89da311b..0000000000000000000000000000000000000000 --- a/RTCP/Storage/test/AH_TestStorage.cc +++ /dev/null @@ -1,151 +0,0 @@ -//# tAH_TestStorage.cc: -//# -//# Copyright (C) 2002-2005 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//# -//# $Id$ - -//# Always #include <lofar_config.h> first! -#include <lofar_config.h> - -#include "AH_TestStorage.h" -#include <Common/LofarLogger.h> -#include <Storage/SubbandWriter.h> -#include <Interface/CorrelatedData.h> - -namespace LOFAR { -namespace RTCP { - -AH_TestStorage::AH_TestStorage() -: - itsPS("RTCP.parset") -{ -} - -AH_TestStorage::~AH_TestStorage() -{ - undefine(); -} - -void AH_TestStorage::define(const KeyValueMap&) -{ - - LOG_TRACE_FLOW_STR("Start of tAH_Storage::define()"); - - - - int nrSubbands = itsPS.nrSubbands(); - - - uint nrSubbandsPerPset = itsPS.nrSubbandsPerPset(); - uint nrPsetsPerStorage = itsPS.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> 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]); - } - - // SubbandWriter wh(&itsPS, 0); FIXME: needs extra parameter - } - - LOG_TRACE_FLOW_STR("Finished define()"); - -} - -void AH_TestStorage::setTestPattern(DH_Visibilities &dh, int factor) -{ - unsigned nrPolarizations = itsPS.getUint32("Observation.nrPolarisations"); - unsigned nrChannels = itsPS.nrChannelsPerSubband(); - unsigned nrStations = itsPS.nrStations(); - unsigned nrBaselines = (nrStations + 1) * nrStations / 2; - - for (unsigned bl = 0; bl < nrBaselines; bl++) { - for (unsigned ch = 0; ch < nrChannels; ch++) { - // Set number of valid samples - //dh.getNrValidSamples(bl, ch) = bl * ch; - - // Set visibilities - for (unsigned pol1 = 0; pol1 < nrPolarizations; pol1 ++) { - for (unsigned pol2 = 0; pol2 < nrPolarizations; pol2 ++) { - //dh.getVisibility(bl, ch, pol1, pol2) = makefcomplex(bl + ch, factor * (pol1 + pol2)); - } - } - } - } -} - -void AH_TestStorage::prerun() -{ - // Fill inDHs here - for (uint i = 0; i < itsInDHs.size(); i++) - { - //itsInDHs[i]->init(); - setTestPattern(*itsInDHs[i], i); - } -} - -void AH_TestStorage::run(int nsteps) -{ - - for (int i = 0; i < nsteps; i++) { - for (uint nrInp = 0; nrInp < itsInConns.size(); nrInp++) - { - //itsInConns[nrInp]->write(); - } - - LOG_TRACE_LOOP_STR("processing run " << i ); - cout<<"run "<<i+1<<" of "<<nsteps<<endl; - //getComposite().process(); - - } -} - -void AH_TestStorage::postrun() -{ - // check outresult here - // do an assert or exit(1) if results are not correct - -} - -void AH_TestStorage::undefine() -{ - for (uint i = 0; i < itsInDHs.size(); i++) - { - //delete itsInDHs[i]; - //delete itsInConns[i]; - } - itsInDHs.clear(); - itsInConns.clear(); -} - -void AH_TestStorage::quit() -{ -} - -} // namespace RTCP -} // namespace LOFAR - - diff --git a/RTCP/Storage/test/AH_TestStorage.h b/RTCP/Storage/test/AH_TestStorage.h deleted file mode 100644 index 99411d2d167f56788d1f97a21aca258c576759b2..0000000000000000000000000000000000000000 --- a/RTCP/Storage/test/AH_TestStorage.h +++ /dev/null @@ -1,63 +0,0 @@ -//# tAH_TestStorage.h: Application holder for storage testing -//# -//# Copyright (C) 2002-2005 -//# ASTRON (Netherlands Foundation for Research in Astronomy) -//# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands, seg@astron.nl -//# -//# This program is free software; you can redistribute it and/or modify -//# it under the terms of the GNU General Public License as published by -//# the Free Software Foundation; either version 2 of the License, or -//# (at your option) any later version. -//# -//# This program is distributed in the hope that it will be useful, -//# but WITHOUT ANY WARRANTY; without even the implied warranty of -//# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -//# GNU General Public License for more details. -//# -//# You should have received a copy of the GNU General Public License -//# along with this program; if not, write to the Free Software -//# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -//# -//# $Id$ - -#ifndef LOFAR_RTCP_AH_TESTSTORAGE_H -#define LOFAR_RTCP_AH_TESTSTORAGE_H - -#include <Interface/Parset.h> - -namespace LOFAR -{ - //# Forward declarations - class KeyValueMap; - class Connection; - - namespace RTCP - { - class DH_Visibilities; - - class AH_TestStorage - { - public: - AH_TestStorage(); - virtual ~AH_TestStorage(); - - virtual void define (const KeyValueMap& kvm); - void undefine(); - virtual void prerun(); - virtual void run(int nsteps); - virtual void postrun(); - virtual void quit(); - - private: - void setTestPattern(DH_Visibilities &, int factor); - - vector<DH_Visibilities*> itsInDHs; - vector<Connection*> itsInConns; - Parset itsPS; - }; - - } // namespace RTCP - -} // namespace LOFAR - -#endif diff --git a/RTCP/Storage/test/Makefile.am b/RTCP/Storage/test/Makefile.am index 00eaaed2758142ef210082a23f49f7958c0c0adb..b54995033536feddadb31aa5af77fd80b7360ebb 100644 --- a/RTCP/Storage/test/Makefile.am +++ b/RTCP/Storage/test/Makefile.am @@ -15,8 +15,7 @@ XFAIL_TESTS = # all files (.run, .stdout, .in, .log_prop, etc.) needed to run tests EXTRA_DIST = $(TESTSCRIPTS) -tAH_TestStorage_SOURCES = tAH_TestStorage.cc \ - AH_TestStorage.h AH_TestStorage.cc +tAH_TestStorage_SOURCES = tAH_TestStorage.cc tAH_TestStorage_LDADD = ../src/libstorage.la tAH_TestStorage_DEPENDENCIES = ../src/libstorage.la $(LOFAR_DEPEND) diff --git a/RTCP/Storage/test/tAH_TestStorage.cc b/RTCP/Storage/test/tAH_TestStorage.cc index 544d0f113b12147406cb3479c12f1302fbb9273e..4fb0233cced850867f3f69f099f2607274d82d4d 100644 --- a/RTCP/Storage/test/tAH_TestStorage.cc +++ b/RTCP/Storage/test/tAH_TestStorage.cc @@ -77,9 +77,6 @@ int main(int argc, char *argv[]) SubbandWriter subbandWriter(&parset, rank, size); - subbandWriter.preprocess(); - subbandWriter.process(); - subbandWriter.postprocess(); } catch (Exception &ex) { std::cerr << "caught Exception: " << ex.what() << std::endl; exit(1);