-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add a bypass scheduler to improve mpi continuations #1195
Draft
biddisco
wants to merge
40
commits into
pika-org:main
Choose a base branch
from
biddisco:mpi-bypass
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+685
−270
Draft
Changes from all commits
Commits
Show all changes
40 commits
Select commit
Hold shift + click to select a range
1092ab3
Remove accidentally duplicated init of mpi
biddisco c617fdd
Fix bug fetching non existant mpi pool
biddisco a4c4202
Ensure completion mode commmand line and ENV var defaults match
biddisco a8246e2
Fix mpi algorithm test
biddisco 7f86541
Fix inshpect violation
biddisco e4aecd2
Fix a warning (that is not valid, but annoying)
biddisco fab14c9
Remove debug message left in by mistake
biddisco 7adc4f6
Stop command line completion mode from clobbering $ENV var if set
biddisco c907efb
Fix review comments
biddisco 980b5b4
Get fallback MPI completion mode from runtime configuration
msimberg 27e5ba7
Fix review comments: remove incorrect doc/comments
biddisco f3a3b07
Fix (intentional) error msg detection in mpi algorithm test
biddisco 058e27d
Fix pika::util::detail::function lookup fail
biddisco eed85ed
Detect MPIx continuations at configure time to improve testing
biddisco 2148ea8
Fix copyright header on new material
biddisco a58f844
use try_compile (instead of try run) test for mpi continuations detec…
biddisco b7b61f4
Move cmake tests/check for openmpi to cmake folder
biddisco ac45f96
Disable sanitizer checks for troublesome error handler tests
biddisco 2128b42
add repeat-until-fail to tests to better check mpi testing branch
biddisco f9b583c
Update cmake/tests/check_openmpi_continuations.cpp
biddisco 14024b0
clang-format cleanup
biddisco e8d51df
Use MPIX_CONT_POLL_ONLY in mpi continuation polling to better control…
biddisco bfc0a4e
Simplify the exception error msg generation (asan flagging problems)
biddisco 1740ade
make sure transfer is always after trigger to ensure correct behaviour
biddisco c398315
Add new MPIX continuation mode that executes continuations directly
biddisco 6941f7a
Remove old MPIx suspend mode and use continuation mode by default
biddisco 6a01cbc
Cleanup namespace "detail" usage (remove unnecessary uses)
biddisco d08e547
Add a new bypass scheduler to execute tasks inliine on a pika thread
biddisco 9f0d830
Fix a thread create error - do not schedule was being ignored
biddisco 85cd74e
Adjust transform_mpi to use bypass scheduler and fix some wrinkles
biddisco fad487d
Clean up bypass scheduler, remove debug, extraneous code
biddisco 548f2d5
Adding more (shared scheduler) debug info - especially threadinfo
biddisco 2fa4aed
Fix inshpect/spelling violations
biddisco 53b29da
Disable debug messages
biddisco 1cb5a17
Fix CMakeLists header check violation
biddisco 5f581dc
Hide dbg() lambda inside PIKA_DEBUG ifdef
biddisco cc1941d
Use thread id check to decide if bypass scheduler is needed
biddisco fcbf6bb
Fix a bad error code use
biddisco de64414
Fix some bypass scheduler issues when using dla-future
biddisco 7867f22
Remove obsolete cout message
biddisco File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Copyright (c) 2021 ETH Zurich | ||
// | ||
// SPDX-License-Identifier: BSL-1.0 | ||
// Distributed under the Boost Software License, Version 1.0. (See accompanying | ||
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | ||
|
||
// simple compile test to see if mpix continuations are present | ||
|
||
#include <mpi-ext.h> | ||
#include <mpi.h> | ||
|
||
#if !defined(OMPI_HAVE_MPI_EXT_CONTINUE) | ||
static_assert(false); | ||
#endif | ||
|
||
int main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ | |
#include <pika/execution_base/any_sender.hpp> | ||
#include <pika/execution_base/receiver.hpp> | ||
#include <pika/execution_base/sender.hpp> | ||
#include <pika/executors/thread_pool_scheduler_queue_bypass.hpp> | ||
#include <pika/functional/detail/tag_fallback_invoke.hpp> | ||
#include <pika/functional/invoke.hpp> | ||
#include <pika/mpi_base/mpi.hpp> | ||
|
@@ -50,14 +51,15 @@ namespace pika::mpi::experimental { | |
using execution::thread_priority; | ||
using pika::execution::experimental::just; | ||
using pika::execution::experimental::let_value; | ||
using pika::execution::experimental::thread_pool_scheduler_queue_bypass; | ||
using pika::execution::experimental::transfer; | ||
using pika::execution::experimental::transfer_just; | ||
using pika::execution::experimental::unique_any_sender; | ||
|
||
// get mpi completion mode settings | ||
auto mode = get_completion_mode(); | ||
bool inline_com = use_inline_completion(mode); | ||
bool inline_req = use_inline_request(mode); | ||
bool completions_inline = use_inline_completion(mode); | ||
bool requests_inline = use_inline_request(mode); | ||
|
||
#ifdef PIKA_DEBUG | ||
// ---------------------------------------------------------- | ||
|
@@ -77,29 +79,65 @@ namespace pika::mpi::experimental { | |
execution::thread_priority::boost : | ||
execution::thread_priority::normal; | ||
|
||
#ifdef PIKA_DEBUG | ||
auto dgb = []() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Short for |
||
PIKA_DETAIL_DP(mpi_tran<1>, debug(str<>("transform_mpi"), "complete")); | ||
}; | ||
#endif | ||
auto completion_snd = [=](MPI_Request request) -> unique_any_sender<> { | ||
if (!inline_com) | ||
if (!completions_inline) // not inline : a transfer is required | ||
{ | ||
if (request == MPI_REQUEST_NULL) | ||
{ | ||
return transfer_just(default_pool_scheduler(p)); | ||
} | ||
return transfer_just(default_pool_scheduler(p), request) | trigger_mpi(mode); | ||
return just(request) | trigger_mpi(mode) | transfer(default_pool_scheduler(p)); | ||
} | ||
if (threads::detail::get_self_id() == threads::detail::invalid_thread_id) | ||
{ | ||
if (request == MPI_REQUEST_NULL) | ||
{ | ||
return just() | | ||
transfer(ex::with_annotation( | ||
ex::thread_pool_scheduler_queue_bypass{}, "transform_mpi")); | ||
} | ||
return just(request) | trigger_mpi(mode) | | ||
transfer(ex::with_annotation( | ||
ex::thread_pool_scheduler_queue_bypass{}, "transform_mpi")); | ||
} | ||
else | ||
{ | ||
if (request == MPI_REQUEST_NULL) { return just(); } | ||
return just(request) | trigger_mpi(mode); | ||
} | ||
if (request == MPI_REQUEST_NULL) { return just(); } | ||
return just(request) | trigger_mpi(mode); | ||
}; | ||
|
||
if (inline_req) | ||
if (requests_inline) | ||
{ | ||
return dispatch_mpi_sender<Sender, F>{PIKA_MOVE(sender), PIKA_FORWARD(F, f)} | | ||
if (threads::detail::get_self_id() == threads::detail::invalid_thread_id) | ||
{ | ||
auto snd0 = PIKA_FORWARD(Sender, sender) | | ||
transfer(ex::with_annotation( | ||
ex::thread_pool_scheduler_queue_bypass{}, "transform_mpi")); | ||
return dispatch_mpi(PIKA_MOVE(snd0), PIKA_FORWARD(F, f)) | | ||
let_value(completion_snd); | ||
} | ||
return dispatch_mpi(PIKA_MOVE(sender), PIKA_FORWARD(F, f)) | | ||
#ifdef PIKA_DEBUG | ||
let_value(completion_snd) | ex::then(dgb); | ||
#else | ||
let_value(completion_snd); | ||
#endif | ||
} | ||
else | ||
{ | ||
auto snd0 = PIKA_FORWARD(Sender, sender) | transfer(mpi_pool_scheduler(p)); | ||
return dispatch_mpi_sender<decltype(snd0), F>{PIKA_MOVE(snd0), PIKA_FORWARD(F, f)} | | ||
return dispatch_mpi(PIKA_MOVE(snd0), PIKA_FORWARD(F, f)) | | ||
#ifdef PIKA_DEBUG | ||
let_value(completion_snd) | ex::then(dgb); | ||
#else | ||
let_value(completion_snd); | ||
#endif | ||
} | ||
} | ||
|
||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.