forked from open-mpi/ompi
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Fix issue with circular dependency in request.h #1
Open
cniethammer
wants to merge
20
commits into
devreal:mpi-continue-master
Choose a base branch
from
cniethammer:mpi-continue-master-header-fix
base: mpi-continue-master
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.
Open
Fix issue with circular dependency in request.h #1
cniethammer
wants to merge
20
commits into
devreal:mpi-continue-master
from
cniethammer:mpi-continue-master-header-fix
Conversation
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
Continuations provide a mechanism for attaching callbacks to outstanding operation requests. A call to MPIX_Continue takes a request, a function pointer, a user-provided data pointer, and a status object (or `MPI_STATUS_IGNORE`), along with a continution request: ``` MPI_Request req; // status object has to remain valid until the callback is invoked MPI_Status *status = malloc(sizeof(MPI_Status)); char *buf = ...; MPI_Irecv(buf, ..., MPI_ANY_SOURCE, ... &req); MPIX_Continue(&req, &complete_cb, buf, status, cont_req); assert(req == MPI_REQUEST_NULL); ``` The ownership of non-persistent requests is returned to MPI and the pointer to the request will be set to `MPI_REQUEST_NULL`. The callback is passed the status pointer and the user-provided data pointer: ``` void complete_cb(MPI_Status *status, void *user_data) { printf("Send completed\n"); char *buf = (char*)user_data; process_msg(buf, status->MPI_SOURCE); free(buf); // free the send buffer free(status); // free the status } ``` The status has to remain valid until the invocation of the callback and is set according to the operation before the callback is invoked. The continuation is *registered* with the provided contination request. The continuation request is a request allocated with `MPIX_Continue_init`: ``` MPIX_Continue_init(info, &cont_req); ``` Continuation requests may be used to test/wait for completion of all continuations registered with cont_req using `MPI_Test/Wait`. Supported info keys are: - "mpi_continue_poll_only": only execute continuations when MPI_Test/Wait is called on the continuation request (default: false) - "mpi_continue_enqueue_complete": if true, the continuation is executed immediately if the operations are already complete when MPIX_Continue is called. Execution is deferred otherwise (default: false) - "mpi_continue_max_poll": the maximum number of continuations to execute when calling MPI_Test on the continuation request (default: -1, meaning unlimited) A continuation may in turn be attached to a continuation request, in which case the continuation request will be executed once all continuations registered with the continuation request have completed. In addition to MPIX_Continue, the proposal also includes MPIX_Continueall which attaches a continuation to a set of requests such that the continuation is executed once all operations have completed. The implementation reflects the current state of the proposal and may change at any time, following discussions in the MPI Forum. The goal of this Open MPI extension is to provide a working implementation to the community to experiment with this API. Signed-off-by: Joseph Schuchart <schuchart@icl.utk.edu> Signed-off-by: George Bosilca <bosilca@icl.utk.edu>
Signed-off-by: Joseph Schuchart <schuchart@icl.utk.edu>
Signed-off-by: Joseph Schuchart <schuchart@icl.utk.edu>
Signed-off-by: Joseph Schuchart <schuchart@icl.utk.edu>
Signed-off-by: Joseph Schuchart <schuchart@icl.utk.edu>
Signed-off-by: Joseph Schuchart <schuchart@icl.utk.edu>
Signed-off-by: Joseph Schuchart <schuchart@icl.utk.edu>
Signed-off-by: Joseph Schuchart <schuchart@icl.utk.edu>
Signed-off-by: Joseph Schuchart <schuchart@icl.utk.edu>
Signed-off-by: Joseph Schuchart <schuchart@icl.utk.edu>
Signed-off-by: Joseph Schuchart <schuchart@icl.utk.edu>
…active Continuation requests are persistent requests that are always active. They are implicitly restarted when the first continuation is registered. Signed-off-by: Joseph Schuchart <schuchart@icl.utk.edu>
…lete at registration Signed-off-by: Joseph Schuchart <schuchart@icl.utk.edu>
…/waiting on them Signed-off-by: Joseph Schuchart <schuchart@icl.utk.edu>
…he sync Signed-off-by: Joseph Schuchart <schuchart@icl.utk.edu>
…ns while waiting No other threads should execute them if the continuation request is limited to polling only. Signed-off-by: Joseph Schuchart <schuchart@icl.utk.edu>
Signed-off-by: Joseph Schuchart <schuchart@icl.utk.edu>
…quests Signed-off-by: Joseph Schuchart <schuchart@icl.utk.edu>
Some static functions in request.h make use of continuation routines if continuations are enabled. This causes problems with the circular include dependency of both. To overcome this problem include request.h here without enabling features of the continuation extension. Note: This solution must be rethought if one wants to use the affected static functions from request.h in continuation.h itself. Signed-off-by: Christoph Niethammer <niethammer@hlrs.de>
03c36a5
to
e2979db
Compare
a02d677
to
b6440c0
Compare
31f7b91
to
fcd2d9b
Compare
fcd2d9b
to
790a7b6
Compare
790a7b6
to
68b887c
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Some static functions in request.h make use of continuation routines if continuations are enabled. This causes problems with the circular include dependency of both. To overcome this problem include request.h here without enabling features of the continuation extension.
Note: This solution must be rethought if one wants to use the affected static functions from request.h in continuation.h itself.
Signed-off-by: Christoph Niethammer niethammer@hlrs.de