-
Notifications
You must be signed in to change notification settings - Fork 280
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
mpi4: MPI_Info_get_string #4887
Comments
I have a question about the implementation of ProblemAccording to https://github.com/mpi-forum/mpi-issues/files/3951818/misc-2_safe_get_changes.pdf, the behavior of MPI_Info_get_string() looks different between Fortran and C/C++.
So if C versionint buflen = 4;
char str[4];
ierr = MPI_Info_get_string(info, "MPI_KEY_XXX", *buflen, str, flag);
// str = ['a', 'b', 'c', '\0'].
// buflen = 7 (EDIT: 2020/11/12 5:22PM CT) Fortran version (my syntax might be wrong)integer buflen
character str*4
buflen = 4
call MPI_Info_get_string(info, "MPI_KEY_XXX", buflen, str, flag, ierr);
C str = ['a', 'b', 'c', 'd'].
C buflen = 6 (EDIT: 2020/11/12 5:22PM CT) How to deal with it? Possible solutions
If 3, I'd like to know a reference implementation since I believe some existing MPI functions have adopted this technique. |
You forgot to describe what is the value of I think my current opinion is along your option
This may not be true. I am not sure how Fortran deals with Actually, we have a maximum info value length of 1024, so we could simply use a temporary stack buffer. |
Thanks. Yes, you're right. The return value of
It seems that that character will be treated as "\0" character, which is different from a single whitespace.
I am not sure how I can create different versions for the same function. Can the current Fortran binding mechanism create a totally different function with the same name (if so, I'd be happy if someone would point out such an MPI function in MPICH)? |
PMPI wouldn't be an issue (https://www.mpi-forum.org/docs/mpi-3.1/mpi31-report.pdf p.561). I just need to write it down somewhere.
|
We always use separate wrapper functions for the Fortran binding, ref.
Actually we have a precedent doing this. Reference 11cfc75, where we use a |
Thanks a lot! I now got how to implement this. |
mpi-forum/mpi-issues#146
https://github.com/mpi-forum/mpi-issues/files/3951818/misc-2_safe_get_changes.pdf
The text was updated successfully, but these errors were encountered: