-
Notifications
You must be signed in to change notification settings - Fork 26
Wrappers for iPic3D #223
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
base: main
Are you sure you want to change the base?
Wrappers for iPic3D #223
Changes from all commits
ac264b4
28948e6
7d1f796
155c53a
b6a9af6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -338,6 +338,9 @@ USER_DEFINED_WRAPPER(int, Wait, (MPI_Request*) request, (MPI_Status*) status) | |
| fflush(stdout); | ||
| #endif | ||
| } | ||
| if (flag) { | ||
| statusPtr->MPI_ERROR = MPI_SUCCESS; | ||
| } | ||
| if (p2p_deterministic_skip_save_request == 0) { | ||
| if (flag) LOG_POST_Wait(request, statusPtr); | ||
| } | ||
|
|
@@ -393,6 +396,38 @@ USER_DEFINED_WRAPPER(int, Request_get_status, (MPI_Request) request, | |
| return retval; | ||
| } | ||
|
|
||
| USER_DEFINED_WRAPPER(int, Cancel, (MPI_Request *) request) | ||
| { | ||
| int retval; | ||
| DMTCP_PLUGIN_DISABLE_CKPT(); | ||
| MPI_Request realRequest = VIRTUAL_TO_REAL_REQUEST(*request); | ||
| JUMP_TO_LOWER_HALF(lh_info.fsaddr); | ||
| if( realRequest == MPI_REQUEST_NULL ){ | ||
| retval = MPI_SUCCESS; | ||
| } else { | ||
| retval = NEXT_FUNC(Cancel)(&realRequest); | ||
| } | ||
| RETURN_TO_UPPER_HALF(); | ||
| DMTCP_PLUGIN_ENABLE_CKPT(); | ||
| return retval; | ||
| } | ||
|
|
||
| USER_DEFINED_WRAPPER(int, Request_free, (MPI_Request *) request) | ||
| { | ||
| int retval; | ||
| DMTCP_PLUGIN_DISABLE_CKPT(); | ||
| MPI_Request realRequest = VIRTUAL_TO_REAL_REQUEST(*request); | ||
| JUMP_TO_LOWER_HALF(lh_info.fsaddr); | ||
| if( realRequest == MPI_REQUEST_NULL ){ | ||
|
Collaborator
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. Same question here, as above. If the lower half will handle
Author
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. Good afternoon! |
||
| retval = MPI_SUCCESS; | ||
| } else { | ||
| retval = NEXT_FUNC(Request_free)(&realRequest); | ||
| } | ||
| RETURN_TO_UPPER_HALF(); | ||
| DMTCP_PLUGIN_ENABLE_CKPT(); | ||
| return retval; | ||
| } | ||
|
|
||
| DEFINE_FNC(int, Get_elements, (const MPI_Status *) status, | ||
| (MPI_Datatype) datatype, (int *) count); | ||
| DEFINE_FNC(int, Get_elements_x, (const MPI_Status *) status, | ||
|
|
@@ -418,4 +453,5 @@ PMPI_IMPL(int, MPI_Get_elements_x, const MPI_Status *status, | |
| MPI_Datatype datatype, MPI_Count *count) | ||
| PMPI_IMPL(int, MPI_Request_get_status, MPI_Request request, int* flag, | ||
| MPI_Status *status) | ||
|
|
||
| PMPI_IMPL(int, MPI_Cancel, MPI_Request *request) | ||
| PMPI_IMPL(int, MPI_Request_free, MPI_Request *request) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| #include <stdio.h> | ||
| #include <stdlib.h> | ||
| #include <mpi.h> | ||
| #include <unistd.h> | ||
|
|
||
| int main(int argc, char* argv[]) | ||
| { | ||
| MPI_Init(&argc, &argv); | ||
|
|
||
| int size, rank, buf; | ||
| MPI_Comm_size(MPI_COMM_WORLD, &size); | ||
| MPI_Comm_rank(MPI_COMM_WORLD, &rank); | ||
|
|
||
| if(size != 2){ | ||
| printf("The application works only with 2 processes.\n"); | ||
| fflush(stdout); | ||
| MPI_Abort(MPI_COMM_WORLD, EXIT_FAILURE); | ||
| } | ||
|
|
||
| if(rank==0){ | ||
| buf = 1; | ||
| MPI_Request req; | ||
| MPI_Status stat; | ||
|
|
||
| #if 0 | ||
| MPI_Irecv(&buf, 1, MPI_INT, 1, 0, MPI_COMM_WORLD, &req); | ||
| MPI_Cancel(&req); | ||
| printf("Posted Irecv and cancelled request.\n");fflush(stdout); | ||
|
|
||
| #else | ||
| MPI_Isend(&buf, 1, MPI_INT, 1, 0, MPI_COMM_WORLD, &req); | ||
| MPI_Cancel(&req); | ||
| printf("Posted Isend and cancelled request.\n");fflush(stdout); | ||
|
|
||
| #endif | ||
|
|
||
| // Sleep | ||
| printf("Sleeping for 30 seconds.\n");fflush(stdout); | ||
| sleep(30); | ||
|
|
||
| MPI_Wait(&req, &stat); | ||
| } | ||
| MPI_Barrier(MPI_COMM_WORLD); | ||
| if(rank==0){ | ||
| printf("Finishing application.\n");fflush(stdout); | ||
| } | ||
| return 0; | ||
| } |
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.
Isn't the
ifbranch superfluous? Won't the lower half simply return with success if the request is MPI_REQUEST_NULL?If so, why should MANA duplicate the logic of MPI?