-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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 JSON changes in DAQ (80X) #12138
Closed
Closed
Changes from 4 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
c314fb0
upgrade AMPT to v2.25t5
kurtejung e3f34f8
Herwig: Add config for LO NNPDF30
3fd6a72
alpha_S in LO set to 0.130
eb15d12
new (json) format for module and path legend json file
smorovic 29bf970
outputmodules entry in json legend
smorovic 7a58df2
*adding HLTErrorEvents field to output JSON (to be used for filling S…
smorovic 8019691
Added bool to make sure the Sherpa object is only initialized once (e…
thuer 8ab7ae7
*const correctness and using static const int instead of preprocessor…
smorovic a40cc08
Implement "ramdisk" online client.
cmsdqm c9b9afb
Fix code formatting DQMServices/StreamerIO
96658e0
Merge pull request #12209 from dmitrijus/ramdisk_76x
davidlange6 01a95a7
Merge pull request #12229 from smuzaffar/from-CMSSW_8_0_X_2015-11-01-…
smuzaffar 3ac9285
Merge pull request #12199 from thuer/CMSSW_8_0_X_sherpa_no_multiple_i…
cmsbuild b1e354d
Merge pull request #12025 from mharrend/patch-3
cmsbuild 4be17af
Merge pull request #11932 from kurtejung/AMPT_upgrades
cmsbuild 74d4bf2
*C++ style casts in FastMonitoringService
smorovic 6909b65
*const correctness and using static const int instead of preprocessor…
smorovic c92781b
*C++ style casts in FastMonitoringService
smorovic 97d6be2
Merge branch 'jsonlegends-80X' of ssh://github.com/smorovic/cmssw int…
smorovic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,10 @@ using namespace jsoncollector; | |
|
||
constexpr double throughputFactor() {return (1000000)/double(1024*1024);} | ||
|
||
static const int nReservedModules = 33; | ||
static const int nSpecialModules = 7; | ||
static const int nReservedPaths = 1; | ||
|
||
namespace evf{ | ||
|
||
const std::string FastMonitoringService::macroStateNames[FastMonitoringThread::MCOUNT] = | ||
|
@@ -33,7 +37,7 @@ namespace evf{ | |
FastMonitoringService::FastMonitoringService(const edm::ParameterSet& iPS, | ||
edm::ActivityRegistry& reg) : | ||
MicroStateService(iPS,reg) | ||
,encModule_(33) | ||
,encModule_(nReservedModules) | ||
,nStreams_(0)//until initialized | ||
,sleepTime_(iPS.getUntrackedParameter<int>("sleepTime", 1)) | ||
,fastMonIntervals_(iPS.getUntrackedParameter<unsigned int>("fastMonIntervals", 1)) | ||
|
@@ -81,26 +85,34 @@ namespace evf{ | |
} | ||
|
||
|
||
std::string FastMonitoringService::makePathLegenda(){ | ||
//taken from first stream | ||
std::ostringstream ost; | ||
for(int i = 0; | ||
i < encPath_[0].current_; | ||
i++) | ||
ost<<i<<"="<<*((std::string *)(encPath_[0].decode(i)))<<" "; | ||
return ost.str(); | ||
std::string FastMonitoringService::makePathLegendaJson() { | ||
Json::Value legendaVector(Json::arrayValue); | ||
for(int i = 0; i < encPath_[0].current_; i++) | ||
legendaVector.append(Json::Value(*((const std::string *)(encPath_[0].decode(i))))); | ||
Json::Value valReserved(nReservedPaths); | ||
Json::Value pathLegend; | ||
pathLegend["names"]=legendaVector; | ||
pathLegend["reserved"]=valReserved; | ||
Json::StyledWriter writer; | ||
return writer.write(pathLegend); | ||
} | ||
|
||
|
||
std::string FastMonitoringService::makeModuleLegenda() | ||
{ | ||
std::ostringstream ost; | ||
std::string FastMonitoringService::makeModuleLegendaJson(){ | ||
Json::Value legendaVector(Json::arrayValue); | ||
for(int i = 0; i < encModule_.current_; i++) | ||
ost<<i<<"="<<((const edm::ModuleDescription *)(encModule_.decode(i)))->moduleLabel()<<" "; | ||
return ost.str(); | ||
legendaVector.append(Json::Value(((const edm::ModuleDescription *)(encModule_.decode(i)))->moduleLabel())); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please avoid use of C style casts. The C++ casts are much easier to notIce and avoid accidental casting away can const. |
||
Json::Value valReserved(nReservedModules); | ||
Json::Value valSpecial(nSpecialModules); | ||
Json::Value valOutputModules(nOutputModules_); | ||
Json::Value moduleLegend; | ||
moduleLegend["names"]=legendaVector; | ||
moduleLegend["reserved"]=valReserved; | ||
moduleLegend["special"]=valSpecial; | ||
moduleLegend["output"]=valOutputModules; | ||
Json::StyledWriter writer; | ||
return writer.write(moduleLegend); | ||
} | ||
|
||
|
||
void FastMonitoringService::preallocate(edm::service::SystemBounds const & bounds) | ||
{ | ||
|
||
|
@@ -133,12 +145,18 @@ namespace evf{ | |
fastPath_ = fast.string(); | ||
|
||
std::ostringstream moduleLegFile; | ||
std::ostringstream moduleLegFileJson; | ||
moduleLegFile << "microstatelegend_pid" << std::setfill('0') << std::setw(5) << getpid() << ".leg"; | ||
moduleLegFileJson << "microstatelegend_pid" << std::setfill('0') << std::setw(5) << getpid() << ".jsn"; | ||
moduleLegendFile_ = (workingDirectory_/moduleLegFile.str()).string(); | ||
moduleLegendFileJson_ = (workingDirectory_/moduleLegFileJson.str()).string(); | ||
|
||
std::ostringstream pathLegFile; | ||
std::ostringstream pathLegFileJson; | ||
pathLegFile << "pathlegend_pid" << std::setfill('0') << std::setw(5) << getpid() << ".leg"; | ||
pathLegendFile_ = (workingDirectory_/pathLegFile.str()).string(); | ||
pathLegFileJson << "pathlegend_pid" << std::setfill('0') << std::setw(5) << getpid() << ".jsn"; | ||
pathLegendFileJson_ = (workingDirectory_/pathLegFileJson.str()).string(); | ||
|
||
LogDebug("FastMonitoringService") << "Initializing FastMonitor with microstate def path -: " | ||
<< microstateDefPath_; | ||
|
@@ -267,16 +285,18 @@ namespace evf{ | |
//build a map of modules keyed by their module description address | ||
//here we need to treat output modules in a special way so they can be easily singled out | ||
if(desc.moduleName() == "Stream" || desc.moduleName() == "ShmStreamConsumer" || desc.moduleName() == "EvFOutputModule" || | ||
desc.moduleName() == "EventStreamFileWriter" || desc.moduleName() == "PoolOutputModule") | ||
desc.moduleName() == "EventStreamFileWriter" || desc.moduleName() == "PoolOutputModule") { | ||
encModule_.updateReserved((void*)&desc); | ||
nOutputModules_++; | ||
} | ||
else | ||
encModule_.update((void*)&desc); | ||
} | ||
|
||
void FastMonitoringService::postBeginJob() | ||
{ | ||
std::string && moduleLegStr = makeModuleLegenda(); | ||
FileIO::writeStringToFile(moduleLegendFile_, moduleLegStr); | ||
std::string && moduleLegStrJson = makeModuleLegendaJson(); | ||
FileIO::writeStringToFile(moduleLegendFileJson_, moduleLegStrJson); | ||
|
||
macrostate_ = FastMonitoringThread::sJobReady; | ||
|
||
|
@@ -465,8 +485,8 @@ namespace evf{ | |
collectedPathList_[sc.streamID()]->store(true,std::memory_order_seq_cst); | ||
fmt_.m_data.ministateBins_=encPath_[sc.streamID()].vecsize(); | ||
if (!pathLegendWritten_) { | ||
std::string pathLegendStr = makePathLegenda(); | ||
FileIO::writeStringToFile(pathLegendFile_, pathLegendStr); | ||
std::string pathLegendStrJson = makePathLegendaJson(); | ||
FileIO::writeStringToFile(pathLegendFileJson_, pathLegendStrJson); | ||
pathLegendWritten_=true; | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use C++ style cast.