<html><body>
<p>We also should decide whether every call to <tt>MPI_GET_PROCESSOR_NAME</tt> across the life of the task must return the same name.  On very large machines running very large jobs, migration of some tasks off of failing nodes and on to robust nodes will become more interesting. Checkpoint/restart raises the same issue.  A restarted job will probably not have the same task to node mapping.<br>
<br>
We can either require the name to remain constant and allow that it might be a "virtual" name or require that it return an "actual" name but allow it to change.<br>
<br>
               Dick <br>
<br>
Dick Treumann  -  MPI Team/TCEM            <br>
IBM Systems & Technology Group<br>
Dept 0lva / MS P963 -- 2455 South Road -- Poughkeepsie, NY 12601<br>
Tele (845) 433-7846         Fax (845) 433-8363<br>
<br>
<br>
<tt>mpi-21-bounces@cs.uiuc.edu wrote on 01/25/2008 12:00:42 PM:<br>
<br>
> This is a discussion-point for MPI 2.1, Ballot 4.<br>
> <br>
> This is a follow up to:<br>
>   MPI_GET_PROCESSOR_NAME and Fortran  <br>
>   in <a href="http://www.cs.uiuc.edu/homes/wgropp/projects/parallel/MPI/mpi-">http://www.cs.uiuc.edu/homes/wgropp/projects/parallel/MPI/mpi-</a><br>
> errata/index.html<br>
> with mail discussion in<br>
>   <a href="http://www.cs.uiuc.edu/homes/wgropp/projects/parallel/MPI/mpi-">http://www.cs.uiuc.edu/homes/wgropp/projects/parallel/MPI/mpi-</a><br>
> errata/discuss/procname/<br>
> <br>
> _________________________________________________________________<br>
> <br>
> MPI_GET_PROCESSOR_NAME and Fortran <br>
> and in C and all MPI_xxxx_GET_NAME routines<br>
> -------------------------------------------<br>
> <br>
> Summary: Returning strings is defined in MPI_GET_PROCESSOR_NAME <br>
> and MPI_xxxx_GET_NAME quite different. Not all implementations<br>
> are doing the same with zero-filling. And what they do is<br>
> at least with MPI_GET_PROCESSOR_NAME different to what<br>
> the current standard requires. A propose to adapt the standard<br>
> to the common reasonable implementations. <br>
> The very short proposal for clarification can be found at the <br>
> end of this text, see C. Proposal.<br>
> <br>
> A. MPI_GET_PROCESSOR_NAME <br>
> -------------------------<br>
> <br>
> MPI_GET_PROCESSOR_NAME defines the returned string with several<br>
> sentences:<br>
> <br>
> (1)   OUT   name       A unique specifier for the actual <br>
>                        (as opposed to virtual) node.<br>
> (2)   OUT   resultlen  Length (in printable characters) <br>
>                        of the result returned in name<br>
> <br>
> (3) The argument name must represent storage that is at least<br>
>     MPI_MAX_PROCESSOR_NAME characters long. <br>
> (4) MPI_GET_PROCESSOR_NAME may write up to this many characters<br>
>     into name.<br>
> (5) The number of characters actually written is returned <br>
>     in the output argument, resultlen.<br>
> (6) The user must provide at least MPI_MAX_PROCESSOR_NAME <br>
>     space to write the processor name — processor names <br>
>     can be this long. <br>
> (7) The user should examine the ouput argument, resultlen, <br>
>     to determine the actual length of the name.<br>
> <br>
> I tested 5 implementations with C and Fortran.<br>
> <br>
> I called MPI_GET_PROCESSOR_NAME with a string (i.e. character <br>
> array) with size MPI_MAX_PROCESSOR_NAME+2.<br>
> <br>
> C-Interface:<br>
> ------------ <br>
>   All tested C implementations returned the processor-name <br>
>   in name[0..resultlen-1] and a the non-printable character <br>
>   \0 in name[resultlen].<br>
>   All other elements of name were unchanged.<br>
> <br>
>   (1,2,3,4,  6,7) are fulfilled;<br>
>   (5) are __NOT__ fulfilled, because resultlen+1 characters <br>
>   are written in name.<br>
> <br>
>   My opinion: The returned name and resultlen is what the user <br>
>   expects, but the standard needs a clarification.<br>
> <br>
> Fortran-Interface:<br>
> ------------------<br>
>   All tested Fortran implementations return in processor-name <br>
>   in name(1:resultlen) and the rest of the total string is <br>
>   filled with spaces.<br>
> <br>
>   (1,  3,    6,7) are fulfilled;<br>
>   (2,4,5) are __NOT__ fulfilled, because  <br>
>   MPI_MAX_PROCESSOR_NAME+2 characters are written in name.<br>
> <br>
>   My opinion: The returned name and resultlen is what the user <br>
>   expects, but the standard needs a clarification.<br>
> <br>
> <br>
> B. MPI_COMM_GET_NAME (and other MPI_xxxx_GET_NAME)<br>
> --------------------------------------------------<br>
> <br>
> The string output is defined with different wording:<br>
> <br>
> (1) OUT   comm_name   the name previously stored on the <br>
>                       communicator, or an empty string if no <br>
>                       such name exists (string)<br>
> (2) OUT   resultlen   length of returned name (integer)<br>
> <br>
> (3) name should be allocated so that it can hold a resulting <br>
>     string of length MPI_MAX_OBJECT_NAME characters.<br>
> (4) If the user has not associated a name with a communicator, <br>
>     or an error occurs, MPI_COMM_GET_NAME will return an empty<br>
>     string (all spaces in Fortran, "" in C and C++).<br>
> <br>
> and in the definition of MPI_COMM_SET_NAME:<br>
> (5) The length of the name which can be stored is limited <br>
>     to the value of MPI_MAX_OBJECT_NAME in Fortran and <br>
>     MPI_MAX_OBJECT_NAME-1 in C and C++ to allow for the null <br>
>     terminator.<br>
> (6) Attempts to put names longer than this will result in <br>
>     truncation of the name. <br>
> (7) MPI_MAX_OBJECT_NAME must have a value of at least 64.<br>
> <br>
> I called MPI_COMM_GET_NAME with a string (i.e. character <br>
> array) with size MPI_MAX_OBJECT_NAME+2.<br>
> <br>
> C-Interface:<br>
> ------------ <br>
>   All tested C implementations returned the communicator-name <br>
>   in comm_name[0..resultlen-1] and a the non-printable character <br>
>   \0 in comm_name[resultlen].<br>
>   One implementation filled up the rest until <br>
>   name[MPI_MAX_OBJECT_NAME-1] with \0.<br>
>   In all other implementations, all other elements of comm_name <br>
>   were unchanged.<br>
> <br>
>   (1-7) are fulfilled although the retuned zero-filling in comm_name<br>
>   depends on the implementations;<br>
> <br>
>   My opinion: A clarification can make the API unambiguous.<br>
> <br>
> Fortran-Interface:<br>
> ------------------<br>
>   All tested Fortran implementations return in processor-name <br>
>   in name(1:resultlen) and the rest of the total string is <br>
>   filled with spaces.<br>
> <br>
>   (1-7) are fulfilled;<br>
>   Although it is nowhere specified that the string must be filled<br>
>   up with spaces, and not only until position MPI_MAX_OBJECT_NAME<br>
>   but also further spaces until the end of comm_name.<br>
> <br>
>   My opinion: The returned name and resultlen is what the user <br>
>   expects, but the standard needs a clarification.<br>
> <br>
> C. Proposal:<br>
> ------------<br>
> <br>
> Add the following sentences to the current interface definitions:<br>
> ------------------<br>
> In C, a \0 is additionally stored at name[resultlen]. resultlen <br>
> cannot be larger then MPI_MAX_PROCESSOR_NAME-1 <br>
> (or MPI_MAX_OBJECT_NAME-1). In Fortran, name(resultlen+1:) <br>
> is filled with spaces. resultlen cannot be larger then <br>
> MPI_MAX_PROCESSOR_NAME (or MPI_MAX_OBJECT_NAME). <br>
> ------------------<br>
> <br>
> Typo correction:<br>
> ----------------<br>
> MPI-1.1 Sect. 7.1, page 193, beginning of line 29 reads<br>
>    examine the ouput argument<br>
> But should read (additional t in output)<br>
>    examine the output argument <br>
> <br>
> <br>
> Okay?<br>
> _________________________________________________________________<br>
> <br>
> Best regards<br>
> Rolf<br>
> <br>
> PS: Attached my tests and short protocols<br>
> <br>
> <br>
> <br>
> Dr. Rolf Rabenseifner . . . . . . . . . .. email rabenseifner@hlrs.de<br>
> High Performance Computing Center (HLRS) . phone ++49(0)711/685-65530<br>
> University of Stuttgart . . . . . . . . .. fax ++49(0)711 / 685-65832<br>
> Head of Dpmt Parallel Computing . . . www.hlrs.de/people/rabenseifner<br>
> Nobelstr. 19, D-70550 Stuttgart, Germany . (Office: Allmandring 30)<br>
> [attachment "mpi_get_xxx_name.tar.gz" deleted by Richard <br>
> Treumann/Poughkeepsie/IBM] _______________________________________________<br>
> mpi-21 mailing list<br>
> mpi-21@cs.uiuc.edu<br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/mpi-21">http://lists.cs.uiuc.edu/mailman/listinfo/mpi-21</a><br>
</tt></body></html>