Skip to content

Commit

Permalink
Rename --pika:queuing to --pika:scheduler to match PIKA_SCHEDULER and…
Browse files Browse the repository at this point in the history
… pika.scheduler
  • Loading branch information
msimberg committed Jan 8, 2025
1 parent 225e7a5 commit 168f8f9
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .gitlab/scripts/run_performance_benchmarks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pika_targets=(
)
pika_test_options=(
"--pika:ini=pika.thread_queue.init_threads_count=100 \
--pika:queuing=local-priority \
--pika:scheduler=local-priority \
--repetitions=100 \
--tasks=500000"

Expand Down
2 changes: 1 addition & 1 deletion .jenkins/cscs-perftests/launch_perftests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set -ex
pika_targets=("task_overhead_report_test")
pika_test_options=(
"--pika:ini=pika.thread_queue.init_threads_count=100 \
--pika:queuing=local-priority --pika:threads=4 \
--pika:scheduler=local-priority --pika:threads=4 \
--repetitions=100 --tasks=500000")

# Build binaries for performance tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ namespace pika::detail {
std::size_t num_cores_;
std::size_t pu_step_;
std::size_t pu_offset_;
std::string queuing_;
std::string scheduler_;
std::string affinity_domain_;
std::string affinity_bind_;
std::size_t numa_sensitive_;
Expand Down
14 changes: 7 additions & 7 deletions libs/pika/command_line_handling/src/command_line_handling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace pika::detail {
std::ostringstream strm;

// default scheduler used for this run
strm << " {scheduler}: " << cfg.queuing_ << "\n";
strm << " {scheduler}: " << cfg.scheduler_ << "\n";

// amount of threads and cores configured for this run
strm << " {os-threads}: " << cfg.num_threads_ << "\n";
Expand Down Expand Up @@ -132,11 +132,11 @@ namespace pika::detail {
return mask_string;
}

std::string handle_queuing(detail::manage_config& cfgmap,
std::string handle_scheduler(detail::manage_config& cfgmap,
pika::program_options::variables_map& vm, std::string const& default_)
{
// command line options is used preferred
if (vm.count("pika:queuing")) return vm["pika:queuing"].as<std::string>();
if (vm.count("pika:scheduler")) return vm["pika:scheduler"].as<std::string>();

// use either cfgmap value or default
return cfgmap.get_value<std::string>("pika.scheduler", default_);
Expand Down Expand Up @@ -453,9 +453,9 @@ namespace pika::detail {
}

// handle setting related to schedulers
queuing_ = detail::handle_queuing(
scheduler_ = detail::handle_scheduler(
cfgmap, vm, rtcfg_.get_entry("pika.scheduler", "local-priority-fifo"));
ini_config.emplace_back("pika.scheduler=" + queuing_);
ini_config.emplace_back("pika.scheduler=" + scheduler_);

affinity_domain_ =
detail::handle_affinity(cfgmap, vm, rtcfg_.get_entry("pika.affinity", "pu"));
Expand Down Expand Up @@ -557,11 +557,11 @@ namespace pika::detail {
"(--pika:threads)");
}

if (!(queuing_ == "local-priority" || queuing_ == "abp-priority"))
if (!(scheduler_ == "local-priority" || scheduler_ == "abp-priority"))
{
throw pika::detail::command_line_error(
"Invalid command line option --pika:high-priority-threads, valid for "
"--pika:queuing=local-priority and --pika:queuing=abp-priority only");
"--pika:scheduler=local-priority and --pika:scheduler=abp-priority only");
}

ini_config.emplace_back("pika.thread_queue.high_priority_queues!=" +
Expand Down
24 changes: 12 additions & 12 deletions libs/pika/command_line_handling/src/parse_command_line.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,21 +281,21 @@ namespace pika::detail {
("pika:pu-offset", value<std::size_t>(),
"the first processing unit this instance of pika should be "
"run on (default: 0), valid for "
"--pika:queuing=local, --pika:queuing=abp-priority, "
"--pika:queuing=static, --pika:queuing=static-priority, "
"and --pika:queuing=local-priority only")
"--pika:scheduler=local, --pika:scheduler=abp-priority, "
"--pika:scheduler=static, --pika:scheduler=static-priority, "
"and --pika:scheduler=local-priority only")
("pika:pu-step", value<std::size_t>(),
"the step between used processing unit numbers for this "
"instance of pika (default: 1), valid for "
"--pika:queuing=local, --pika:queuing=abp-priority, "
"--pika:queuing=static, --pika:queuing=static-priority "
"and --pika:queuing=local-priority only")
"--pika:scheduler=local, --pika:scheduler=abp-priority, "
"--pika:scheduler=static, --pika:scheduler=static-priority "
"and --pika:scheduler=local-priority only")
("pika:affinity", value<std::string>(),
"the affinity domain the OS threads will be confined to, "
"possible values: pu, core, numa, machine (default: pu), valid for "
"--pika:queuing=local, --pika:queuing=abp-priority, "
"--pika:queuing=static, --pika:queuing=static-priority "
" and --pika:queuing=local-priority only")
"--pika:scheduler=local, --pika:scheduler=abp-priority, "
"--pika:scheduler=static, --pika:scheduler=static-priority "
" and --pika:scheduler=local-priority only")
("pika:bind", value<std::vector<std::string> >()->composing(),
"the detailed affinity description for the OS threads, see "
"the documentation for a detailed description of possible "
Expand All @@ -322,7 +322,7 @@ namespace pika::detail {
"the number of cores to utilize for the pika "
"runtime (default: 'all', i.e. the number of cores is based on "
"the number of total cores in the system)")
("pika:queuing", value<std::string>(),
("pika:scheduler", value<std::string>(),
"the queue scheduling policy to use, options are "
"'local', 'local-priority-fifo','local-priority-lifo', "
"'abp-priority-fifo', 'abp-priority-lifo', 'static', and "
Expand All @@ -331,8 +331,8 @@ namespace pika::detail {
("pika:high-priority-threads", value<std::size_t>(),
"the number of operating system threads maintaining a high "
"priority queue (default: number of OS threads), valid for "
"--pika:queuing=local-priority,--pika:queuing=static-priority, "
" and --pika:queuing=abp-priority only)")
"--pika:scheduler=local-priority,--pika:scheduler=static-priority, "
" and --pika:scheduler=abp-priority only)")
("pika:numa-sensitive", value<std::size_t>()->implicit_value(0),
"makes the local-priority scheduler NUMA sensitive ("
"allowed values: 0 - no NUMA sensitivity, 1 - allow only for "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ void init_resource_partitioner_handler(
if (pool_threads > 0)
{
// we use unspecified as the scheduler type and it will be set according to
// the --pika:queuing=xxx option or default.
// the --pika:scheduler=xxx option or default.
auto deft = ::pika::threads::scheduler_mode::default_mode;
rp.create_thread_pool(pool_name, pika::resource::scheduling_policy::shared_priority, deft);
// add N pus to network pool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ void init_resource_partitioner_handler(
if (pool_threads > 0)
{
// we use unspecified as the scheduler type and it will be set according to
// the --pika:queuing=xxx option or default.
// the --pika:scheduler=xxx option or default.
auto deft = ::pika::threads::scheduler_mode::default_mode;
rp.create_thread_pool(pool_name, pika::resource::scheduling_policy::shared_priority, deft);
// add N pus to network pool
Expand Down
2 changes: 1 addition & 1 deletion libs/pika/resource_partitioner/src/detail_partitioner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ namespace pika::resource::detail {
else
{
throw pika::detail::command_line_error(
"Bad value for command line option --pika:queuing");
"Bad value for command line option --pika:scheduler");
}

// set this scheduler on the pools that do not have a specified scheduler yet
Expand Down
6 changes: 3 additions & 3 deletions libs/pika/thread_manager/src/thread_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ namespace pika::threads::detail {
pools_.push_back(std::move(pool));
#else
throw pika::detail::command_line_error(
"Command line option --pika:queuing=local-priority-lifo is not configured in "
"Command line option --pika:scheduler=local-priority-lifo is not configured in "
"this build. Please make sure 128bit atomics are available.");
#endif
break;
Expand Down Expand Up @@ -356,7 +356,7 @@ namespace pika::threads::detail {
pools_.push_back(std::move(pool));
#else
throw pika::detail::command_line_error(
"Command line option --pika:queuing=abp-priority-fifo is not configured in "
"Command line option --pika:scheduler=abp-priority-fifo is not configured in "
"this build. Please make sure 128bit atomics are available.");
#endif
break;
Expand Down Expand Up @@ -396,7 +396,7 @@ namespace pika::threads::detail {
pools_.push_back(std::move(pool));
#else
throw pika::detail::command_line_error(
"Command line option --pika:queuing=abp-priority-lifo is not configured in "
"Command line option --pika:scheduler=abp-priority-lifo is not configured in "
"this build. Please make sure 128bit atomics are available.");
#endif
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ int main(int argc, char** argv)
for (auto const& scheduler : schedulers)
{
pika::init_params iparams;
iparams.cfg = {"--pika:queuing=" + std::string(scheduler)};
iparams.cfg = {"--pika:scheduler=" + std::string(scheduler)};
std::cout << iparams.cfg[0] << std::endl;
pika::init(pika_main, argc, argv, iparams);
}
Expand Down
8 changes: 4 additions & 4 deletions tests/performance/local/task_overhead.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace ex = pika::execution::experimental;
namespace tt = pika::this_thread::experimental;

// global vars we stick here to make printouts easy for plotting
static std::string queuing = "default";
static std::string scheduler = "default";
static std::size_t numa_sensitive = 0;
static std::uint64_t num_threads = 1;
static std::string info_string = "";
Expand All @@ -56,14 +56,14 @@ void print_stats(char const* title, char const* wait, char const* sched, std::in
if (csv)
{
fmt::print(temp, "{}, {:27}, {:15}, {:45}, {:8}, {:8}, {:20}, {:4}, {:4}, {:20}", count,
title, wait, sched, duration, us, queuing, numa_sensitive, num_threads, info_string);
title, wait, sched, duration, us, scheduler, numa_sensitive, num_threads, info_string);
}
else
{
fmt::print(temp,
"invoked {:1}, tasks {:27} {:15} {:18} in {:8} seconds : {:8} us/task, queue "
"{:20}, numa {:4}, threads {:4}, info {:20}",
count, title, wait, sched, duration, us, queuing, numa_sensitive, num_threads,
count, title, wait, sched, duration, us, scheduler, numa_sensitive, num_threads,
info_string);
}
std::cout << temp.str() << std::endl;
Expand Down Expand Up @@ -340,7 +340,7 @@ void function_apply_hierarchical_placement(std::uint64_t count, bool csv)
int pika_main(variables_map& vm)
{
{
if (vm.count("pika:queuing")) queuing = vm["pika:queuing"].as<std::string>();
if (vm.count("pika:scheduler")) scheduler = vm["pika:scheduler"].as<std::string>();

if (vm.count("pika:numa-sensitive"))
numa_sensitive = 1;
Expand Down
4 changes: 2 additions & 2 deletions tests/performance/local/task_overhead_report.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ using pika::program_options::variables_map;
using pika::chrono::detail::high_resolution_timer;

// global vars we stick here to make printouts easy for plotting
static std::string queuing = "default";
static std::string scheduler = "default";
[[maybe_unused]] static std::size_t numa_sensitive = 0;
[[maybe_unused]] static std::uint64_t num_threads = 1;
static std::string info_string = "";
Expand Down Expand Up @@ -117,7 +117,7 @@ void measure_function_create_thread_hierarchical_placement(
int pika_main(variables_map& vm)
{
{
if (vm.count("pika:queuing")) queuing = vm["pika:queuing"].as<std::string>();
if (vm.count("pika:scheduler")) scheduler = vm["pika:scheduler"].as<std::string>();

if (vm.count("pika:numa-sensitive"))
numa_sensitive = 1;
Expand Down

0 comments on commit 168f8f9

Please sign in to comment.