Skip to content

Commit

Permalink
More work on #1080: /threads{locality#*/total}/count/cumulative broken
Browse files Browse the repository at this point in the history
  • Loading branch information
hkaiser committed Mar 19, 2014
1 parent 249bb40 commit d1b1438
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
5 changes: 4 additions & 1 deletion hpx/runtime/threads/threadmanager_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -439,10 +439,11 @@ namespace hpx { namespace threads
std::size_t data, error_code& ec = throws);
#endif

#if HPX_THREAD_MAINTAIN_IDLE_RATE
/// Get percent maintenance time in main thread-manager loop.
boost::int64_t avg_idle_rate(bool reset);
boost::int64_t avg_idle_rate(std::size_t num_thread, bool reset);

#endif
#if HPX_THREAD_MAINTAIN_CREATION_AND_CLEANUP_RATES
boost::int64_t avg_creation_idle_rate(bool reset);
boost::int64_t avg_cleanup_idle_rate(bool reset);
Expand Down Expand Up @@ -470,10 +471,12 @@ namespace hpx { namespace threads
scheduler_.on_error(num_thread, e);
}

#if HPX_THREAD_MAINTAIN_CUMULATIVE_COUNTS
boost::int64_t get_executed_threads(
std::size_t num = std::size_t(-1), bool reset = false);
boost::int64_t get_executed_thread_phases(
std::size_t num = std::size_t(-1), bool reset = false);
#endif

protected:
///
Expand Down
10 changes: 10 additions & 0 deletions src/runtime/threads/threadmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -928,6 +928,7 @@ namespace hpx { namespace threads
return true;
}

#if HPX_THREAD_MAINTAIN_IDLE_RATE
///////////////////////////////////////////////////////////////////////////
// idle rate counter creation function
template <typename SchedulingPolicy, typename NotificationPolicy>
Expand Down Expand Up @@ -983,6 +984,7 @@ namespace hpx { namespace threads
"invalid counter instance name: " + paths.instancename_);
return naming::invalid_gid;
}
#endif

///////////////////////////////////////////////////////////////////////////
naming::gid_type
Expand Down Expand Up @@ -1067,6 +1069,7 @@ namespace hpx { namespace threads
"", 0
},
#endif
#if HPX_THREAD_MAINTAIN_CUMULATIVE_COUNTS
// /threads{locality#%d/total}/count/cumulative
// /threads{locality#%d/worker-thread%d}/count/cumulative
{ "count/cumulative",
Expand All @@ -1083,6 +1086,7 @@ namespace hpx { namespace threads
static_cast<std::size_t>(paths.instanceindex_), _1),
"worker-thread", shepherd_count
},
#endif
// /threads{locality#%d/total}/count/instantaneous/all
// /threads{locality#%d/worker-thread%d}/count/instantaneous/all
{ "count/instantaneous/all",
Expand Down Expand Up @@ -1273,6 +1277,7 @@ namespace hpx { namespace threads
"ns"
},
#endif
#if HPX_THREAD_MAINTAIN_IDLE_RATE
// idle rate
{ "/threads/idle-rate", performance_counters::counter_raw,
"returns the idle rate for the referenced object",
Expand All @@ -1281,6 +1286,7 @@ namespace hpx { namespace threads
&performance_counters::locality_thread_counter_discoverer,
"0.01%"
},
#endif
#if HPX_THREAD_MAINTAIN_CREATION_AND_CLEANUP_RATES
{ "/threads/creation-idle-rate", performance_counters::counter_raw,
"returns the % of idle-rate spent creating HPX-threads for the "
Expand Down Expand Up @@ -1574,6 +1580,7 @@ namespace hpx { namespace threads
startup_ = NULL;
}

#if HPX_THREAD_MAINTAIN_CUMULATIVE_COUNTS
template <typename SchedulingPolicy, typename NotificationPolicy>
boost::int64_t threadmanager_impl<SchedulingPolicy, NotificationPolicy>::
get_executed_threads(std::size_t num, bool reset)
Expand Down Expand Up @@ -1613,7 +1620,9 @@ namespace hpx { namespace threads
}
return result;
}
#endif

#if HPX_THREAD_MAINTAIN_IDLE_RATE
///////////////////////////////////////////////////////////////////////////
template <typename SchedulingPolicy, typename NotificationPolicy>
boost::int64_t threadmanager_impl<SchedulingPolicy, NotificationPolicy>::
Expand Down Expand Up @@ -1654,6 +1663,7 @@ namespace hpx { namespace threads
double const percent = 1. - (exec_time / tfunc_time);
return boost::int64_t(10000. * percent); // 0.01 percent
}
#endif

#if HPX_THREAD_MAINTAIN_CREATION_AND_CLEANUP_RATES
template <typename SchedulingPolicy, typename NotificationPolicy>
Expand Down

0 comments on commit d1b1438

Please sign in to comment.