Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting default scheduler mode via the configuration database #3814

Merged
merged 3 commits into from May 2, 2019
Merged
Changes from 2 commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -124,6 +124,11 @@ namespace hpx { namespace parallel { namespace util
}
hpx::wait_all(first_touch);

for (auto && f : first_touch)
{
f.get(); // rethrow exceptions
}

This comment has been minimized.

Copy link
@msimberg

msimberg May 2, 2019

Contributor

I think this officially exposes the brokenness of our NUMA handling(?) on CircleCI (https://circleci.com/gh/STEllAR-GROUP/hpx/86317). #3802 also had problems with this. We might just have to disable or remove this example and leave it to @biddisco to replace this numa_allocator with his new and improved one ;)

// return the overall memory block
return p;
}
@@ -41,8 +41,16 @@ namespace hpx { namespace threads { namespace policies
reduce_thread_priority |
delay_exit |
enable_stealing |
enable_idle_backoff
enable_idle_backoff,
///< This option represents the default mode.
all_flags =
do_background_work |
reduce_thread_priority |
delay_exit |
fast_idle_mode |
enable_elasticity |
enable_stealing |
enable_idle_backoff
};
}}}

@@ -34,6 +34,7 @@
#include <memory>
#include <mutex>
#include <set>
#include <string>
#include <utility>
#include <vector>

@@ -51,6 +52,18 @@ namespace hpx { namespace threads { namespace policies
, parent_pool_(nullptr)
, background_thread_count_(0)
{
// if there is a cfg setting for the default_scheduler_mode, use that
// instead of the built-in default
std::string default_scheduler_mode = hpx::get_config_entry(
"hpx.default_scheduler_mode", std::string());

if (!default_scheduler_mode.empty())
{
mode = scheduler_mode(hpx::util::safe_lexical_cast<std::size_t>(
default_scheduler_mode));
HPX_ASSERT((mode & ~scheduler_mode::all_flags) == 0);

This comment has been minimized.

Copy link
@msimberg

msimberg Apr 23, 2019

Contributor

A message would probably be good here saying that the config entry contains illegal scheduler options.

This comment has been minimized.

Copy link
@hkaiser

hkaiser Apr 23, 2019

Author Member

Yah, I was thinking of throwing an exception, I might just do that instead.

This comment has been minimized.

Copy link
@msimberg

msimberg Apr 23, 2019

Contributor

Yeah, that works. I was thinking of HPX_ASSERT_MSG but either is fine with me.

}

set_scheduler_mode(mode);

#if defined(HPX_HAVE_THREAD_MANAGER_IDLE_BACKOFF)
@@ -552,6 +552,16 @@ namespace hpx { namespace threads
hwloc_bitmap_free(cpuset);
return mask;
}
else
{
std::string errstr = std::strerror(errno);

lk.unlock();
HPX_THROW_EXCEPTION(no_success,
"topology::get_thread_affinity_mask_from_lva",
"failed calling 'hwloc_get_area_membind_nodeset', "
"reported error: " + errstr);
}
}

hwloc_bitmap_free(nodeset);
@@ -200,6 +200,7 @@ namespace hpx { namespace util
"max_idle_backoff_time = ${HPX_MAX_IDLE_BACKOFF_TIME:"
HPX_PP_STRINGIZE(HPX_PP_EXPAND(HPX_IDLE_BACKOFF_TIME_MAX)) "}",
#endif
"default_scheduler_mode = ${HPX_DEFAULT_SCHEDULER_MODE}",

/// If HPX_HAVE_ATTACH_DEBUGGER_ON_TEST_FAILURE is set,
/// then apply the test-failure value as default.
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.