Skip to content

Commit

Permalink
Merge pull request #394 from JeffersonLab/nbrei_issue_382
Browse files Browse the repository at this point in the history
Fix parameter strictness check
  • Loading branch information
nathanwbrei authored Dec 13, 2024
2 parents 5a506ed + 4b516f2 commit 9c88e63
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
13 changes: 9 additions & 4 deletions src/libraries/JANA/Engine/JExecutionEngine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,18 @@ void JExecutionEngine::RunSupervisor() {

if (m_interrupt_status == InterruptStatus::InspectRequested) {
if (perf.runstatus == RunStatus::Paused) {
PrintFinalReport();
LOG_INFO(GetLogger()) << "Entering inspector" << LOG_END;
m_enable_timeout = false;
m_interrupt_status = InterruptStatus::InspectInProgress;
InspectApplication(GetApplication());
m_interrupt_status = InterruptStatus::NoInterruptsSupervised;

// Jump back to the top of the loop so that we have fresh event count data
last_measurement_time = clock_t::now();
last_event_count = 0;
continue;
}
else {
else if (perf.runstatus == RunStatus::Running) {
PauseTopology();
}
}
Expand All @@ -251,9 +255,10 @@ void JExecutionEngine::RunSupervisor() {
}

if (m_show_ticker) {
auto last_measurement_duration_ms = std::chrono::duration_cast<std::chrono::milliseconds>(clock_t::now() - last_measurement_time).count();
auto next_measurement_time = clock_t::now();
auto last_measurement_duration_ms = std::chrono::duration_cast<std::chrono::milliseconds>(next_measurement_time - last_measurement_time).count();
float latest_throughput_hz = (last_measurement_duration_ms == 0) ? 0 : (perf.event_count - last_event_count) * 1000.0 / last_measurement_duration_ms;
last_measurement_time = clock_t::now();
last_measurement_time = next_measurement_time;
last_event_count = perf.event_count;

// Print rates
Expand Down
16 changes: 8 additions & 8 deletions src/libraries/JANA/Services/JParameterManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -106,19 +106,14 @@ void JParameterManager::PrintParameters() {
/// 2: Throw on unused parameters
void JParameterManager::PrintParameters(int verbosity, int strictness) {

if (verbosity == 0) {
LOG_INFO(m_logger) << "Configuration parameters table hidden. Set jana:parameter_verbosity > 0 to view." << LOG_END;
return;
}

bool strictness_violation = false;

// Unused parameters first
// The former might change the table columns and the latter might change the filter verbosity
// Check for unused and deprecated parameters first.
// If we find a problem, warn about that separately, and also increase the parameter table verbosity to help the user debug
for (auto& pair : m_parameters) {
const auto& key = pair.first;
auto param = pair.second;

if ((strictness > 0) && (!param->IsDefault()) && (!param->IsUsed())) {
strictness_violation = true;
LOG_ERROR(m_logger) << "Parameter '" << key << "' appears to be unused. Possible typo?" << LOG_END;
Expand All @@ -133,6 +128,11 @@ void JParameterManager::PrintParameters(int verbosity, int strictness) {
verbosity = 3; // Crank up verbosity before printing out table
}

if (verbosity == 0) {
LOG_INFO(m_logger) << "Configuration parameters table hidden. Set jana:parameter_verbosity > 0 to view." << LOG_END;
return;
}

// Filter table
vector<JParameter*> params_to_print;

Expand Down

0 comments on commit 9c88e63

Please sign in to comment.