From 85ebf8958ae6bea042143a76c2416b35d055f374 Mon Sep 17 00:00:00 2001 From: Hartmut Kaiser Date: Mon, 2 Sep 2013 19:20:03 -0500 Subject: [PATCH] Fixed #831: Arithmetics counter fails if only one parameter is given --- .../server/arithmetics_counter.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/performance_counters/server/arithmetics_counter.cpp b/src/performance_counters/server/arithmetics_counter.cpp index 5c6d9c02ffff..268279c045b1 100644 --- a/src/performance_counters/server/arithmetics_counter.cpp +++ b/src/performance_counters/server/arithmetics_counter.cpp @@ -359,12 +359,24 @@ namespace hpx { namespace performance_counters { namespace detail } } - if (names.size() < 2) + if (paths.countername_ == "divide") + { + if (names.size() < 1) + { + HPX_THROWS_IF(ec, bad_parameter, + "arithmetics_counter_creator", + "the parameter specification for an arithmetic counter " + "has to expand to more than one counter name: " + + paths.parameters_); + return naming::invalid_gid; + } + } + else if (names.empty()) { HPX_THROWS_IF(ec, bad_parameter, "arithmetics_counter_creator", "the parameter specification for an arithmetic counter " - "has to expand to more than one counter name: " + + "has to expand to at least one counter name: " + paths.parameters_); return naming::invalid_gid; }