Skip to content

Commit

Permalink
Try #420:
Browse files Browse the repository at this point in the history
  • Loading branch information
bors[bot] authored Aug 29, 2022
2 parents 95e0871 + e81f649 commit b0f52c6
Show file tree
Hide file tree
Showing 26 changed files with 102 additions and 188 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
#include <pika/execution/algorithms/detail/predicates.hpp>
#include <pika/iterator_support/iterator_facade.hpp>
#include <pika/iterator_support/traits/is_iterator.hpp>
#include <pika/util/min.hpp>

#include <algorithm>
#include <cstddef>
Expand Down Expand Up @@ -78,7 +77,7 @@ namespace pika::parallel::util::detail {
PIKA_HOST_DEVICE chunk_size_iterator(Iterator it,
std::size_t chunk_size, std::size_t count = 0,
std::size_t current = 0)
: data_(it, (pika::detail::min)(chunk_size, count))
: data_(it, (std::min)(chunk_size, count))
, chunk_size_(chunk_size)
, last_chunk_size_(get_last_chunk_size(count, chunk_size))
, count_(count)
Expand Down Expand Up @@ -259,7 +258,7 @@ namespace pika::parallel::util::detail {
PIKA_HOST_DEVICE chunk_size_idx_iterator(Iterator it,
std::size_t chunk_size, std::size_t count = 0,
std::size_t current = 0, std::size_t base_idx = 0)
: data_(it, (pika::detail::min)(chunk_size, count), base_idx)
: data_(it, (std::min)(chunk_size, count), base_idx)
, chunk_size_(chunk_size)
, last_chunk_size_(get_last_chunk_size(count, chunk_size))
, count_(count)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ namespace pika::detail {
void check_pu_offset() const;
void check_pu_step() const;

bool handle_arguments(util::manage_config& cfgmap,
bool handle_arguments(detail::manage_config& cfgmap,
pika::program_options::variables_map& vm,
std::vector<std::string>& ini_config);

Expand Down
20 changes: 10 additions & 10 deletions libs/pika/command_line_handling/src/command_line_handling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ namespace pika::detail {
return "file(" + dest + ")";
}

std::string handle_queuing(util::manage_config& cfgmap,
std::string handle_queuing(detail::manage_config& cfgmap,
pika::program_options::variables_map& vm, std::string const& default_)
{
// command line options is used preferred
Expand All @@ -122,7 +122,7 @@ namespace pika::detail {
return cfgmap.get_value<std::string>("pika.scheduler", default_);
}

std::string handle_affinity(util::manage_config& cfgmap,
std::string handle_affinity(detail::manage_config& cfgmap,
pika::program_options::variables_map& vm, std::string const& default_)
{
// command line options is used preferred
Expand All @@ -133,7 +133,7 @@ namespace pika::detail {
return cfgmap.get_value<std::string>("pika.affinity", default_);
}

std::string handle_affinity_bind(util::manage_config& cfgmap,
std::string handle_affinity_bind(detail::manage_config& cfgmap,
pika::program_options::variables_map& vm, std::string const& default_)
{
// command line options is used preferred
Expand All @@ -157,7 +157,7 @@ namespace pika::detail {
return cfgmap.get_value<std::string>("pika.bind", default_);
}

std::size_t handle_pu_step(util::manage_config& cfgmap,
std::size_t handle_pu_step(detail::manage_config& cfgmap,
pika::program_options::variables_map& vm, std::size_t default_)
{
// command line options is used preferred
Expand All @@ -168,7 +168,7 @@ namespace pika::detail {
return cfgmap.get_value<std::size_t>("pika.pu_step", default_);
}

std::size_t handle_pu_offset(util::manage_config& cfgmap,
std::size_t handle_pu_offset(detail::manage_config& cfgmap,
pika::program_options::variables_map& vm, std::size_t default_)
{
// command line options is used preferred
Expand All @@ -179,7 +179,7 @@ namespace pika::detail {
return cfgmap.get_value<std::size_t>("pika.pu_offset", default_);
}

std::size_t handle_numa_sensitive(util::manage_config& cfgmap,
std::size_t handle_numa_sensitive(detail::manage_config& cfgmap,
pika::program_options::variables_map& vm, std::size_t default_)
{
if (vm.count("pika:numa-sensitive") != 0)
Expand Down Expand Up @@ -243,7 +243,7 @@ namespace pika::detail {
}

///////////////////////////////////////////////////////////////////////
std::size_t handle_num_threads(util::manage_config& cfgmap,
std::size_t handle_num_threads(detail::manage_config& cfgmap,
pika::util::runtime_configuration const& rtcfg,
pika::program_options::variables_map& vm, bool use_process_mask)
{
Expand Down Expand Up @@ -344,7 +344,7 @@ namespace pika::detail {
return threads;
}

std::size_t handle_num_cores(util::manage_config& cfgmap,
std::size_t handle_num_cores(detail::manage_config& cfgmap,
pika::program_options::variables_map& vm, std::size_t num_threads,
bool use_process_mask)
{
Expand Down Expand Up @@ -437,7 +437,7 @@ namespace pika::detail {
}

///////////////////////////////////////////////////////////////////////////
bool command_line_handling::handle_arguments(util::manage_config& cfgmap,
bool command_line_handling::handle_arguments(detail::manage_config& cfgmap,
pika::program_options::variables_map& vm,
std::vector<std::string>& ini_config)
{
Expand Down Expand Up @@ -830,7 +830,7 @@ namespace pika::detail {
// separate command line arguments from configuration settings
std::vector<std::string> args = preprocess_config_settings(argc, argv);

util::manage_config cfgmap(ini_config_);
detail::manage_config cfgmap(ini_config_);

// insert the pre-configured ini settings before loading modules
for (std::string const& e : ini_config_)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,13 +301,13 @@ namespace pika::threads::coroutines {
public:
static std::uint64_t get_stack_unbind_count(bool reset)
{
return util::get_and_reset_value(
return detail::get_and_reset_value(
get_stack_unbind_counter(), reset);
}

static std::uint64_t get_stack_recycle_count(bool reset)
{
return util::get_and_reset_value(
return detail::get_and_reset_value(
get_stack_recycle_counter(), reset);
}
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -415,13 +415,13 @@ namespace pika::threads::coroutines {
public:
static std::uint64_t get_stack_unbind_count(bool reset)
{
return util::get_and_reset_value(
return detail::get_and_reset_value(
get_stack_unbind_counter(), reset);
}

static std::uint64_t get_stack_recycle_count(bool reset)
{
return util::get_and_reset_value(
return detail::get_and_reset_value(
get_stack_recycle_counter(), reset);
}
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -406,13 +406,13 @@ namespace pika::threads::coroutines {
public:
static std::uint64_t get_stack_unbind_count(bool reset)
{
return util::get_and_reset_value(
return detail::get_and_reset_value(
get_stack_unbind_counter(), reset);
}

static std::uint64_t get_stack_recycle_count(bool reset)
{
return util::get_and_reset_value(
return detail::get_and_reset_value(
get_stack_recycle_counter(), reset);
}
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ namespace pika::threads::coroutines {
public:
static std::uint64_t get_stack_recycle_count(bool reset) noexcept
{
return util::get_and_reset_value(
return detail::get_and_reset_value(
get_stack_recycle_counter(), reset);
}
#endif
Expand Down
2 changes: 1 addition & 1 deletion libs/pika/init_runtime/src/init_logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@ namespace pika { namespace util {

void warn_if_logging_requested(runtime_configuration& ini)
{
using util::get_entry_as;
using detail::get_entry_as;

// warn if logging is requested
if (get_entry_as<int>(ini, "pika.logging.level", -1) > 0 ||
Expand Down
10 changes: 5 additions & 5 deletions libs/pika/init_runtime/src/init_runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,17 +445,17 @@ namespace pika {

pika::detail::affinity_data affinity_data{};
affinity_data.init(
pika::util::get_entry_as<std::size_t>(
pika::detail::get_entry_as<std::size_t>(
cmdline.rtcfg_, "pika.os_threads", 0),
pika::util::get_entry_as<std::size_t>(
pika::detail::get_entry_as<std::size_t>(
cmdline.rtcfg_, "pika.cores", 0),
pika::util::get_entry_as<std::size_t>(
pika::detail::get_entry_as<std::size_t>(
cmdline.rtcfg_, "pika.pu_offset", 0),
pika::util::get_entry_as<std::size_t>(
pika::detail::get_entry_as<std::size_t>(
cmdline.rtcfg_, "pika.pu_step", 0),
0, cmdline.rtcfg_.get_entry("pika.affinity", ""),
cmdline.rtcfg_.get_entry("pika.bind", ""),
!pika::util::get_entry_as<bool>(
!pika::detail::get_entry_as<bool>(
cmdline.rtcfg_, "pika.ignore_process_mask", false));

pika::resource::partitioner rp =
Expand Down
2 changes: 1 addition & 1 deletion libs/pika/mpi_base/src/mpi_environment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ namespace pika { namespace util {
int minimal = MPI_THREAD_SINGLE;
#if defined(PIKA_HAVE_MPI_MULTITHREADED)
required =
(get_entry_as(rtcfg, "pika.parcel.mpi.multithreaded", 1) != 0) ?
(pika::detail::get_entry_as(rtcfg, "pika.parcel.mpi.multithreaded", 1) != 0) ?
MPI_THREAD_MULTIPLE :
MPI_THREAD_SINGLE;

Expand Down
6 changes: 3 additions & 3 deletions libs/pika/resource_partitioner/src/detail_partitioner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -681,8 +681,8 @@ namespace pika { namespace resource { namespace detail {

// Make sure the total number of requested threads does not exceed
// the number of threads requested on the command line
std::size_t num_threads =
util::get_entry_as<std::size_t>(rtcfg_, "pika.os_threads", 0);
std::size_t num_threads = ::pika::detail::get_entry_as<std::size_t>(
rtcfg_, "pika.os_threads", 0);
PIKA_ASSERT(num_threads != 0);

if (detail::init_pool_data::num_threads_overall > num_threads)
Expand Down Expand Up @@ -804,7 +804,7 @@ namespace pika { namespace resource { namespace detail {
// threads to create (if no over-subscription is allowed)
PIKA_ASSERT(mode_ & mode_allow_oversubscription ||
num_threads ==
util::get_entry_as<std::size_t>(
::pika::detail::get_entry_as<std::size_t>(
rtcfg_, "pika.os_threads", std::size_t(-1)));

return num_threads;
Expand Down
26 changes: 13 additions & 13 deletions libs/pika/runtime_configuration/src/runtime_configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ namespace pika { namespace util {
#if PIKA_HAVE_ITTNOTIFY != 0
if (util::section const* sec = get_section("pika"); nullptr != sec)
{
return pika::util::get_entry_as<int>(*sec, "use_itt_notify", 0) !=
return pika::detail::get_entry_as<int>(*sec, "use_itt_notify", 0) !=
0;
}
#endif
Expand All @@ -432,7 +432,7 @@ namespace pika { namespace util {
#ifdef PIKA_HAVE_VERIFY_LOCKS
if (util::section const* sec = get_section("pika"); nullptr != sec)
{
return pika::util::get_entry_as<int>(*sec, "lock_detection", 0) !=
return pika::detail::get_entry_as<int>(*sec, "lock_detection", 0) !=
0;
}
#endif
Expand All @@ -446,10 +446,10 @@ namespace pika { namespace util {
if (util::section const* sec = get_section("pika"); nullptr != sec)
{
#ifdef PIKA_DEBUG
return pika::util::get_entry_as<int>(
return pika::detail::get_entry_as<int>(
*sec, "minimal_deadlock_detection", 1) != 0;
#else
return pika::util::get_entry_as<int>(
return pika::detail::get_entry_as<int>(
*sec, "minimal_deadlock_detection", 0) != 0;
#endif
}
Expand All @@ -472,10 +472,10 @@ namespace pika { namespace util {
if (util::section const* sec = get_section("pika"); nullptr != sec)
{
#ifdef PIKA_DEBUG
return pika::util::get_entry_as<int>(
return pika::detail::get_entry_as<int>(
*sec, "spinlock_deadlock_detection", 1) != 0;
#else
return pika::util::get_entry_as<int>(
return pika::detail::get_entry_as<int>(
*sec, "spinlock_deadlock_detection", 0) != 0;
#endif
}
Expand All @@ -498,7 +498,7 @@ namespace pika { namespace util {
#ifdef PIKA_HAVE_SPINLOCK_DEADLOCK_DETECTION
if (util::section const* sec = get_section("pika"); nullptr != sec)
{
return pika::util::get_entry_as<std::size_t>(*sec,
return pika::detail::get_entry_as<std::size_t>(*sec,
"spinlock_deadlock_detection_limit",
PIKA_SPINLOCK_DEADLOCK_DETECTION_LIMIT);
}
Expand All @@ -514,7 +514,7 @@ namespace pika { namespace util {
#ifdef PIKA_HAVE_SPINLOCK_DEADLOCK_DETECTION
if (util::section const* sec = get_section("pika"); nullptr != sec)
{
return pika::util::get_entry_as<std::size_t>(*sec,
return pika::detail::get_entry_as<std::size_t>(*sec,
"spinlock_deadlock_warning_limit",
PIKA_SPINLOCK_DEADLOCK_WARNING_LIMIT);
}
Expand All @@ -528,7 +528,7 @@ namespace pika { namespace util {
{
if (util::section const* sec = get_section("pika"); nullptr != sec)
{
return pika::util::get_entry_as<std::size_t>(
return pika::detail::get_entry_as<std::size_t>(
*sec, "trace_depth", PIKA_HAVE_THREAD_BACKTRACE_DEPTH);
}
return PIKA_HAVE_THREAD_BACKTRACE_DEPTH;
Expand All @@ -541,7 +541,7 @@ namespace pika { namespace util {
num_os_threads = 1;
if (util::section const* sec = get_section("pika"); nullptr != sec)
{
num_os_threads = pika::util::get_entry_as<std::uint32_t>(
num_os_threads = pika::detail::get_entry_as<std::uint32_t>(
*sec, "os_threads", 1);
}
}
Expand All @@ -564,7 +564,7 @@ namespace pika { namespace util {
if (util::section const* sec = get_section("pika.threadpools");
nullptr != sec)
{
return pika::util::get_entry_as<std::size_t>(
return pika::detail::get_entry_as<std::size_t>(
*sec, std::string(poolname) + "_size", 2);
}
return 2; // the default size for all pools is 2
Expand Down Expand Up @@ -593,8 +593,8 @@ namespace pika { namespace util {
if (util::section const* sec = get_section("pika.stacks");
nullptr != sec)
{
return pika::util::get_entry_as<int>(*sec, "use_guard_pages", 1) !=
0;
return pika::detail::get_entry_as<int>(
*sec, "use_guard_pages", 1) != 0;
}
return true; // default is true
}
Expand Down
Loading

0 comments on commit b0f52c6

Please sign in to comment.