-
Notifications
You must be signed in to change notification settings - Fork 38
Make sure MPL_RANK is updated with new comm #72
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
Make sure MPL_RANK is updated with new comm #72
Conversation
|
Can confirm I run into this issue in ecmwf-ifs/ectrans/pull/318, and that this PR fixes it. Thanks |
|
Thanks @samhatfield could you make this program into a test? |
|
Could you also check that this works with the option -DENABLE_MPL_F77_DEPRECATED=ON ? |
|
Done. I wasn't sure what all the extra CMake infrastructure was for for the existing MPL tests (e.g. test_mpl_no_output.cmake) so I just ignored that and declared the test like I do in ecTrans. Hope that's okay. |
5ae301a to
b04e58c
Compare
wdeconinck
left a comment
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.
Thanks @samhatfield for this fix and extra test!
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 get this error when configuring fiat with -DENABLE_MPL_F77_DEPRECATED=ON
@marsdeno , some inconsistency with MPL_F77 and MPL_F08 ?
/***/fiat/tests/test_mpl_split_comm.F90:34:90:
34 | CALL MPL_MESSAGE("TEST_MPL_SPLIT_COMM", "MPL_COMM_SPLIT failed", IERROR, LDABORT=.TRUE.)
| 1
Error: Type mismatch in argument 'kerror' at (1); passed CHARACTER(19) to INTEGER(4)
|
Just a case of shifting the arguments of MPL_F77/ |
I guess you can name the IERROR argument to avoid this error |
Yeah true. However is the "API" of MPL_F77 not supposed to match exactly that of MPL_F08? |
|
Yes, but that should be fixed in another PR, or reviewed by @marsdeno without blocking this PR from going in. |
|
The problem is that CALL MPL_MESSAGE("TEST_MPL_SPLIT_COMM", CDSTRING="MPL_COMM_SPLIT failed", KERROR=IERROR, &
& LDABORT=.TRUE.)doesn't work either: (Error when enabling |
|
You have to also name the CDMESSAGE argument: CALL MPL_MESSAGE(CDMESSAGE="TEST_MPL_SPLIT_COMM", CDSTRING="MPL_COMM_SPLIT failed", KERROR=IERROR, &
& LDABORT=.TRUE.)I am not sure that |
|
I have fixed the MPL_F77_DEPRECATED functionality. |
FYI, you can name every argument in Fortran, even if non-optional, and then you can move it around as you want. |
Hmm, I'm not sure. I think I was copying the style I saw elsewhere. |
I did not know that! |
@samhatfield yes please |
Done. |
MPL_SETDFLT_COMMdoesn't update the value ofMPL_COMM(which is simply the one-indexed rank of"this rank" in the currently set communicator). It updates
MPL_NUMPROCbut notMPL_COMM. Here'san example of this behaviour:
This prints:
"Rank 4 in group 1 in comm with size 3" -> there's your problem.
This PR fixes this by having
MPL_SETDFLT_COMMalso updateMPL_COMM. The same program prints: