Skip to content
Snippets Groups Projects
Commit 60b61558 authored by Marcel Loose's avatar Marcel Loose :sunglasses:
Browse files

BugID: 991

Renamed process control sources.
parent 2d17f463
No related branches found
No related tags found
No related merge requests found
Showing
with 203 additions and 153 deletions
......@@ -66,7 +66,8 @@ namespace LOFAR
// this step represents a "unit of work", a.k.a. \e workorder. This
// method is typically used by the global controller.
// \pre \a step must a BBSSingleStep.
void addStep(const BBSStep& step);
// \return The unique command-id associated with \a step.
int addStep(const BBSStep& step) const;
// Get the next BBSStep from the command queue. When this step is
// retrieved from the database, its status will be set to "active"
......@@ -84,21 +85,26 @@ namespace LOFAR
// the BBSStep objects within the BBSStrategy are stored in the
// database. This "meta data" is needed to (re)start a BBS run. This
// method is typically used by the global controller.
void setStrategy(const BBSStrategy&);
void setStrategy(const BBSStrategy&) const;
// Retrieve the BBSStrategy for this BBS run. The information in the
// database consists of the "meta data" of a BBSStrategy object
// (i.e. all information \e except the BBSStep objects). This method is
// typically called by the local controller.
const BBSStrategy* getStrategy();
const BBSStrategy* getStrategy() const;
// Check to see if we're starting a new run. The local controller needs
// to do a few extra checks; these checks will be done when \a
// isLocalCtrl is \c true.
bool isNewRun(bool isLocalCtrl) const;
private:
// HandleTrigger needs to have access to itsConnection, so we make it a
// friend.
friend class HandleTrigger;
// CommandQueueTrigger needs to have access to itsConnection, so we make
// it a friend.
friend class CommandQueueTrigger;
// Execute \a query. The result will be returned as a ParameterSet.
ACC::APS::ParameterSet execQuery(const string& query);
ACC::APS::ParameterSet execQuery(const string& query) const;
// Connection to the PostgreSQL database. The pqxx::connection object
// will be destroyed when \c *this goes out of scope.
......
......@@ -38,10 +38,26 @@ namespace LOFAR
// \addtogroup BBSControl
// @{
// This exception is thrown when an error occurs in the BBS control part.
// Top-level exception class for the BBSControl package.
EXCEPTION_CLASS(BBSControlException, LOFAR::Exception);
// @}
// Exception class for the global controller.
// part.
EXCEPTION_CLASS(GlobalControlException, BBSControlException);
// Exception class for the local controller.
// part.
EXCEPTION_CLASS(LocalControlException, BBSControlException);
// Exception class for the database access layer.
// part.
EXCEPTION_CLASS(DatabaseException, BBSControlException);
// Exception class for the command queue.
// part.
EXCEPTION_CLASS(CommandQueueException, BBSControlException);
// @}
} // namespace BBS
......
//# BBSProcessControl.h: Implementation of ACC/PLC ProcessControl class.
//# GlobalProcessControl.h: Implementation of ACC/PLC ProcessControl class.
//#
//# Copyright (C) 2006
//# ASTRON (Netherlands Foundation for Research in Astronomy)
......@@ -20,8 +20,8 @@
//#
//# $Id$
#ifndef LOFAR_BBSCONTROL_BBSPROCESSCONTROL_H
#define LOFAR_BBSCONTROL_BBSPROCESSCONTROL_H
#ifndef LOFAR_BBSCONTROL_GLOBALPROCESSCONTROL_H
#define LOFAR_BBSCONTROL_GLOBALPROCESSCONTROL_H
// \file
// Implementation of ACC/PLC ProcessControl class
......@@ -51,14 +51,14 @@ namespace LOFAR
// Implementation of the ProcessControl interface for the global BBS
// controller.
class BBSProcessControl : public ACC::PLC::ProcessControl
class GlobalProcessControl : public ACC::PLC::ProcessControl
{
public:
// Default constructor.
BBSProcessControl();
GlobalProcessControl();
// Destructor.
virtual ~BBSProcessControl();
virtual ~GlobalProcessControl();
// @name Implementation of PLC interface.
// @{
......@@ -97,7 +97,7 @@ namespace LOFAR
#if 0
// DataHolder for exchanging data between global (BBS) and local
// (BBSKernel) process control.
// (BBSKernel) global control.
DH_BlobStreamable* itsDataHolder;
// TransportHolder used to exchange DataHolders. The global controller
......@@ -105,8 +105,8 @@ namespace LOFAR
// connect.
TH_Socket* itsTransportHolder;
// Connection between the global (BBS) process control and the local
// (BBSKernel) process control.
// Connection between the global (BBS) control and the local
// (BBSKernel) control.
CSConnection* itsConnection;
#endif
......
//# BBSKernelProcessControl.h:
//# KernelProcessControl.h:
//#
//# Copyright (C) 2002-2007
//# ASTRON (Netherlands Foundation for Research in Astronomy)
......@@ -22,8 +22,8 @@
//#
//# $Id$
#ifndef LOFAR_BBSCONTROL_BBSKERNELPROCESSCONTROL_H
#define LOFAR_BBSCONTROL_BBSKERNELPROCESSCONTROL_H
#ifndef LOFAR_BBSCONTROL_KERNELPROCESSCONTROL_H
#define LOFAR_BBSCONTROL_KERNELPROCESSCONTROL_H
//# Never #include <config.h> or #include <lofar_config.h> in a header file!
......@@ -54,13 +54,13 @@ namespace LOFAR
// \addtogroup BBSControl
// @{
// Implementation of the ProcessControl interface for the local BBSKernel
// Implementation of the ProcessControl interface for the local Kernel
// controller.
class BBSKernelProcessControl: public ACC::PLC::ProcessControl
class KernelProcessControl: public ACC::PLC::ProcessControl
{
public:
// Default constructor.
BBSKernelProcessControl();
KernelProcessControl();
// @name Implementation of PLC interface.
// @{
......
pkginclude_HEADERS = \
BBSCorrectStep.h \
BBSKernelProcessControl.h \
BBSMultiStep.h \
BBSPredictStep.h \
BBSProcessControl.h \
BBSRefitStep.h \
BBSShiftStep.h \
BBSSingleStep.h \
......@@ -12,15 +10,18 @@ pkginclude_HEADERS = \
BBSStrategy.h \
BBSStructs.h \
BBSSubtractStep.h \
BBSSolverProcessControl.h \
BlobStreamableConnection.h \
BlobStreamableVector.h \
CommandQueue.h \
CommandQueueTransactors.h \
CommandQueueTrigger.h \
DomainRegistrationRequest.h \
Exceptions.h \
GlobalProcessControl.h \
IterationRequest.h \
IterationResult.h
IterationResult.h \
KernelProcessControl.h \
SolverProcessControl.h
noinst_HEADERS = \
pqutil.h
......
//# BBSSolverProcessControl.h: Implementation of the ProcessControl
//# SolverProcessControl.h: Implementation of the ProcessControl
//# interface for the BBS solver component.
//#
//# Copyright (C) 2004
......@@ -23,8 +23,8 @@
//#
//# $Id$
#ifndef LOFAR_BBSCONTROL_BBSSOLVERPROCESSCONTROL_H
#define LOFAR_BBSCONTROL_BBSSOLVERPROCESSCONTROL_H
#ifndef LOFAR_BBSCONTROL_SOLVERPROCESSCONTROL_H
#define LOFAR_BBSCONTROL_SOLVERPROCESSCONTROL_H
// \file
// Implementation of the ProcessControl interface for the BBS solver component.
......@@ -52,11 +52,11 @@ namespace BBS
// @{
// Implementation of the ProcessControl interface for the BBS solver component.
class BBSSolverProcessControl: public ACC::PLC::ProcessControl
class SolverProcessControl: public ACC::PLC::ProcessControl
{
public:
// Default constructor.
BBSSolverProcessControl();
SolverProcessControl();
// @name Implementation of PLC interface.
// @{
......
......@@ -39,26 +39,26 @@
//# Now here's an ugly kludge: libpqxx defines four different top-level
//# exception classes. In order to avoid a lot of code duplication we clumped
//# together four catch blocks in order to catch all pqxx related exceptions.
//# A BBSControlException will be thrown, containing the original pqxx
//# A DatabaseException will be thrown, containing the original pqxx
//# exception class type and the description.
#if defined(CATCH_PQXX_AND_RETHROW)
# error CATCH_PQXX_AND_RETHROW is already defined and should not be redefined
#else
# define CATCH_PQXX_AND_RETHROW \
# define CATCH_PQXX_AND_RETHROW \
catch (pqxx::broken_connection& e) { \
THROW (BBSControlException, "pqxx::broken_connection:\n" \
THROW (DatabaseException, "pqxx::broken_connection:\n" \
<< e.what()); \
} \
catch (pqxx::sql_error& e) { \
THROW (BBSControlException, "pqxx::sql_error:\n" \
THROW (DatabaseException, "pqxx::sql_error:\n" \
<< "Query: " << e.query() << endl << e.what()); \
} \
catch (pqxx::in_doubt_error& e) { \
THROW (BBSControlException, "pqxx::in_doubt_error:\n" \
THROW (DatabaseException, "pqxx::in_doubt_error:\n" \
<< e.what()); \
} \
catch (pqxx::internal_error& e) { \
THROW (BBSControlException, "pqxx::internal_error:\n" \
THROW (DatabaseException, "pqxx::internal_error:\n" \
<< e.what()); \
}
#endif
......@@ -78,7 +78,7 @@ namespace LOFAR
const string& host, const string& port) :
itsCurrentId(0)
{
LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW, "");
LOG_TRACE_LIFETIME(TRACE_LEVEL_COND, "");
string opts("dbname=" + dbname + " user=" + user +
" host=" + host + " port=" + port);
......@@ -89,9 +89,9 @@ namespace LOFAR
}
void CommandQueue::addStep(const BBSStep& aStep)
int CommandQueue::addStep(const BBSStep& aStep) const
{
LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW, "");
LOG_TRACE_LIFETIME(TRACE_LEVEL_COND, "");
ostringstream query;
try {
......@@ -127,13 +127,16 @@ namespace LOFAR
} catch (bad_cast&) {}
// Finalize the query.
query << ")";
query << ") AS command_id";
// Execute the query.
execQuery(query.str());
// Execute the query.
ParameterSet ps = execQuery(query.str());
// Return the ID of the step that we've just inserted.
return ps.getInt32("command_id");
} catch (bad_cast&) {
THROW (BBSControlException,
THROW (CommandQueueException,
"Step `" << aStep.getName() << "' is not a BBSSingleStep");
}
}
......@@ -141,7 +144,7 @@ namespace LOFAR
const BBSStep* CommandQueue::getNextStep()
{
LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW, "");
LOG_TRACE_LIFETIME(TRACE_LEVEL_COND, "");
// Compose the query.
ostringstream query;
......@@ -181,16 +184,14 @@ namespace LOFAR
ps.clear();
ps.adoptBuffer(buf, prefix);
// Create a BBSStep from the parameter set.
const BBSStep* step = BBSStep::create(name, ps, 0);
return step;
// return dynamic_cast<const BBSSingleStep*>(step);
// Create a BBSStep from the parameter set and return it.
return BBSStep::create(name, ps, 0);
}
void CommandQueue::setStrategy(const BBSStrategy& strategy)
void CommandQueue::setStrategy(const BBSStrategy& strategy) const
{
LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW, "");
LOG_TRACE_LIFETIME(TRACE_LEVEL_COND, "");
// Compose the query.
ostringstream query;
......@@ -204,16 +205,19 @@ namespace LOFAR
<< ",'" << strategy.domainSize().bandWidth << "'"
<< ",'" << strategy.domainSize().timeInterval << "'"
<< ",'" << strategy.correlation().selection << "'"
<< ",'" << strategy.correlation().type << "')";
<< ",'" << strategy.correlation().type << "')"
<< " AS result";
// Execute the query.
execQuery(query.str());
if (!execQuery(query.str()).getBool("result")) {
THROW (CommandQueueException, "Strategy can only be set once");
}
}
const BBSStrategy* CommandQueue::getStrategy()
const BBSStrategy* CommandQueue::getStrategy() const
{
LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW, "");
LOG_TRACE_LIFETIME(TRACE_LEVEL_COND, "");
// Compose the query.
ostringstream query;
......@@ -231,15 +235,31 @@ namespace LOFAR
}
bool CommandQueue::isNewRun(bool isLocalCtrl) const
{
LOG_TRACE_LIFETIME(TRACE_LEVEL_COND, "");
// Compose the query.
ostringstream query;
query << "SELECT * FROM blackboard.is_clean_startup('"
<< (isLocalCtrl ? "TRUE" : "FALSE")
<< "') AS result";
// Execute the query and return the result.
return execQuery(query.str()).getBool("result");
}
//##-------- P r i v a t e m e t h o d s --------##//
ParameterSet CommandQueue::execQuery(const string& query)
ParameterSet CommandQueue::execQuery(const string& query) const
{
// Create a transactor object and execute the query. The result will be
// stored, as a string in \a result.
string result;
try {
itsConnection->perform(ExecQuery(query, result));
LOG_TRACE_VAR_STR("Result of query: " << result);
} CATCH_PQXX_AND_RETHROW;
// Create an empty parameter set and add the result to it.
......
//# BBSControl.cc:
//# GlobalControl.cc:
//#
//# Copyright (C) 2002-2007
//# ASTRON (Netherlands Foundation for Research in Astronomy)
......@@ -22,7 +22,7 @@
#include <lofar_config.h>
#include <libgen.h>
#include <BBSControl/BBSProcessControl.h>
#include <BBSControl/GlobalProcessControl.h>
#include <PLC/ACCmain.h>
using namespace LOFAR;
......@@ -36,7 +36,7 @@ int main(int argc, char *argv[])
LOG_INFO_STR(progName << " is starting up ...");
try {
BBSProcessControl myProcess;
GlobalProcessControl myProcess;
int result = ACCmain(argc, argv, &myProcess);
if (result != 0) {
LOG_ERROR_STR("ACCmain returned with error status: " << result);
......
//# BBSStep.cc:
//# GlobalProcessControl.cc: Implementation of ACC/PLC ProcessControl class.
//#
//# Copyright (C) 2002-2007
//# ASTRON (Netherlands Foundation for Research in Astronomy)
......@@ -22,7 +22,7 @@
#include <lofar_config.h>
#include <BBSControl/BBSProcessControl.h>
#include <BBSControl/GlobalProcessControl.h>
#include <BBSControl/BBSStrategy.h>
#include <BBSControl/BBSStep.h>
#if 0
......@@ -43,7 +43,7 @@ namespace LOFAR
{
//##-------- P u b l i c m e t h o d s --------##//
BBSProcessControl::BBSProcessControl() :
GlobalProcessControl::GlobalProcessControl() :
ProcessControl(),
itsStrategy(0),
#if 0
......@@ -58,7 +58,7 @@ namespace LOFAR
}
BBSProcessControl::~BBSProcessControl()
GlobalProcessControl::~GlobalProcessControl()
{
LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW, "");
delete itsStrategy;
......@@ -71,10 +71,10 @@ namespace LOFAR
}
tribool BBSProcessControl::define()
tribool GlobalProcessControl::define()
{
LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW, "");
LOG_INFO("BBSProcessControl::define()");
LOG_INFO("GlobalProcessControl::define()");
try {
// Retrieve the strategy from the parameter set.
......@@ -97,18 +97,18 @@ namespace LOFAR
#endif
}
catch (Exception& e) {
LOG_ERROR_STR("Caught exception in BBSProcessControl::define()\n"
<< e);
LOG_ERROR_STR("Caught exception in GlobalProcessControl::define()\n"
<< e);
return false;
}
return true;
}
tribool BBSProcessControl::init()
tribool GlobalProcessControl::init()
{
LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW, "");
LOG_INFO("BBSProcessControl::init()");
LOG_INFO("GlobalProcessControl::init()");
try {
#if 0
......@@ -148,6 +148,11 @@ namespace LOFAR
// blackboard database.
itsCommandQueue =
new CommandQueue(globalParameterSet()->getString("BBDB.DBName"));
// Check if this is a new run. It usually is, but we might be resuming
// a paused run, or we might be recovering from a crash.
// itsIsNewRun = itsCommandQueue->isNewRun();
}
catch (Exception& e) {
LOG_ERROR_STR(e);
......@@ -158,10 +163,10 @@ namespace LOFAR
}
tribool BBSProcessControl::run()
tribool GlobalProcessControl::run()
{
LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW, "");
LOG_INFO("BBSProcessControl::run()");
LOG_INFO("GlobalProcessControl::run()");
try {
// Check pre-conditions
......@@ -214,8 +219,10 @@ namespace LOFAR
return false;
}
#endif
// Do some smart things.
// ...
// Wait for a trigger from the database to fetch the result
}
catch (Exception& e) {
......@@ -228,15 +235,15 @@ namespace LOFAR
}
tribool BBSProcessControl::quit()
tribool GlobalProcessControl::quit()
{
LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW, "");
LOG_INFO("BBSProcessControl::quit()");
LOG_INFO("GlobalProcessControl::quit()");
return true;
}
tribool BBSProcessControl::pause(const string& /*condition*/)
tribool GlobalProcessControl::pause(const string& /*condition*/)
{
LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW, "");
LOG_WARN("Not supported");
......@@ -244,7 +251,7 @@ namespace LOFAR
}
tribool BBSProcessControl::snapshot(const string& /*destination*/)
tribool GlobalProcessControl::snapshot(const string& /*destination*/)
{
LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW, "");
LOG_WARN("Not supported");
......@@ -252,7 +259,7 @@ namespace LOFAR
}
tribool BBSProcessControl::recover(const string& /*source*/)
tribool GlobalProcessControl::recover(const string& /*source*/)
{
LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW, "");
LOG_WARN("Not supported");
......@@ -260,14 +267,14 @@ namespace LOFAR
}
tribool BBSProcessControl::reinit(const string& /*configID*/)
tribool GlobalProcessControl::reinit(const string& /*configID*/)
{
LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW, "");
LOG_WARN("Not supported");
return false;
}
string BBSProcessControl::askInfo(const string& /*keylist*/)
string GlobalProcessControl::askInfo(const string& /*keylist*/)
{
LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW, "");
LOG_WARN("Not supported");
......@@ -278,7 +285,7 @@ namespace LOFAR
//##-------- P r i v a t e m e t h o d s --------##//
#if 0
bool BBSProcessControl::sendObject(const BlobStreamable& bs)
bool GlobalProcessControl::sendObject(const BlobStreamable& bs)
{
LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW, "");
try {
......@@ -301,7 +308,7 @@ namespace LOFAR
}
BlobStreamable* BBSProcessControl::recvObject()
BlobStreamable* GlobalProcessControl::recvObject()
{
LOG_TRACE_LIFETIME(TRACE_LEVEL_FLOW, "");
try {
......
//# BBSKernel.cc: minimal control wrapper around the kernel
//# KernelControl.cc: minimal control wrapper around the kernel
//#
//# Copyright (C) 2002-2007
//# ASTRON (Netherlands Foundation for Research in Astronomy)
......@@ -22,7 +22,7 @@
#include <lofar_config.h>
#include <libgen.h>
#include <BBSControl/BBSKernelProcessControl.h>
#include <BBSControl/KernelProcessControl.h>
#include <PLC/ACCmain.h>
using namespace LOFAR;
......@@ -36,7 +36,7 @@ int main(int argc, char *argv[])
LOG_INFO_STR(progName << " is starting up ...");
try {
BBSKernelProcessControl myProcess;
KernelProcessControl myProcess;
int result = ACCmain(argc, argv, &myProcess);
if (result != 0) {
LOG_ERROR_STR("ACCmain returned with error status: " << result);
......
//# BBSKernelProcessControl.cc:
//# KernelProcessControl.cc:
//#
//# Copyright (C) 2002-2007
//# ASTRON (Netherlands Foundation for Research in Astronomy)
......@@ -25,7 +25,7 @@
//# Always #include <lofar_config.h> first!
#include <lofar_config.h>
#include <BBSControl/BBSKernelProcessControl.h>
#include <BBSControl/KernelProcessControl.h>
#include <BBSControl/BBSStrategy.h>
#include <BBSControl/BBSStep.h>
#include <BBSControl/BBSPredictStep.h>
......@@ -73,7 +73,7 @@ namespace BBS
//##---- P u b l i c m e t h o d s ----##//
BBSKernelProcessControl::BBSKernelProcessControl() :
KernelProcessControl::KernelProcessControl() :
ProcessControl(),
itsPrediffer(0)
{
......@@ -81,9 +81,9 @@ namespace BBS
}
tribool BBSKernelProcessControl::define()
tribool KernelProcessControl::define()
{
LOG_DEBUG("BBSKernelProcessControl::define()");
LOG_DEBUG("KernelProcessControl::define()");
try {
itsControllerConnection.reset(new BlobStreamableConnection(
......@@ -108,9 +108,9 @@ namespace BBS
}
tribool BBSKernelProcessControl::init()
tribool KernelProcessControl::init()
{
LOG_DEBUG("BBSKernelProcessControl::init()");
LOG_DEBUG("KernelProcessControl::init()");
try {
LOG_DEBUG_STR("Trying to connect to controller@" << globalParameterSet()->getString("Controller.Host") << ":" << globalParameterSet()->getString("Controller.Port" ) << "...");
......@@ -141,9 +141,9 @@ namespace BBS
}
tribool BBSKernelProcessControl::run()
tribool KernelProcessControl::run()
{
LOG_DEBUG("BBSKernelProcessControl::run()");
LOG_DEBUG("KernelProcessControl::run()");
try
{
......@@ -163,7 +163,7 @@ namespace BBS
}
tribool BBSKernelProcessControl::pause(const string& /*condition*/)
tribool KernelProcessControl::pause(const string& /*condition*/)
{
LOG_TRACE_FLOW(AUTO_FUNCTION_NAME);
LOG_WARN("Not supported");
......@@ -171,14 +171,14 @@ namespace BBS
}
tribool BBSKernelProcessControl::quit()
tribool KernelProcessControl::quit()
{
LOG_DEBUG("BBSKernelProcessControl::quit()");
LOG_DEBUG("KernelProcessControl::quit()");
return true;
}
tribool BBSKernelProcessControl::snapshot(const string& /*destination*/)
tribool KernelProcessControl::snapshot(const string& /*destination*/)
{
LOG_TRACE_FLOW(AUTO_FUNCTION_NAME);
LOG_WARN("Not supported");
......@@ -186,7 +186,7 @@ namespace BBS
}
tribool BBSKernelProcessControl::recover(const string& /*source*/)
tribool KernelProcessControl::recover(const string& /*source*/)
{
LOG_TRACE_FLOW(AUTO_FUNCTION_NAME);
LOG_WARN("Not supported");
......@@ -194,7 +194,7 @@ namespace BBS
}
tribool BBSKernelProcessControl::reinit(const string& /*configID*/)
tribool KernelProcessControl::reinit(const string& /*configID*/)
{
LOG_TRACE_FLOW(AUTO_FUNCTION_NAME);
LOG_WARN("Not supported");
......@@ -202,7 +202,7 @@ namespace BBS
}
std::string BBSKernelProcessControl::askInfo(const string& /*keylist*/)
std::string KernelProcessControl::askInfo(const string& /*keylist*/)
{
LOG_TRACE_FLOW(AUTO_FUNCTION_NAME);
return std::string("");
......@@ -210,7 +210,7 @@ namespace BBS
//##---- P r i v a t e m e t h o d s ----##//
bool BBSKernelProcessControl::dispatch(const BlobStreamable *message)
bool KernelProcessControl::dispatch(const BlobStreamable *message)
{
// If the message contains a `strategy', handle the `strategy'.
const BBSStrategy *strategy = dynamic_cast<const BBSStrategy*>(message);
......@@ -254,7 +254,7 @@ namespace BBS
}
bool BBSKernelProcessControl::handle(const BBSStrategy *strategy)
bool KernelProcessControl::handle(const BBSStrategy *strategy)
{
LOG_TRACE_FLOW(AUTO_FUNCTION_NAME);
......@@ -340,7 +340,7 @@ namespace BBS
}
bool BBSKernelProcessControl::handle(const BBSStep *bs)
bool KernelProcessControl::handle(const BBSStep *bs)
{
LOG_TRACE_FLOW(AUTO_FUNCTION_NAME);
......@@ -388,7 +388,7 @@ namespace BBS
}
bool BBSKernelProcessControl::handle(const BBSPredictStep *step)
bool KernelProcessControl::handle(const BBSPredictStep *step)
{
LOG_TRACE_FLOW(AUTO_FUNCTION_NAME);
ASSERTSTR(itsPrediffer, "No Prediffer available.");
......@@ -413,7 +413,7 @@ namespace BBS
}
bool BBSKernelProcessControl::handle(const BBSSubtractStep *step)
bool KernelProcessControl::handle(const BBSSubtractStep *step)
{
ASSERTSTR(itsPrediffer, "No Prediffer available.");
ASSERTSTR(step, "Step corrupted.");
......@@ -437,7 +437,7 @@ namespace BBS
}
bool BBSKernelProcessControl::handle(const BBSCorrectStep *step)
bool KernelProcessControl::handle(const BBSCorrectStep *step)
{
ASSERTSTR(itsPrediffer, "No Prediffer available.");
ASSERTSTR(step, "Step corrupted.");
......@@ -461,7 +461,7 @@ namespace BBS
}
bool BBSKernelProcessControl::handle(const BBSSolveStep *step)
bool KernelProcessControl::handle(const BBSSolveStep *step)
{
NSTimer timer;
......
lib_LTLIBRARIES = libbbscontrol.la
lib_LTLIBRARIES = libbbscontrol.la
libbbscontrol_la_SOURCES= \
libbbscontrol_la_SOURCES = \
BBSCorrectStep.cc \
BBSKernelProcessControl.cc \
BBSMultiStep.cc \
BBSPredictStep.cc \
BBSProcessControl.cc \
BBSRefitStep.cc \
BBSShiftStep.cc \
BBSSingleStep.cc \
......@@ -14,27 +12,29 @@ libbbscontrol_la_SOURCES= \
BBSStrategy.cc \
BBSStructs.cc \
BBSSubtractStep.cc \
BBSSolverProcessControl.cc \
BlobStreamableConnection.cc \
DomainRegistrationRequest.cc \
CommandQueue.cc \
CommandQueueTransactors.cc \
GlobalProcessControl.cc \
IterationRequest.cc \
IterationResult.cc \
pqutil.cc
KernelProcessControl.cc \
pqutil.cc \
SolverProcessControl.cc
bin_PROGRAMS = BBSControl BBSKernel BBSSolver
bin_PROGRAMS = GlobalControl KernelControl SolverControl
BBSControl_SOURCES = BBSControl.cc
BBSControl_LDADD = libbbscontrol.la
BBSControl_DEPENDENCIES = libbbscontrol.la $(LOFAR_DEPEND)
GlobalControl_SOURCES = GlobalControl.cc
GlobalControl_LDADD = libbbscontrol.la
GlobalControl_DEPENDENCIES = libbbscontrol.la $(LOFAR_DEPEND)
BBSKernel_SOURCES = BBSKernel.cc
BBSKernel_LDADD = libbbscontrol.la
BBSKernel_DEPENDENCIES = libbbscontrol.la $(LOFAR_DEPEND)
KernelControl_SOURCES = KernelControl.cc
KernelControl_LDADD = libbbscontrol.la
KernelControl_DEPENDENCIES = libbbscontrol.la $(LOFAR_DEPEND)
BBSSolver_SOURCES = BBSSolver.cc
BBSSolver_LDADD = libbbscontrol.la
BBSSolver_DEPENDENCIES = libbbscontrol.la $(LOFAR_DEPEND)
SolverControl_SOURCES = SolverControl.cc
SolverControl_LDADD = libbbscontrol.la
SolverControl_DEPENDENCIES = libbbscontrol.la $(LOFAR_DEPEND)
include $(top_srcdir)/Makefile.common
//# BBSSolver.cc: main solver process
//# SolverControl.cc: main solver process
//#
//# Copyright (C) 2004
//# ASTRON (Netherlands Foundation for Research in Astronomy)
......@@ -22,7 +22,7 @@
#include <lofar_config.h>
#include <libgen.h>
#include <BBSControl/BBSSolverProcessControl.h>
#include <BBSControl/SolverProcessControl.h>
#include <PLC/ACCmain.h>
using namespace LOFAR;
......@@ -36,7 +36,7 @@ int main(int argc, char *argv[])
LOG_INFO_STR(progName << " is starting up ...");
try {
BBSSolverProcessControl myProcess;
SolverProcessControl myProcess;
int result = ACCmain(argc, argv, &myProcess);
if (result != 0) {
LOG_ERROR_STR("ACCmain returned with error status: " << result);
......
//# BBSSolverProcessControl.h: Implementation of the ProcessControl
//# SolverProcessControl.h: Implementation of the ProcessControl
//# interface for the BBS solver component.
//#
//# Copyright (C) 2004
......@@ -26,7 +26,7 @@
//# Always #include <lofar_config.h> first!
#include <lofar_config.h>
#include <BBSControl/BBSSolverProcessControl.h>
#include <BBSControl/SolverProcessControl.h>
#include <BBSControl/BlobStreamableConnection.h>
#include <APS/ParameterSet.h>
......@@ -56,16 +56,16 @@ namespace BBS
//##---- P u b l i c m e t h o d s ----##//
BBSSolverProcessControl::BBSSolverProcessControl() :
SolverProcessControl::SolverProcessControl() :
ProcessControl()
{
LOG_TRACE_FLOW(AUTO_FUNCTION_NAME);
}
tribool BBSSolverProcessControl::define()
tribool SolverProcessControl::define()
{
LOG_INFO("BBSSolverProcessControl::define()");
LOG_INFO("SolverProcessControl::define()");
try
{
......@@ -74,7 +74,7 @@ namespace BBS
string userString(user);
itsKernelConnection.reset(new BlobStreamableConnection(
"=BBSSolver_" + userString,
"=Solver_" + userString,
Socket::LOCAL));
}
catch(Exception& e)
......@@ -87,9 +87,9 @@ namespace BBS
}
tribool BBSSolverProcessControl::init()
tribool SolverProcessControl::init()
{
LOG_INFO("BBSSolverProcessControl::init()");
LOG_INFO("SolverProcessControl::init()");
try
{
LOG_INFO("Starting to listen at solver@localhost");
......@@ -111,9 +111,9 @@ namespace BBS
}
tribool BBSSolverProcessControl::run()
tribool SolverProcessControl::run()
{
LOG_INFO("BBSSolverProcessControl::run()");
LOG_INFO("SolverProcessControl::run()");
try
{
......@@ -132,7 +132,7 @@ namespace BBS
}
tribool BBSSolverProcessControl::pause(const string& /*condition*/)
tribool SolverProcessControl::pause(const string& /*condition*/)
{
LOG_TRACE_FLOW(AUTO_FUNCTION_NAME);
LOG_WARN("Not supported");
......@@ -140,14 +140,14 @@ namespace BBS
}
tribool BBSSolverProcessControl::quit()
tribool SolverProcessControl::quit()
{
LOG_INFO("BBSSolverProcessControl::quit()");
LOG_INFO("SolverProcessControl::quit()");
return true;
}
tribool BBSSolverProcessControl::snapshot(const string& /*destination*/)
tribool SolverProcessControl::snapshot(const string& /*destination*/)
{
LOG_TRACE_FLOW(AUTO_FUNCTION_NAME);
LOG_WARN("Not supported");
......@@ -155,7 +155,7 @@ namespace BBS
}
tribool BBSSolverProcessControl::recover(const string& /*source*/)
tribool SolverProcessControl::recover(const string& /*source*/)
{
LOG_TRACE_FLOW(AUTO_FUNCTION_NAME);
LOG_WARN("Not supported");
......@@ -163,7 +163,7 @@ namespace BBS
}
tribool BBSSolverProcessControl::reinit(const string& /*configID*/)
tribool SolverProcessControl::reinit(const string& /*configID*/)
{
LOG_TRACE_FLOW(AUTO_FUNCTION_NAME);
LOG_WARN("Not supported");
......@@ -171,14 +171,14 @@ namespace BBS
}
std::string BBSSolverProcessControl::askInfo(const string& /*keylist*/)
std::string SolverProcessControl::askInfo(const string& /*keylist*/)
{
LOG_TRACE_FLOW(AUTO_FUNCTION_NAME);
return std::string("");
}
bool BBSSolverProcessControl::dispatch(const BlobStreamable *message)
bool SolverProcessControl::dispatch(const BlobStreamable *message)
{
{
const DomainRegistrationRequest *request = dynamic_cast<const DomainRegistrationRequest*>(message);
......@@ -210,13 +210,13 @@ namespace BBS
}
bool BBSSolverProcessControl::handle(const DomainRegistrationRequest *request)
bool SolverProcessControl::handle(const DomainRegistrationRequest *request)
{
return registerDomain(request);
}
bool BBSSolverProcessControl::handle(const BlobStreamableVector<DomainRegistrationRequest> *request)
bool SolverProcessControl::handle(const BlobStreamableVector<DomainRegistrationRequest> *request)
{
bool result = true;
for(vector<DomainRegistrationRequest*>::const_iterator it = request->getVector().begin();
......@@ -229,14 +229,14 @@ namespace BBS
}
bool BBSSolverProcessControl::handle(const IterationRequest *request)
bool SolverProcessControl::handle(const IterationRequest *request)
{
scoped_ptr<IterationResult> result(performIteration(request));
return itsKernelConnection->sendObject(*result.get());
}
bool BBSSolverProcessControl::handle(const BlobStreamableVector<IterationRequest> *request)
bool SolverProcessControl::handle(const BlobStreamableVector<IterationRequest> *request)
{
BlobStreamableVector<IterationResult> result;
......@@ -251,7 +251,7 @@ namespace BBS
}
bool BBSSolverProcessControl::registerDomain(const DomainRegistrationRequest *request)
bool SolverProcessControl::registerDomain(const DomainRegistrationRequest *request)
{
LOG_DEBUG_STR("DomainRegistrationRequest: index: " << request->getDomainIndex() << " #unknowns: " << request->getUnknowns().size());
LOG_DEBUG_STR("+ unknowns: " << request->getUnknowns());
......@@ -274,7 +274,7 @@ namespace BBS
}
IterationResult *BBSSolverProcessControl::performIteration(const IterationRequest *request)
IterationResult *SolverProcessControl::performIteration(const IterationRequest *request)
{
map<uint32, Domain>::iterator it = itsRegisteredDomains.find(request->getDomainIndex());
//ASSERT(it != itsRegisteredDomains.end());
......
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