From bc9800d6452a78679429bbff1d2f40b905b21a58 Mon Sep 17 00:00:00 2001 From: Nathan Brei Date: Thu, 12 Dec 2024 16:41:26 -0500 Subject: [PATCH 1/2] Fix PrintParameters() verbosity/strictness bug Previously, when verbosity=0, the strictness check was inadvertently skipped. This addresses issue #382 --- src/libraries/JANA/Services/JParameterManager.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/libraries/JANA/Services/JParameterManager.cc b/src/libraries/JANA/Services/JParameterManager.cc index 7b8014af9..c6a32b841 100644 --- a/src/libraries/JANA/Services/JParameterManager.cc +++ b/src/libraries/JANA/Services/JParameterManager.cc @@ -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; @@ -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 params_to_print; From 4b516f2fe4c1c34e4a1fc60446d98035b39120fd Mon Sep 17 00:00:00 2001 From: Nathan Brei Date: Thu, 12 Dec 2024 16:01:56 -0500 Subject: [PATCH 2/2] Fix stale ticker values --- src/libraries/JANA/Engine/JExecutionEngine.cc | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/libraries/JANA/Engine/JExecutionEngine.cc b/src/libraries/JANA/Engine/JExecutionEngine.cc index f485dc5b0..d4e817dfc 100644 --- a/src/libraries/JANA/Engine/JExecutionEngine.cc +++ b/src/libraries/JANA/Engine/JExecutionEngine.cc @@ -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(); } } @@ -251,9 +255,10 @@ void JExecutionEngine::RunSupervisor() { } if (m_show_ticker) { - auto last_measurement_duration_ms = std::chrono::duration_cast(clock_t::now() - last_measurement_time).count(); + auto next_measurement_time = clock_t::now(); + auto last_measurement_duration_ms = std::chrono::duration_cast(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