From 405717a3cf4b298e0367832faa90078cb75f77a2 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Fri, 14 Apr 2023 16:41:51 -0500 Subject: [PATCH] Modifying batch estimation message if the uncertainty ratio is inf --- src/tallies/trigger.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/tallies/trigger.cpp b/src/tallies/trigger.cpp index 79af658793..590a54773a 100644 --- a/src/tallies/trigger.cpp +++ b/src/tallies/trigger.cpp @@ -211,13 +211,18 @@ void check_triggers() auto n_pred_batches = static_cast(n_active * max_ratio * max_ratio) + settings::n_inactive + 1; - std::string msg = - fmt::format("The estimated number of batches is {}", n_pred_batches); - if (n_pred_batches > settings::n_max_batches) { - msg.append(" --- greater than max batches"); - warning(msg); - } else { + if (max_ratio == INFINITY) { + std::string msg = fmt::format("One or more tallies with triggers have no scores. Unable to estimate the number of remaining batches."); write_message(msg, 7); + } else { + std::string msg = + fmt::format("The estimated number of batches is {}", n_pred_batches); + if (n_pred_batches > settings::n_max_batches) { + msg.append(" --- greater than max batches"); + warning(msg); + } else { + write_message(msg, 7); + } } } }