Commit 0cb7a5be authored by Luciano Orsini's avatar Luciano Orsini
Browse files

references #239: change of scatter gather parameters

parent 9355d96a
......@@ -138,9 +138,9 @@ namespace gevb2g
void clear ();
bool stopped_; // indicates when the BU has to halt
xdata::UnsignedLong availableFrameSize_;
size_t availableFrameSize_;
//xdata::UnsignedLong samples_;
size_t maxResourcesPerFrame_;
xdata::UnsignedLong maxResourcesPerFrame_; // use to calculate availableFrameSize_
xdata::UnsignedLong maxResources_;
xdata::UnsignedLong maxDataFrameSize_;
size_t maxFragments_;
......
......@@ -62,8 +62,8 @@ namespace gevb2g
toolbox::rlist<unsigned long> * triggerQueue_;
toolbox::rlist<BUResourceDescriptor> * resourceQueue_;
unsigned long maxGatherRequests_; // derived from shipFrameSize_
xdata::UnsignedLong shipFrameSize_; // in bytes
xdata::UnsignedLong maxGatherRequests_; // use to calculate shipFrameSize_
unsigned long shipFrameSize_;
xdata::UnsignedLong resourceQueueSize_;
xdata::UnsignedLong triggerQueueSize_;
unsigned long consumedTriggers_;
......
......@@ -19,9 +19,9 @@
#include "config/PackageInfo.h"
// !!! Edit this line to reflect the latest package version !!!
#define WORKSUITE_GEVB2G_VERSION_MAJOR 2
#define WORKSUITE_GEVB2G_VERSION_MINOR 1
#define WORKSUITE_GEVB2G_VERSION_PATCH 3
#define WORKSUITE_GEVB2G_VERSION_MAJOR 3
#define WORKSUITE_GEVB2G_VERSION_MINOR 0
#define WORKSUITE_GEVB2G_VERSION_PATCH 0
// If any previous versions available E.g. #define GEVB2GPREVIOUS_VERSIONS "3.8.0,3.8.1"
#undef WORKSUITE_GEVB2G_PREVIOUS_VERSIONS
......
......@@ -44,7 +44,8 @@ gevb2g::BU::BU (xdaq::ApplicationStub* c)
index_ = 0;
maxResources_ = 256;
availableFrameSize_ = 1024;
availableFrameSize_ = 0;
maxResourcesPerFrame_ = 1;
maxDataFrameSize_ = 4096;
filterDisable_ = true;
......@@ -68,7 +69,7 @@ gevb2g::BU::BU (xdaq::ApplicationStub* c)
// export variables to control client
//getApplicationInfoSpace()->fireItemAvailable ("samples", &samples_);
getApplicationInfoSpace()->fireItemAvailable("maxResources", &maxResources_);
getApplicationInfoSpace()->fireItemAvailable("availableFrameSize", &availableFrameSize_);
getApplicationInfoSpace()->fireItemAvailable("maxResourcesPerFrame", &maxResourcesPerFrame_);
getApplicationInfoSpace()->fireItemAvailable("maxDataFrameSize", &maxDataFrameSize_);
getApplicationInfoSpace()->fireItemAvailable("filterDisable", &filterDisable_);
getApplicationInfoSpace()->fireItemAvailable("frameRecvCounter", &frameRecvCounter_);
......@@ -602,13 +603,16 @@ xoap::MessageReference gevb2g::BU::Configure (xoap::MessageReference message)
{
this->state_ = "Configuring";
eventRate_ = 0;
maxResourcesPerFrame_ = (availableFrameSize_ - (sizeof(I2O_AVAILABLE_MESSAGE_FRAME) + sizeof(ShipRequest))) / sizeof(ShipRequest);
//maxResourcesPerFrame_ = (availableFrameSize_ - (sizeof(I2O_AVAILABLE_MESSAGE_FRAME) + sizeof(ShipRequest))) / sizeof(ShipRequest);
if (maxResourcesPerFrame_ > maxResources_)
{
LOG4CPLUS_WARN(this->getApplicationLogger(), "optimized configuration: number of resources " << maxResources_ << " was not sufficient to fill 'available' frame, set to max resources " << maxResourcesPerFrame_);
maxResourcesPerFrame_ = maxResources_;
}
availableFrameSize_ = (maxResourcesPerFrame_ * sizeof(ShipRequest)) + (sizeof(I2O_AVAILABLE_MESSAGE_FRAME) - sizeof(ShipRequest));
availableRef_ = 0;
frameRecvCounter_ = 0;
......
......@@ -37,10 +37,9 @@ gevb2g::EVM::EVM (xdaq::ApplicationStub* c)
xoap::bind(this, &gevb2g::EVM::Halt, "Halt", XDAQ_NS_URI);
triggerQueue_ = toolbox::rlist<unsigned long>::create("EVM/triggerQueue_");
resourceQueue_ = toolbox::rlist<BUResourceDescriptor>::create("EVM/resourceQueue_");
resourceQueue_ = toolbox::rlist<BUResourceDescriptor>::create("EVM/resourceQueue_");
bxCounter_ = 0;
shipFrameSize_ = 0;
resourceQueueSize_ = 0;
triggerQueueSize_ = 0;
triggerDisable_ = 1;
......@@ -50,11 +49,15 @@ gevb2g::EVM::EVM (xdaq::ApplicationStub* c)
triggerClassInstance_ = 0;
triggerClassName_ = "unknown";
this->state_ = "uninitialized";
maxGatherRequests_ = 1;
shipFrameSize_ = 0;
createPool_ = true;
poolName_ = "evmPool";
getApplicationInfoSpace()->fireItemAvailable("shipFrameSize", &shipFrameSize_);
getApplicationInfoSpace()->fireItemAvailable("maxGatherRequests", &maxGatherRequests_);
getApplicationInfoSpace()->fireItemAvailable("resourceQueueSize", &resourceQueueSize_);
getApplicationInfoSpace()->fireItemAvailable("triggerQueueSize", &triggerQueueSize_);
getApplicationInfoSpace()->fireItemAvailable("triggerDisable", &triggerDisable_);
......@@ -140,7 +143,9 @@ xoap::MessageReference gevb2g::EVM::Configure (xoap::MessageReference message)
triggerQueue_->resize(triggerQueueSize_);
resourceQueue_->resize(resourceQueueSize_);
maxGatherRequests_ = (shipFrameSize_ - (sizeof(I2O_SHIP_FRAGMENTS_MESSAGE_FRAME) + sizeof(ShipRequest))) / sizeof(ShipRequest);
//maxGatherRequests_ = (shipFrameSize_ - (sizeof(I2O_SHIP_FRAGMENTS_MESSAGE_FRAME) + sizeof(ShipRequest))) / sizeof(ShipRequest);
shipFrameSize_ = (maxGatherRequests_ * sizeof(ShipRequest)) + (sizeof(I2O_SHIP_FRAGMENTS_MESSAGE_FRAME) - sizeof(ShipRequest));
if (triggerDisable_)
{
......@@ -426,7 +431,7 @@ void gevb2g::EVM::multiCast (toolbox::mem::Reference * ref)
framePtr->PvtMessageFrame.StdMessageFrame.VersionOffset = 0;
// xdaq::frameSend(copyRef);
ref->setDataSize(shipFrameSize_);
copyRef->setDataSize(shipFrameSize_);
LOG4CPLUS_DEBUG(this->getApplicationLogger(), toolbox::toString("send to RU tid: %d requests: %d", ruTid_[i], framePtr->fragments));
try
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment