Skip to content

Commit

Permalink
More work on #731
Browse files Browse the repository at this point in the history
  • Loading branch information
hkaiser committed Mar 26, 2013
1 parent d3f49c4 commit 11f1f49
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
8 changes: 5 additions & 3 deletions hpx/hpx_fwd.hpp
Expand Up @@ -1098,7 +1098,9 @@ namespace hpx
/// \brief Query all active performance counters, optionally naming the
/// point in code marked by this function,
///
/// \param description [in] this is a optional value naming the point in
/// \param reset [in] this is an optional falg allowing to reset
/// the counter value after it has been evaluated.
/// \param description [in] this is an optional value naming the point in
/// the code marked by the call to this function.
/// \param ec [in,out] this represents the error status on exit, if this
/// is pre-initialized to \a hpx#throws the function will throw
Expand All @@ -1116,8 +1118,8 @@ namespace hpx
/// \note The active counters are those which have been specified on
/// the command line while executing the application (see command
/// line option --hpx:print-counter)
HPX_API_EXPORT void evaluate_active_counters(char const* description = 0,
error_code& ec = throws);
HPX_API_EXPORT void evaluate_active_counters(bool reset = false,
char const* description = 0, error_code& ec = throws);
}

#include <hpx/lcos/async_fwd.hpp>
Expand Down
6 changes: 4 additions & 2 deletions hpx/performance_counters/server/base_performance_counter.hpp
Expand Up @@ -118,8 +118,10 @@ namespace hpx { namespace performance_counters { namespace server

/// The \a get_counter_value_action queries the value of a performance
/// counter.
HPX_DEFINE_COMPONENT_ACTION(base_performance_counter,
get_counter_value_nonvirt, get_counter_value_action);
typedef hpx::actions::result_action1<
base_performance_counter, counter_value, bool,
&base_performance_counter::get_counter_value_nonvirt
> get_counter_value_action;

/// The \a set_counter_value_action
HPX_DEFINE_COMPONENT_ACTION(base_performance_counter,
Expand Down
3 changes: 2 additions & 1 deletion src/util/query_counters.cpp
Expand Up @@ -235,7 +235,8 @@ namespace hpx { namespace util
wait_all(reset, ec);
}

bool query_counters::evaluate_counters(char const* description, error_code& ec)
bool query_counters::evaluate_counters(bool reset,
char const* description, error_code& ec)
{
if (timer_.is_terminated())
{
Expand Down
4 changes: 1 addition & 3 deletions tests/regressions/util/function_serialization.cpp
Expand Up @@ -39,8 +39,6 @@ void worker(hpx::util::function<void()> const& f)

std::vector<hpx::id_type> targets = hpx::find_remote_localities();

hpx::reset_active_counters();

for (std::size_t j = 0; j < 100; ++j)
{
for (std::size_t i = 0; i < targets.size(); ++i)
Expand All @@ -49,7 +47,7 @@ void worker(hpx::util::function<void()> const& f)
}
}

hpx::evaluate_active_counters("---");
hpx::evaluate_active_counters(true, "---");
}

///////////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit 11f1f49

Please sign in to comment.