-
Notifications
You must be signed in to change notification settings - Fork 899
handle errors gracefuly to prevent SEGV #13194
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
Closed
Closed
Changes from all commits
Commits
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 hidden or 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 |
---|---|---|
|
@@ -150,7 +150,7 @@ static ucc_status_t oob_allgather_test(void *req) | |
size_t msglen = oob_req->msglen; | ||
int probe_count = 5; | ||
int rank, size, sendto, recvfrom, recvdatafrom, | ||
senddatafrom, completed, probe; | ||
senddatafrom, completed, probe, rc; | ||
|
||
size = ompi_comm_size(comm); | ||
rank = ompi_comm_rank(comm); | ||
|
@@ -175,10 +175,16 @@ static ucc_status_t oob_allgather_test(void *req) | |
senddatafrom = (rank - oob_req->iter + size) % size; | ||
tmprecv = (char*)oob_req->rbuf + (ptrdiff_t)recvdatafrom * (ptrdiff_t)msglen; | ||
tmpsend = (char*)oob_req->rbuf + (ptrdiff_t)senddatafrom * (ptrdiff_t)msglen; | ||
MCA_PML_CALL(isend(tmpsend, msglen, MPI_BYTE, sendto, MCA_COLL_BASE_TAG_UCC, | ||
rc = MCA_PML_CALL(isend(tmpsend, msglen, MPI_BYTE, sendto, MCA_COLL_BASE_TAG_UCC, | ||
MCA_PML_BASE_SEND_STANDARD, comm, &oob_req->reqs[0])); | ||
MCA_PML_CALL(irecv(tmprecv, msglen, MPI_BYTE, recvfrom, | ||
if (OMPI_SUCCESS != rc) { | ||
return rc; | ||
} | ||
rc = MCA_PML_CALL(irecv(tmprecv, msglen, MPI_BYTE, recvfrom, | ||
MCA_COLL_BASE_TAG_UCC, comm, &oob_req->reqs[1])); | ||
if (OMPI_SUCCESS != rc) { | ||
return rc; | ||
} | ||
} | ||
probe = 0; | ||
do { | ||
|
@@ -206,6 +212,8 @@ static ucc_status_t oob_allgather(void *sbuf, void *rbuf, size_t msglen, | |
oob_req->msglen = msglen; | ||
oob_req->oob_coll_ctx = oob_coll_ctx; | ||
oob_req->iter = 0; | ||
oob_req->reqs[0] = NULL; | ||
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. Technically I think this should be MPI_REQUEST_NULL. |
||
oob_req->reqs[1] = NULL; | ||
*req = oob_req; | ||
return UCC_OK; | ||
} | ||
|
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.
I'm not sure if conversion is safe here, return value of this function is ucc_status_t and might be not compatible with ompi error codes. If rc is positive number then it's actually not an error from ucc perspective since all errors in ucc are negative. Maybe just to make it safe the function returns UCC_ERR_NO_MESSAGE in case of error.
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.
I don't think this is correct. The macro ends up calling the
.pml_isend
field in the PML struct, which in the case of UCX points to mca_pml_ucx_isend, a function that returns OMPI errors.