<div dir="ltr">Many constants cannot be used in "fixed array length in a declaration" because they are negative numbers, which is not only legal but the only choice for MPI_UNDEFINED, so you cannot use that criteria for anything.<br><br>We say "All named constants, with the exceptions noted below for Fortran, can be used in initialization expressions or assignments," which means the following is valid:<br><br>#include <mpi.h><br>static int x = MPI_ANY_SOURCE;<div>int main(void) { return 0; }<br><div><br></div><div>C static global initialization of integers requires compile-time constants (example below).  While we may have implied that all constants could be link-time constants, this is only possible for non-integer constants, i.e. handles and buffer address constants.</div><div><br></div><div>% cat init.c<br>extern int w;<br>static int* p = &w;<br>static int q = w;<br><br></div><div>% gcc -c init.c<br>init.c:3:16: error: initializer element is not a compile-time constant<br>static int q = w;<br>               ^<br>1 error generated.<br><br>Jeff<br><br>On Tue, May 2, 2023 at 9:51 PM Rolf Rabenseifner via mpi-forum <<a href="mailto:mpi-forum@lists.mpi-forum.org">mpi-forum@lists.mpi-forum.org</a>> wrote:<br>><br>> Dear implementor of an MPI library,<br>><br>> Based on the discussion today in the MPI forum meeting,<br>> I have the following urgent question to you:<br>><br>>   Did you implement all MPI constants that are described in Annex A.1.1<br>>     as of type "const int (or unnamed enum)"<br>>   as "C integer constant expression"<br>>     (according to the specification of the C language)?<br>><br>> If yes, then all is okay and the proposed change of the MPI standard in<br>>     <a href="https://github.com/mpi-forum/mpi-standard/pull/821/files">https://github.com/mpi-forum/mpi-standard/pull/821/files</a><br>> will not require any change of your MPI implementation.<br>><br>> If not, then please can you tell which MPI constant(s) MPI_XXX<br>><br>> - have you implemented in a way that<br>><br>>  - it still can be used in an initialization expression,<br>>    i.e., in a application statement like<br>>      int x=MPI_XXX;<br>>  - but it cannot be used as a case-label in a switch statement like<br>>      switch(MPI_XXX) {<br>>          case MPI_XXX: printf("XXX\n");<br>>          default: ;<br>>      }<br>>  - and cannot be used as a fixed array length in a declaration like<br>>      float x[MPI_XXX];<br>><br>> - and how implemented you such an MPI constant that this problem arises?<br>><br>> We'll discuss this again tomorrow May 3, 2023 at the beginning<br>> of the MPI forum meeting.<br>><br>> See you hopefully at the meeting,<br>> and hopefully reporting that you have no problem with the proposal,<br>>  <br>> kind regards<br>> Rolf<br>>  <br>><br>> ----- Original Message -----<br>> > From: "Rolf Rabenseifner" <<a href="mailto:rabenseifner@hlrs.de">rabenseifner@hlrs.de</a>><br>> > To: "Main MPI Forum mailing list" <<a href="mailto:mpi-forum@lists.mpi-forum.org">mpi-forum@lists.mpi-forum.org</a>><br>> > Cc: "Puri Bangalore" <<a href="mailto:pvbangalore@ua.edu">pvbangalore@ua.edu</a>>, "Claudia Blaas-Schenner" <<a href="mailto:claudia.blaas-schenner@tuwien.ac.at">claudia.blaas-schenner@tuwien.ac.at</a>>, "Jeff<br>> > Hammond" <<a href="mailto:jeff.science@gmail.com">jeff.science@gmail.com</a>><br>> > Sent: Tuesday, May 2, 2023 2:04:01 PM<br>> > Subject: Re: Informal meeting announcement for the May 2023 meeting of the MPI Forum<br>><br>> > Der forum memebers, dear Wesley,<br>> ><br>> > please can we add in the agenda after<br>> ><br>> >  Informal Errata Reading  705  Fortran has only compile-time constants   Rolf<br>> ><br>> > an additional slot<br>> ><br>> >  Errata Discussion  657 All C const int (or unnamed enum) as compile-time<br>> >  constants   Rolf, Jeff H.<br>> ><br>> > Bestr regards<br>> > Rolf<br>> ><br>> ><br>> > ----- Original Message -----<br>> >> From: "Rolf Rabenseifner" <<a href="mailto:rabenseifner@hlrs.de">rabenseifner@hlrs.de</a>><br>> >> To: "Main MPI Forum mailing list" <<a href="mailto:mpi-forum@lists.mpi-forum.org">mpi-forum@lists.mpi-forum.org</a>><br>> >> Cc: "Puri Bangalore" <<a href="mailto:pvbangalore@ua.edu">pvbangalore@ua.edu</a>>, "Claudia Blaas-Schenner"<br>> >> <<a href="mailto:claudia.blaas-schenner@tuwien.ac.at">claudia.blaas-schenner@tuwien.ac.at</a>><br>> >> Sent: Saturday, April 29, 2023 7:38:00 AM<br>> >> Subject: Informal meeting announcement for the May 2023 meeting of the MPI Forum<br>> ><br>> >> Dear forum members,<br>> >><br>> >> I would like to make the following announcements for the next MPI Forum Meeting<br>> >> (May 2-5, 2023):<br>> >><br>> >> - informal reading and discussion<br>> >>    #705 Errata: Fortran has only compile-time constants    Rolf<br>> >>      Issue <a href="https://github.com/mpi-forum/mpi-issues/issues/705">https://github.com/mpi-forum/mpi-issues/issues/705</a><br>> >>      PR    <a href="https://github.com/mpi-forum/mpi-standard/pull/819">https://github.com/mpi-forum/mpi-standard/pull/819</a><br>> >>      PDF<br>> >>      <a href="https://github.com/mpi-forum/mpi-standard/files/11358444/mpi41-report_Issue705_PR819.pdf">https://github.com/mpi-forum/mpi-standard/files/11358444/mpi41-report_Issue705_PR819.pdf</a><br>> >><br>> >> This errata should be completely discussed in next (May 2-5, 2023) meeting.<br>> >> It is then planned to have an final errata reading plus errata vote at next<br>> >> meeting (July 10-13, 2023).<br>> >><br>> >> It is a bug since MPI-2.2 because a problem in C was directly mapped to Fortran.<br>> >> This mapping was wrong.<br>> >> In Fortran, there is no distinction between link-time and compile-time<br>> >> constants.<br>> >><br>> >> Best regards<br>> >> Rolf Rabenseifner<br>> ><br>> ><br>> > --<br>> > Dr. Rolf Rabenseifner . . . . . . . . . .. . . <a href="mailto:rabenseifner@hlrs.de">rabenseifner@hlrs.de</a> .<br>> > High Performance Computing Center (HLRS) . . . ++49(0)711/685-65530 .<br>> > University of Stuttgart . . . . . . <a href="http://www.hlrs.de/people/rabenseifner">www.hlrs.de/people/rabenseifner</a> .<br>> > Nobelstr. 19, 70569 Stuttgart, Germany<br>><br>> --<br>> Dr. Rolf Rabenseifner . . . . . . . . . .. . . <a href="mailto:rabenseifner@hlrs.de">rabenseifner@hlrs.de</a> .<br>> High Performance Computing Center (HLRS) . . . ++49(0)711/685-65530 .<br>> University of Stuttgart . . . . . . <a href="http://www.hlrs.de/people/rabenseifner">www.hlrs.de/people/rabenseifner</a> .<br>> Nobelstr. 19, 70569 Stuttgart, Germany<br>> _______________________________________________<br>> mpi-forum mailing list<br>> <a href="mailto:mpi-forum@lists.mpi-forum.org">mpi-forum@lists.mpi-forum.org</a><br>> <a href="https://lists.mpi-forum.org/mailman/listinfo/mpi-forum">https://lists.mpi-forum.org/mailman/listinfo/mpi-forum</a><br><br><br><br>--<br>Jeff Hammond<br><a href="mailto:jeff.science@gmail.com">jeff.science@gmail.com</a><br><a href="http://jeffhammond.github.io/">http://jeffhammond.github.io/</a></div></div></div>