Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monitoring service changes for DAQ: rebase (80X) #12245

Merged
merged 2 commits into from
Nov 5, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions EventFilter/Utilities/interface/FastMonitoringService.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,15 @@ namespace evf{
return (it!=quickReference_.end()) ? (*it).second : 0;
}
const void* decode(unsigned int index){return decoder_[index];}
void fillReserved(void* add, unsigned int i){
void fillReserved(const void* add, unsigned int i){
// translation_[*name]=current_;
quickReference_[add]=i;
if(decoder_.size()<=i)
decoder_.push_back(add);
else
decoder_[currentReserved_] = add;
}
void updateReserved(void* add){
void updateReserved(const void* add){
fillReserved(add,currentReserved_);
currentReserved_++;
}
Expand All @@ -86,7 +86,7 @@ namespace evf{
for(unsigned int i = currentReserved_; i<reserved_; i++)
fillReserved(dummiesForReserved_+i,i);
}
void update(void* add){
void update(const void* add){
// translation_[*name]=current_;
quickReference_[add]=current_;
decoder_.push_back(add);
Expand Down
24 changes: 11 additions & 13 deletions EventFilter/Utilities/src/FastMonitoringService.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ using namespace jsoncollector;

constexpr double throughputFactor() {return (1000000)/double(1024*1024);}

#define NRESERVEDMODULES 33
#define NSPECIALMODULES 7
#define NRESERVEDPATHS 1
static const int nReservedModules = 64;
static const int nSpecialModules = 7;
static const int nReservedPaths = 1;

namespace evf{

Expand All @@ -37,7 +37,7 @@ namespace evf{
FastMonitoringService::FastMonitoringService(const edm::ParameterSet& iPS,
edm::ActivityRegistry& reg) :
MicroStateService(iPS,reg)
,encModule_(NRESERVEDMODULES)
,encModule_(nReservedModules)
,nStreams_(0)//until initialized
,sleepTime_(iPS.getUntrackedParameter<int>("sleepTime", 1))
,fastMonIntervals_(iPS.getUntrackedParameter<unsigned int>("fastMonIntervals", 1))
Expand Down Expand Up @@ -88,8 +88,8 @@ namespace evf{
std::string FastMonitoringService::makePathLegendaJson() {
Json::Value legendaVector(Json::arrayValue);
for(int i = 0; i < encPath_[0].current_; i++)
legendaVector.append(Json::Value(*((std::string *)(encPath_[0].decode(i)))));
Json::Value valReserved(NRESERVEDPATHS);
legendaVector.append(Json::Value(*(static_cast<const std::string *>(encPath_[0].decode(i)))));
Json::Value valReserved(nReservedPaths);
Json::Value pathLegend;
pathLegend["names"]=legendaVector;
pathLegend["reserved"]=valReserved;
Expand All @@ -100,9 +100,9 @@ namespace evf{
std::string FastMonitoringService::makeModuleLegendaJson(){
Json::Value legendaVector(Json::arrayValue);
for(int i = 0; i < encModule_.current_; i++)
legendaVector.append(Json::Value(((const edm::ModuleDescription *)(encModule_.decode(i)))->moduleLabel()));
Json::Value valReserved(NRESERVEDMODULES);
Json::Value valSpecial(NSPECIALMODULES);
legendaVector.append(Json::Value((static_cast<const edm::ModuleDescription *>(encModule_.decode(i)))->moduleLabel()));
Json::Value valReserved(nReservedModules);
Json::Value valSpecial(nSpecialModules);
Json::Value valOutputModules(nOutputModules_);
Json::Value moduleLegend;
moduleLegend["names"]=legendaVector;
Expand Down Expand Up @@ -179,7 +179,7 @@ namespace evf{
macrostate_=FastMonitoringThread::sInit;

for(unsigned int i = 0; i < (mCOUNT); i++)
encModule_.updateReserved((void*)(reservedMicroStateNames+i));
encModule_.updateReserved(static_cast<const void*>(reservedMicroStateNames+i));
encModule_.completeReservedWithDummies();

for (unsigned int i=0;i<nStreams_;i++) {
Expand All @@ -191,7 +191,7 @@ namespace evf{

//path (mini) state
encPath_.emplace_back(0);
encPath_[i].update((void*)&nopath_);
encPath_[i].update(static_cast<const void*>(&nopath_));
eventCountForPathInit_.push_back(0);
firstEventId_.push_back(0);
collectedPathList_.push_back(new std::atomic<bool>(0));
Expand Down Expand Up @@ -239,7 +239,6 @@ namespace evf{
<< " LS:" << sc.eventID().luminosityBlock() << " " << context;
std::lock_guard<std::mutex> lock(fmt_.monlock_);
exceptionInLS_.push_back(sc.eventID().luminosityBlock());
//exception_detected_=true;
}

void FastMonitoringService::preGlobalEarlyTermination(edm::GlobalContext const& gc, edm::TerminationOrigin to)
Expand All @@ -252,7 +251,6 @@ namespace evf{
<< gc.luminosityBlockID().luminosityBlock() << " " << context;
std::lock_guard<std::mutex> lock(fmt_.monlock_);
exceptionInLS_.push_back(gc.luminosityBlockID().luminosityBlock());
//exception_detected_=true;
}

void FastMonitoringService::preSourceEarlyTermination(edm::TerminationOrigin to)
Expand Down