-
Notifications
You must be signed in to change notification settings - Fork 913
Coll/base: FIX bruck when sdtype and rdtype are different #10488
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
Coll/base: FIX bruck when sdtype and rdtype are different #10488
Conversation
Can one of the admins verify this patch? |
ok to test |
@FlorentGermain-Bull Thanks for the patch! |
There is a bug in the modified bruck alltoall algorithm in coll/base module. It is the algorithm 3 when using tuned dynamic choice and tuned choose it be default on some configurations. Here is the symptom:
Here is a reproducer that triggers this bug:
The sendbuf is a vector of 2 elements of 1 int: sender -1 receiver Before the fix:
After the fix:
Detailed bug behaviour: Correction: |
cd11939
to
0c82187
Compare
bot:aws:retest |
This is almost certainly an issue on v5.0.x. What about v4.1.x and v4.0.x? |
The bug is already there in v2.0.4 version. |
There are 2 things addressed in this patch, one optimization and one correctness.
Please change the text of the PR and the log of the commit to reflect the proposed changes. |
For the point 1. the use of a sdtype based datatype on rbuf on step 2 is also erroneous. If we keep tmpbuf as sdtypes, we also need to create a second |
0c82187
to
56ce62d
Compare
I have another optimization that basically remove the need for the displ array. Instead of using MPI level functions to create the intermediary datatypes, it used OMPI capabilities to create specialized datatypes with a gap in the beginning. Unfortunately I do not have write access to your repo I cannot push. Here is a quick manual path: replace the create_indexed_block call with the following code and remove the displs array. int vlen = (distance * 2) < size ? distance : size - distance;
struct ompi_datatype_t *ddt;
ompi_datatype_create_vector( 1,
vlen,
vlen * 2,
sdtype, &ddt);
new_ddt = ompi_datatype_create( ddt->super.desc.used );
ompi_datatype_add(new_ddt, ddt, (size + distance - 1) / (distance * 2), distance * sext, vlen * 2 * sext);
/* Commit the new datatype */
err = ompi_datatype_commit(&new_ddt);
if (err != MPI_SUCCESS) { line = __LINE__; goto err_hndl; } Using these routines we can create datatype in a more flexible way than using the MPI API, which means we can build the datatype representing the bruck exchange buffer on the fly, and skip the Step 1 (local rotation). |
FIX: switch tmpbuf from sdtype to rdtype representation to avoid illegal use of sdtype on rbuf and wrong behaviour when sdtype and rdtype are different OPTIM: build custom datatype through ompi_datatype_add instead of using ompi_datatype_create_indexed_block to reduce the number of temporary buffers used Signed-off-by: Florent Germain <florent.germain@atos.net>
56ce62d
to
99ca572
Compare
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@FlorentGermain-Bull @bosilca @ggouaillardet Is this PR ready to merge? |
Yes, it is ok for me @bosilca is the change in the datatype building ok for you? |
@bosilca ^^^ |
I like sndrcv() for the data copying, and I wish an analogue of ompi_datatype_add() was part of the MPI standard, that's a nice API option to have. I think it looks good to me with one caveat: shouldn't new_ddt get freed (or deleted/destroyed, but I'm thinking freed in this context)? |
Coll/base/coll_base_alltoall.c:ompi_coll_base_alltoall_intra_bruck
FIX: switch tmpbuf from sdtype to rdtype representation to avoid illegal use of sdtype
on rbuf and wrong behaviour when sdtype and rdtype are different
OPTIM: use ompi_datatype_create_indexed instead of
ompi_datatype_create_indexed_block to reduce the number of temporary buffers used
Signed-off-by: Florent Germain florent.germain@atos.net