Skip to content

Commit

Permalink
Rename customized_pool_executor to pool_executor
Browse files Browse the repository at this point in the history
  • Loading branch information
biddisco committed Oct 4, 2017
1 parent f9e80cf commit 07454f4
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 32 deletions.
Expand Up @@ -11,7 +11,7 @@
//
#include <hpx/runtime/resource/partitioner.hpp>
#include <hpx/runtime/threads/cpu_mask.hpp>
#include <hpx/runtime/threads/executors/customized_pool_executors.hpp>
#include <hpx/runtime/threads/executors/pool_executor.hpp>
#include <hpx/runtime/threads/detail/scheduled_thread_pool_impl.hpp>
//
#include <hpx/include/iostreams.hpp>
Expand Down Expand Up @@ -95,7 +95,7 @@ int hpx_main(boost::program_options::variables_map& vm)
if (use_pools)
{
// get executors
hpx::threads::executors::customized_pool_executor mpi_exec("mpi");
hpx::threads::executors::pool_executor mpi_exec("mpi");
mpi_executor = mpi_exec;
hpx::cout << "\n[hpx_main] got mpi executor " << std::endl;
}
Expand Down
4 changes: 2 additions & 2 deletions examples/resource_partitioner/simple_resource_partitioner.cpp
Expand Up @@ -12,7 +12,7 @@
#include <hpx/runtime/resource/partitioner.hpp>
#include <hpx/runtime/threads/cpu_mask.hpp>
#include <hpx/runtime/threads/detail/scheduled_thread_pool_impl.hpp>
#include <hpx/runtime/threads/executors/customized_pool_executors.hpp>
#include <hpx/runtime/threads/executors/pool_executor.hpp>
//
#include <hpx/include/iostreams.hpp>
#include <hpx/include/runtime.hpp>
Expand Down Expand Up @@ -95,7 +95,7 @@ int hpx_main(boost::program_options::variables_map& vm)
if (use_pools)
{
// get executors
hpx::threads::executors::customized_pool_executor mpi_exec("mpi");
hpx::threads::executors::pool_executor mpi_exec("mpi");
mpi_executor = mpi_exec;
hpx::cout << "\n[hpx_main] got mpi executor " << std::endl;
}
Expand Down
Expand Up @@ -24,16 +24,16 @@ namespace hpx { namespace threads { namespace executors
namespace detail
{
///////////////////////////////////////////////////////////////////
class HPX_EXPORT customized_pool_executor
class HPX_EXPORT pool_executor
: public threads::detail::scheduled_executor_base
{
public:
customized_pool_executor(const std::string& pool_name);
pool_executor(const std::string& pool_name);

customized_pool_executor(const std::string& pool_name,
pool_executor(const std::string& pool_name,
thread_stacksize stacksize);

customized_pool_executor(const std::string& pool_name,
pool_executor(const std::string& pool_name,
thread_priority priority,
thread_stacksize stacksize = thread_stacksize_default);

Expand Down Expand Up @@ -93,14 +93,14 @@ namespace hpx { namespace threads { namespace executors
} // namespace detail

///////////////////////////////////////////////////////////////////////
struct HPX_EXPORT customized_pool_executor : public scheduled_executor
struct HPX_EXPORT pool_executor : public scheduled_executor
{
customized_pool_executor(const std::string& pool_name);
pool_executor(const std::string& pool_name);

customized_pool_executor(const std::string& pool_name,
pool_executor(const std::string& pool_name,
thread_stacksize stacksize);

customized_pool_executor(const std::string& pool_name,
pool_executor(const std::string& pool_name,
thread_priority priority,
thread_stacksize stacksize = thread_stacksize_default);
};
Expand Down
Expand Up @@ -4,7 +4,7 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

#include <hpx/exception.hpp>
#include <hpx/runtime/threads/executors/customized_pool_executors.hpp>
#include <hpx/runtime/threads/executors/pool_executor.hpp>
#include <hpx/runtime/threads/threadmanager.hpp>
#include <hpx/util/assert.hpp>
#include <hpx/util/bind.hpp>
Expand All @@ -18,51 +18,51 @@ namespace hpx { namespace threads { namespace executors
{
namespace detail
{
customized_pool_executor::customized_pool_executor(
pool_executor::pool_executor(
std::string const& pool_name)
: pool_(hpx::threads::get_thread_manager().get_pool(pool_name))
, stacksize_(thread_stacksize_default)
, priority_(thread_priority_default)
{}

customized_pool_executor::customized_pool_executor(const std::string& pool_name,
pool_executor::pool_executor(const std::string& pool_name,
thread_stacksize stacksize)
: pool_(hpx::threads::get_thread_manager().get_pool(pool_name))
, stacksize_(stacksize)
, priority_(thread_priority_default)
{}

customized_pool_executor::customized_pool_executor(const std::string& pool_name,
pool_executor::pool_executor(const std::string& pool_name,
thread_priority priority, thread_stacksize stacksize)
: pool_(hpx::threads::get_thread_manager().get_pool(pool_name))
, stacksize_(stacksize)
, priority_(priority)
{}

threads::thread_result_type
customized_pool_executor::thread_function_nullary(closure_type func)
pool_executor::thread_function_nullary(closure_type func)
{
// execute the actual thread function
func();
return threads::thread_result_type(threads::terminated, nullptr);
}

// Return the requested policy element
std::size_t customized_pool_executor::get_policy_element(
std::size_t pool_executor::get_policy_element(
threads::detail::executor_parameter p, error_code& ec) const
{
//! FIXME what is this supposed to do??

HPX_THROWS_IF(ec, bad_parameter,
"customized_pool_executor::get_policy_element",
"pool_executor::get_policy_element",
"requested value of invalid policy element");
return std::size_t(-1);
}

// Schedule the specified function for execution in this executor.
// Depending on the subclass implementation, this may block in some
// situations.
void customized_pool_executor::add(closure_type&& f,
void pool_executor::add(closure_type&& f,
util::thread_description const& desc,
threads::thread_state_enum initial_state, bool run_now,
threads::thread_stacksize stacksize, error_code& ec)
Expand All @@ -71,7 +71,7 @@ namespace hpx { namespace threads { namespace executors
thread_init_data data(
util::bind(
util::one_shot(
&customized_pool_executor::thread_function_nullary),
&pool_executor::thread_function_nullary),
std::move(f)),
desc);

Expand All @@ -94,7 +94,7 @@ namespace hpx { namespace threads { namespace executors
// Schedule given function for execution in this executor no sooner
// than time abs_time. This call never blocks, and may violate
// bounds on the executor's queue size.
void customized_pool_executor::add_at(
void pool_executor::add_at(
util::steady_clock::time_point const& abs_time,
closure_type&& f, util::thread_description const& desc,
threads::thread_stacksize stacksize, error_code& ec)
Expand All @@ -103,7 +103,7 @@ namespace hpx { namespace threads { namespace executors
thread_init_data data(
util::bind(
util::one_shot(
&customized_pool_executor::thread_function_nullary),
&pool_executor::thread_function_nullary),
std::move(f)),
desc);

Expand Down Expand Up @@ -132,7 +132,7 @@ namespace hpx { namespace threads { namespace executors
// Schedule given function for execution in this executor no sooner
// than time rel_time from now. This call never blocks, and may
// violate bounds on the executor's queue size.
void customized_pool_executor::add_after(
void pool_executor::add_after(
util::steady_clock::duration const& rel_time, closure_type&& f,
util::thread_description const& desc,
threads::thread_stacksize stacksize, error_code& ec)
Expand All @@ -142,7 +142,7 @@ namespace hpx { namespace threads { namespace executors
}

// Return an estimate of the number of waiting tasks.
std::uint64_t customized_pool_executor::num_pending_closures(
std::uint64_t pool_executor::num_pending_closures(
error_code& ec) const
{
if (&ec != &throws)
Expand All @@ -154,7 +154,7 @@ namespace hpx { namespace threads { namespace executors
}

// Reset internal (round robin) thread distribution scheme
void customized_pool_executor::reset_thread_distribution()
void pool_executor::reset_thread_distribution()
{
pool_.reset_thread_distribution();
}
Expand All @@ -163,20 +163,20 @@ namespace hpx { namespace threads { namespace executors

namespace hpx { namespace threads { namespace executors
{
customized_pool_executor::customized_pool_executor(
pool_executor::pool_executor(
const std::string& pool_name)
: scheduled_executor(new detail::customized_pool_executor(pool_name))
: scheduled_executor(new detail::pool_executor(pool_name))
{}

customized_pool_executor::customized_pool_executor(const std::string& pool_name,
pool_executor::pool_executor(const std::string& pool_name,
thread_stacksize stacksize)
: scheduled_executor(new detail::customized_pool_executor(pool_name, stacksize))
: scheduled_executor(new detail::pool_executor(pool_name, stacksize))
{}

customized_pool_executor::customized_pool_executor(const std::string& pool_name,
pool_executor::pool_executor(const std::string& pool_name,
thread_priority priority, thread_stacksize stacksize)
: scheduled_executor(
new detail::customized_pool_executor(pool_name, priority, stacksize))
new detail::pool_executor(pool_name, priority, stacksize))
{}


Expand Down

0 comments on commit 07454f4

Please sign in to comment.