Skip to content
Snippets Groups Projects
Commit 1d014e51 authored by John Romein's avatar John Romein
Browse files

bug 225:

removed since no input section is used anymore
parent 44fc8591
No related branches found
No related tags found
No related merge requests found
//# AH_ION_Scatter.cc:
//#
//# 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 <Common/lofar_iostream.h>
#include <Common/Timer.h>
#include <CS1_IONProc/AH_ION_Scatter.h>
#include <CS1_IONProc/BGL_Personality.h>
#include <CS1_IONProc/WH_ION_Scatter.h>
#include <CEPFrame/Step.h>
//#include <CS1_Interface/CS1_Config.h>
//#include <CS1_Interface/Stub_BGL_Subband.h>
//#include <CS1_Interface/Stub_BGL_RFI_Mitigation.h>
//#include <Blob/KeyValueMap.h>
namespace LOFAR {
namespace CS1 {
AH_ION_Scatter::AH_ION_Scatter()
:
itsCS1PS(0),
itsWH(0),
itsSubbandStub(0)
{
}
AH_ION_Scatter::~AH_ION_Scatter()
{
undefine();
}
void AH_ION_Scatter::define(const KeyValueMap&)
{
itsCS1PS = new CS1_Parset(&itsParamSet);
itsWH = new WH_ION_Scatter("ION_Scatter", itsCS1PS);
itsWH->runOnNode(0);
DataManager *dm = new DataManager(itsWH->getDataManager());
itsWH->setDataManager(dm);
dm->setInBuffer(0, false, 2);
itsSubbandStub = new Stub_BGL(true, true, "input_BGLProc", itsCS1PS);
itsSubbandStub->connect(getBGLpersonality()->psetNum, 0, *dm, /*channel*/ 0);
}
void AH_ION_Scatter::undefine()
{
delete itsWH; itsWH = 0;
delete itsSubbandStub; itsSubbandStub = 0;
delete itsCS1PS; itsCS1PS = 0;
}
void AH_ION_Scatter::prerun()
{
itsWH->basePreprocess();
}
void AH_ION_Scatter::run(int steps)
{
steps *= itsCS1PS->getUint32("OLAP.BGLProc.nodesPerPset");
for (int i = 0; i < steps; i++) {
class NSTimer timer("baseProcess", true);
LOG_TRACE_LOOP_STR("processing run " << i );
timer.start();
itsWH->baseProcess();
timer.stop();
}
}
void AH_ION_Scatter::postrun()
{
itsWH->basePostprocess();
}
} // namespace CS1
} // namespace LOFAR
//# AH_ION_Scatter.h:
//#
//# 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_CS1_ION_PROC_AH_ION_SCATTER_H
#define LOFAR_CS1_ION_PROC_AH_ION_SCATTER_H
#include <CEPFrame/ApplicationHolder.h>
#include <CS1_IONProc/WH_ION_Scatter.h>
#include <CS1_Interface/Stub_BGL.h>
namespace LOFAR {
namespace CS1 {
class AH_ION_Scatter : public ApplicationHolder
{
public:
AH_ION_Scatter();
virtual ~AH_ION_Scatter();
virtual void undefine();
virtual void define(const KeyValueMap&);
virtual void prerun();
virtual void run(int nsteps);
virtual void postrun();
private:
CS1_Parset *itsCS1PS;
WH_ION_Scatter *itsWH;
Stub_BGL *itsSubbandStub;
};
} // namespace CS1
} // namespace LOFAR
#endif
//# WH_ION_Scatter.cc: Blue Gene processing for 1 second of sampled data
//#
//# 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 <ION_Allocator.h>
#include <WH_ION_Scatter.h>
#include <TH_ZoidServer.h>
#include <cstring>
#include <string>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
namespace LOFAR {
namespace CS1 {
WH_ION_Scatter::WH_ION_Scatter(const string &name, const CS1_Parset *ps)
:
WorkHolder(1, 0, name, "WH_ION_Scatter"),
itsCurrentComputeNode(0),
itsPS(ps)
{
itsNrComputeNodes = ps->getUint32("OLAP.BGLProc.nodesPerPset");
TinyDataManager &dm = getDataManager();
DH_Subband *dh = new DH_Subband("input", ps);
// prereserve some space for ExtraBlob, to avoid memory fragmentation
dh->setMaxDataSize(ps->nrStations() * 1024, true);
dh->setAllocationProperties(false, BlobStringType(false, ION_Allocator()));
dm.addInDataHolder(0, dh);
//dm.setAutoTriggerIn(0, false);
}
WH_ION_Scatter::~WH_ION_Scatter()
{
}
#if 0
WorkHolder* WH_ION_Scatter::construct(const string &name, const ACC::APS::ParameterSet &ps)
{
return new WH_ION_Scatter(name, ps);
}
#endif
WH_ION_Scatter* WH_ION_Scatter::make(const string &name)
{
return new WH_ION_Scatter(name, itsPS);
}
void WH_ION_Scatter::preprocess()
{
}
static double getTime()
{
struct timeval tv;
static double first_time = 0.0;
if (gettimeofday(&tv, 0) != 0) {
perror("gettimeofday");
tv.tv_sec = tv.tv_usec = 0;
}
double time = tv.tv_sec + tv.tv_usec / 1.0e6;
if (first_time == 0)
first_time = time;
return time - first_time;
}
void WH_ION_Scatter::process()
{
DH_Subband *dh = dynamic_cast<DH_Subband *>(getDataManager().getInHolder(0));
dh->getExtraData();
dh->fillExtraData();
dh->pack();
//std::clog.precision(7);
//std::clog << getTime() << ": thread " << itsCurrentComputeNode << " received write right" << std::endl;
TH_ZoidServer::theirTHs[itsCurrentComputeNode]->sendBlocking(dh->getDataPtr(), (dh->getDataSize() + 15) & ~15, 0, dh);
//std::clog << getTime() << ": thread " << itsCurrentComputeNode << " releases write right" << std::endl;
if (++ itsCurrentComputeNode == itsNrComputeNodes)
itsCurrentComputeNode = 0;
}
void WH_ION_Scatter::postprocess()
{
}
}
}
//# WH_ION_Scatter.h: simple processing on BG/L I/O nodes
//#
//# 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_APPL_CEP_CS1_CS1_ION_PROC_WH_ION_SCATTER_H
#define LOFAR_APPL_CEP_CS1_CS1_ION_PROC_WH_ION_SCATTER_H
#include <CS1_Interface/DH_Subband.h>
//#include <Transport/TH_ZoidServer.h>
#include <tinyCEP/WorkHolder.h>
#include <vector>
namespace LOFAR {
namespace CS1 {
class WH_ION_Scatter : public WorkHolder
{
public:
explicit WH_ION_Scatter(const string &name, const CS1_Parset *ps);
virtual ~WH_ION_Scatter();
//static WorkHolder *construct(const string &name, const ACC::APS::ParameterSet &);
virtual WH_ION_Scatter *make(const string &name);
virtual void preprocess();
virtual void process();
virtual void postprocess();
private:
// forbid copy constructor
WH_ION_Scatter(const WH_ION_Scatter &);
// forbid assignment
WH_ION_Scatter &operator = (const WH_ION_Scatter &);
unsigned itsNrComputeNodes, itsCurrentComputeNode;
//vector<TH_ZoidServer *> itsOutputs;
const CS1_Parset *itsPS;
};
}
}
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment