Skip to content

Commit

Permalink
Disable throttling scheduler if HWLOC is not found/used
Browse files Browse the repository at this point in the history
- this is necessary as this scheduler directly uses HWLOC.
- this fixes #2807
  • Loading branch information
hkaiser committed Aug 9, 2017
1 parent 8719307 commit b8b2471
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 22 deletions.
4 changes: 2 additions & 2 deletions hpx/parallel/executors/thread_pool_executors.hpp
Expand Up @@ -65,7 +65,7 @@ namespace hpx { namespace parallel { namespace execution
threads::executors::static_priority_queue_executor;
#endif

#if defined(HPX_HAVE_THROTTLING_SCHEDULER)
#if defined(HPX_HAVE_THROTTLING_SCHEDULER) && defined(HPX_HAVE_HWLOC)
/// Creates a new throttling_executor
///
/// \param max_punits [in] The maximum number of processing units to
Expand Down Expand Up @@ -97,7 +97,7 @@ namespace hpx { namespace parallel { inline namespace v3
threads::executors::static_queue_executor;
#endif

#if defined(HPX_HAVE_THROTTLING_SCHEDULER)
#if defined(HPX_HAVE_THROTTLING_SCHEDULER) && defined(HPX_HAVE_HWLOC)
using throttling_executor =
threads::executors::throttling_executor;
#endif
Expand Down
6 changes: 1 addition & 5 deletions hpx/runtime/threads/executors/thread_pool_executors.hpp
Expand Up @@ -187,8 +187,7 @@ namespace hpx { namespace threads { namespace executors
};
#endif


#if defined(HPX_HAVE_THROTTLING_SCHEDULER)
#if defined(HPX_HAVE_THROTTLING_SCHEDULER) && defined(HPX_HAVE_HWLOC)
struct HPX_EXPORT throttling_executor : public scheduled_executor
{
throttling_executor();
Expand All @@ -198,9 +197,6 @@ namespace hpx { namespace threads { namespace executors
};
#endif




}}}

#include <hpx/config/warnings_suffix.hpp>
Expand Down
2 changes: 1 addition & 1 deletion hpx/runtime/threads/policies/schedulers.hpp
Expand Up @@ -24,7 +24,7 @@
#if defined(HPX_HAVE_PERIODIC_PRIORITY_SCHEDULER)
#include <hpx/runtime/threads/policies/periodic_priority_queue_scheduler.hpp>
#endif
#if defined(HPX_HAVE_THROTTLING_SCHEDULER)
#if defined(HPX_HAVE_THROTTLING_SCHEDULER) && defined(HPX_HAVE_HWLOC)
#include <hpx/runtime/threads/policies/throttling_scheduler.hpp>
#endif
#endif
2 changes: 1 addition & 1 deletion hpx/runtime/threads/policies/throttling_scheduler.hpp
Expand Up @@ -11,7 +11,7 @@

#include <hpx/config.hpp>

#if defined(HPX_HAVE_THROTTLING_SCHEDULER)
#if defined(HPX_HAVE_THROTTLING_SCHEDULER) && defined(HPX_HAVE_HWLOC)
#include <hpx/runtime/threads/policies/local_queue_scheduler.hpp>
#include <hpx/runtime/get_worker_thread_num.hpp>
#include <hpx/runtime/get_os_thread_count.hpp>
Expand Down
2 changes: 1 addition & 1 deletion src/hpx_init.cpp
Expand Up @@ -1054,7 +1054,7 @@ namespace hpx
shutdown_function_type shutdown,
util::command_line_handling& cfg, bool blocking)
{
#if defined(HPX_HAVE_THROTTLING_SCHEDULER)
#if defined(HPX_HAVE_THROTTLING_SCHEDULER) && defined(HPX_HAVE_HWLOC)
ensure_high_priority_compatibility(cfg.vm_);
ensure_hierarchy_arity_compatibility(cfg.vm_);

Expand Down
2 changes: 1 addition & 1 deletion src/runtime/threads/detail/thread_pool.cpp
Expand Up @@ -1481,7 +1481,7 @@ template class HPX_EXPORT hpx::threads::detail::thread_pool<
hpx::threads::policies::periodic_priority_queue_scheduler<> >;
#endif

#if defined(HPX_HAVE_THROTTLING_SCHEDULER)
#if defined(HPX_HAVE_THROTTLING_SCHEDULER) && defined(HPX_HAVE_HWLOC)
#include <hpx/runtime/threads/policies/throttling_scheduler.hpp>
template class HPX_EXPORT hpx::threads::detail::thread_pool<
hpx::threads::policies::throttling_scheduler<> >;
Expand Down
11 changes: 2 additions & 9 deletions src/runtime/threads/executors/thread_pool_executors.cpp
Expand Up @@ -13,7 +13,7 @@
#include <hpx/runtime/threads/policies/static_queue_scheduler.hpp>
#endif
#include <hpx/runtime/threads/policies/local_priority_queue_scheduler.hpp>
#if defined(HPX_HAVE_THROTTLING_SCHEDULER)
#if defined(HPX_HAVE_THROTTLING_SCHEDULER) && defined(HPX_HAVE_HWLOC)
#include <hpx/runtime/threads/policies/throttling_scheduler.hpp>
#endif
#if defined(HPX_HAVE_STATIC_PRIORITY_SCHEDULER)
Expand Down Expand Up @@ -471,7 +471,6 @@ namespace hpx { namespace threads { namespace executors
{}
#endif


///////////////////////////////////////////////////////////////////////////
local_priority_queue_executor::local_priority_queue_executor()
: scheduled_executor(new detail::thread_pool_executor<
Expand Down Expand Up @@ -502,10 +501,7 @@ namespace hpx { namespace threads { namespace executors
{}
#endif




#if defined(HPX_HAVE_THROTTLING_SCHEDULER)
#if defined(HPX_HAVE_THROTTLING_SCHEDULER) && defined(HPX_HAVE_HWLOC)
///////////////////////////////////////////////////////////////////////////
throttling_executor::throttling_executor()
: scheduled_executor(new detail::thread_pool_executor<
Expand All @@ -521,7 +517,4 @@ namespace hpx { namespace threads { namespace executors
{}
#endif




}}}
2 changes: 1 addition & 1 deletion src/runtime/threads/threadmanager.cpp
Expand Up @@ -1448,7 +1448,7 @@ template class HPX_EXPORT hpx::threads::threadmanager_impl<
hpx::threads::policies::periodic_priority_queue_scheduler<> >;
#endif

#if defined(HPX_HAVE_THROTTLING_SCHEDULER)
#if defined(HPX_HAVE_THROTTLING_SCHEDULER) && defined(HPX_HAVE_HWLOC)
#include <hpx/runtime/threads/policies/throttling_scheduler.hpp>
template class HPX_EXPORT hpx::threads::threadmanager_impl<
hpx::threads::policies::throttling_scheduler<> >;
Expand Down
2 changes: 1 addition & 1 deletion src/runtime_impl.cpp
Expand Up @@ -889,7 +889,7 @@ template class HPX_EXPORT hpx::runtime_impl<
hpx::threads::policies::periodic_priority_queue_scheduler<> >;
#endif

#if defined(HPX_HAVE_THROTTLING_SCHEDULER)
#if defined(HPX_HAVE_THROTTLING_SCHEDULER) && defined(HPX_HAVE_HWLOC)
#include <hpx/runtime/threads/policies/throttling_scheduler.hpp>
template class HPX_EXPORT hpx::runtime_impl<
hpx::threads::policies::throttling_scheduler<> >;
Expand Down

0 comments on commit b8b2471

Please sign in to comment.