From: rusrabe@XXXXXXXXXXXXXXXXXXXXXXXXXX Subject: MPI_GET_PROCESSOR_NAME Fortran and C To: lusk@XXXXXXXXXXX Date: Tue, 21 Dec 1999 11:31:59 +0100 (MEZ) Cc: mpi-core@XXXXXXXXXXX Sender: owner-mpi-core@XXXXXXXXXXX I want to remember to the original question from Nils Joensson who asked about the C and the Fortran interface of MPI_GET_PROCESSOR_NAME(name, resultlen). The MPI standard says in general (not about the specific language bindings): | The 'name' is a character string... | From this value it must be possible to identify a specific piece of | hardware... | The argument 'name' must represent storage that is at least | MPI_MAX_PROCESSOR_NAME characters long. | MPI_GET_PROCESSOR_NAME may write up to this many characters into | 'name'. | The numbers of characters actually written is returned in the output | argument, resultlen. | Advice to users. ... The user should examine the output argument, | 'resultlen', to determine the actual length | of the name. I would expect: - 'resultlen' and the 'resultlen' characters in 'name' contain the same value in all language bindings. - The 'resultlen' characters in 'name' are printable and do not contain trailing blanks or null characters. - Additionally, only in the C and C++ binding, a '\0' is stored in name[resultlen]. (This is e.g. the behavior of CRAY's MPI.) I do not see, that there is any need to modify the standard in the way, that we allow or require that MPI_GET_PROCESSOR_NAME must write blanks in the last (MPI_MAX_PROCESSOR_NAME-resultlen) characters of name. The application programmer has no problem with this solution, e.g. Fortran: write(*,*) name(1:resultlen),' rank=',myrank C: printf("%s rank=%d", name, myrank) Rolf Rolf Rabenseifner High Performance Computing Parallel Computing Center Stuttgart (HLRS) Rechenzentrum Universitaet Stuttgart (RUS) Phone: ++49 711 6855530 Allmandring 30 FAX: ++49 711 6787626 D-70550 Stuttgart rabenseifner@XXXXXXXXXXXXXXXXXXXX Germany http://www.hlrs.de/people/rabenseifner