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

Fix parameter strictness check #394

Merged
merged 2 commits into from
Dec 13, 2024
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
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
Loading