Commit 4bde8d6c authored by Andrea Petrucci's avatar Andrea Petrucci
Browse files

references #226: fixed gevb2g running ru and bu same process

parent a43afde2
......@@ -55,7 +55,7 @@ LibraryDirs =
UserSourcePath =
UserCFlags =
UserCCFlags = -O1 -fthread-jumps -falign-functions -falign-jumps -falign-loops -falign-labels -fcaller-saves -fcrossjumping -fcse-follow-jumps -fcse-skip-blocks -fdelete-null-pointer-checks -fexpensive-optimizations -fgcse -fgcse-lm -findirect-inlining -foptimize-sibling-calls -fpeephole2 -fregmove -freorder-blocks -freorder-functions -frerun-cse-after-loop -fsched-interblock -fsched-spec -fschedule-insns -fschedule-insns2 -fstrict-overflow -ftree-switch-conversion -ftree-pre -ftree-vrp
#UserCCFlags = -O1 -fthread-jumps -falign-functions -falign-jumps -falign-loops -falign-labels -fcaller-saves -fcrossjumping -fcse-follow-jumps -fcse-skip-blocks -fdelete-null-pointer-checks -fexpensive-optimizations -fgcse -fgcse-lm -findirect-inlining -foptimize-sibling-calls -fpeephole2 -fregmove -freorder-blocks -freorder-functions -frerun-cse-after-loop -fsched-interblock -fsched-spec -fschedule-insns -fschedule-insns2 -fstrict-overflow -ftree-switch-conversion -ftree-pre -ftree-vrp
#UserCCFlags = -fthread-jumps -falign-functions -falign-loops -fcaller-saves -fcrossjumping -fcse-follow-jumps -fdelete-null-pointer-checks -fexpensive-optimizations -fgcse -findirect-inlining -foptimize-sibling-calls -fpeephole2 -fregmove -freorder-blocks -frerun-cse-after-loop -fsched-interblock -fschedule-insns -ftree-switch-conversion -ftree-pre -ftree-vrp
UserDynamicLinkFlags =
......@@ -76,7 +76,6 @@ StaticLibrary=
TestLibraries=
TestExecutables=
DependentLibraries += boost_thread
include $(XDAQ_ROOT)/$(BUILD_SUPPORT)/Makefile.rules
include $(XDAQ_ROOT)/$(BUILD_SUPPORT)/mfRPM.rules
......@@ -435,8 +435,8 @@ void gevb2g::BU::cache (toolbox::mem::Reference* ref)
PI2O_CACHE_MESSAGE_FRAME frame = (PI2O_CACHE_MESSAGE_FRAME) current->getDataLocation();
size_t size = frame->PvtMessageFrame.StdMessageFrame.MessageSize << 2;
lastReceivedFrameSize_ = size;
LOG4CPLUS_DEBUG(this->getApplicationLogger(), toolbox::toString("element totalLength: %d partLength: %d, resourceId: %d", frame->totalLength, frame->partLength, frame->resourceId));
LOG4CPLUS_DEBUG(this->getApplicationLogger(), toolbox::toString("Recieved element totalLength: %d partLength: %d, resourceId: %d, context: %d", frame->totalLength, frame->partLength, frame->resourceId,frame->context));
size_t resourceId = frame->resourceId;
//
// SGL MTU Size check???
//
......@@ -450,19 +450,19 @@ void gevb2g::BU::cache (toolbox::mem::Reference* ref)
return;
}
LOG4CPLUS_DEBUG(this->getApplicationLogger(), toolbox::toString("received %d sgl elements", frame->elements));
//LOG4CPLUS_DEBUG(this->getApplicationLogger(), toolbox::toString("received %d sgl elements", frame->elements));
bool completed = false;
try
{
completed = resourcePool_->appendZeroCopy(frame->resourceId, frame->fragmentId, current, frame->partLength, frame->totalLength, (unsigned long) frame->PvtMessageFrame.StdMessageFrame.InitiatorAddress, frame->context, sizeof(I2O_CACHE_MESSAGE_FRAME)); // last param is offset to data
completed = resourcePool_->appendZeroCopy(resourceId, frame->fragmentId, current, frame->partLength, frame->totalLength, (unsigned long) frame->PvtMessageFrame.StdMessageFrame.InitiatorAddress, frame->context, sizeof(I2O_CACHE_MESSAGE_FRAME)); // last param is offset to data
}
catch (...)
{
LOG4CPLUS_FATAL(this->getApplicationLogger(), toolbox::toString("bu[%d] fragmentId:%d resourceId:%d totalLength:%d partLength:%d, received from tid %d", this->getApplicationDescriptor()->getInstance(), frame->fragmentId, frame->resourceId, frame->totalLength, frame->partLength, frame->PvtMessageFrame.StdMessageFrame.InitiatorAddress));
LOG4CPLUS_FATAL(this->getApplicationLogger(), toolbox::toString("bu[%d] fragmentId:%d resourceId:%d totalLength:%d partLength:%d, received from tid %d", this->getApplicationDescriptor()->getInstance(), frame->fragmentId, resourceId, frame->totalLength, frame->partLength, frame->PvtMessageFrame.StdMessageFrame.InitiatorAddress));
resourcePool_->showFragmentHistory(frame->resourceId, frame->fragmentId);
resourcePool_->showFragmentHistory(resourceId, frame->fragmentId);
ref->release();
......@@ -473,7 +473,7 @@ void gevb2g::BU::cache (toolbox::mem::Reference* ref)
if (completed)
{
LOG4CPLUS_DEBUG(this->getApplicationLogger(), toolbox::toString("fragment %d completed", frame->resourceId));
LOG4CPLUS_DEBUG(this->getApplicationLogger(), toolbox::toString("fragment %d completed", resourceId));
completed = false;
//dataPf_->addSample(resourcePool_->size(frame->resourceId));
......@@ -506,14 +506,14 @@ void gevb2g::BU::cache (toolbox::mem::Reference* ref)
}
*/
resourcePool_->clear(frame->resourceId);
resourcePool_->clear(resourceId);
U32 ctx = getContext();
resourcePool_->available(frame->resourceId, ctx);
this->available(frame->resourceId, ctx);
resourcePool_->available(resourceId, ctx);
this->available(resourceId, ctx);
}
else
{
eventCompleted_->push_back(frame->resourceId);
eventCompleted_->push_back(resourceId);
this->matchFilterRequests();
}
}
......@@ -549,7 +549,7 @@ void gevb2g::BU::available (U32 freeResourceId, U32 context)
framePtr = (PI2O_AVAILABLE_MESSAGE_FRAME) availableRef_->getDataLocation();
framePtr->resource[framePtr->resources].resourceId = freeResourceId;
framePtr->resource[framePtr->resources].context = context;
LOG4CPLUS_DEBUG(getApplicationLogger(), "before sending available resources " << framePtr->resources << " context" << framePtr->resource[framePtr->resources].context);
LOG4CPLUS_DEBUG(getApplicationLogger(), "before sending available resources at index: " << framePtr->resources << " resource id: " << freeResourceId <<" context" << framePtr->resource[framePtr->resources].context);
framePtr->resources++;
if (framePtr->resources >= maxResourcesPerFrame_)
......@@ -707,7 +707,7 @@ void gevb2g::BU::clear ()
U32 gevb2g::BU::getContext ()
{
U32 ctx = (this->getApplicationDescriptor()->getInstance() << 16) + (context_++ & 0x0000ffff);
LOG4CPLUS_DEBUG(this->getApplicationLogger(), toolbox::toString("generated context: %08x", ctx));
LOG4CPLUS_DEBUG(this->getApplicationLogger(), toolbox::toString("generated context: %d", ctx));
return (ctx);
}
......
......@@ -357,7 +357,7 @@ toolbox::mem::Reference * gevb2g::InputEmulator::createData (U32 bx, ErrorType i
{
while (pool_->isLowThresholdExceeded())
{
LOG4CPLUS_DEBUG(getApplicationLogger(), "yield till low threshold reached");
//LOG4CPLUS_DEBUG(getApplicationLogger(), "yield till low threshold reached");
//this->yield(1);
//std::cout << ".";
::sched_yield();
......
......@@ -282,11 +282,11 @@ void gevb2g::RU::shipFragments (toolbox::mem::Reference * ref)
}
PI2O_SHIP_FRAGMENTS_MESSAGE_FRAME frame = (PI2O_SHIP_FRAGMENTS_MESSAGE_FRAME) ref->getDataLocation();
LOG4CPLUS_DEBUG(getApplicationLogger(), toolbox::toString("shipFragments: %d", frame->fragments));
//LOG4CPLUS_DEBUG(getApplicationLogger(), toolbox::toString("shipFragments: %d", frame->fragments));
for (size_t i = 0; i < frame->fragments; i++)
{
LOG4CPLUS_DEBUG(getApplicationLogger(), toolbox::toString("shipFragments: destination %d bx: %d resourceId:%d context: %x", frame->request[i].destination, frame->request[i].bx, frame->request[i].resourceId, frame->request[i].context));
LOG4CPLUS_DEBUG(getApplicationLogger(), toolbox::toString("shipFragments: destination %d bx: %d resourceId:%d context: %d", frame->request[i].destination, frame->request[i].bx, frame->request[i].resourceId, frame->request[i].context));
try
{
......
......@@ -198,7 +198,7 @@ bool gevb2g::ResourcePool::appendZeroCopy (size_t r, size_t f, toolbox::mem::Ref
if (resourceTable_[r].context != context)
{
std::stringstream msg;
msg << toolbox::toString("resource context clash, expected context is: %08x,received context was:%08x", resourceTable_[r].context, context);
msg << toolbox::toString("resource context clash resource id: %d, expected context is: %d,received context was:%d",r, resourceTable_[r].context, context);
LOG4CPLUS_ERROR(this->getOwnerApplication()->getApplicationLogger(), msg.str());
XCEPT_RAISE(xdaq::exception::Exception, msg.str());
}
......
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