Re: [mpiwg-tools] Too strict for flags in MPI_T_pvar_get_info?
Hi Junchao, Thanks as always for your sharp eyes. I think though in this case that Nathan is correct. Since we only define a C interface for MPI_T and try to ignore Fortran altogether, it is okay to use the C convention for true and false. Kathryn _________________________________________________________________ Kathryn Mohror, [email protected], http://scalability.llnl.gov/ Scalability Team @ Lawrence Livermore National Laboratory, Livermore, CA, USA On 8/14/14, 9:49 AM, "Nathan Hjelm" <[email protected]> wrote:
On Aug 14, 2014, at 10:35 AM, Junchao Zhang <[email protected]> wrote:
It is a minor issue. In the Standard, the description for int MPI_T_pvar_get_info(..., int *readonly, int *continuous, int *atomic) says: Upon return, the argument readonly is set to zero if the variable can be written or reset by the user. It is set to one if the variable can only be read. (Same thing happens to continuous and atomic.)
The description mandates an implementation must return 1 as TRUE, which does not follow C's convention. Other parts of MPI use true/false instead of 1/0 in description. Section 2.6.3 make it clear that true means non-zero.
How does that not follow C¹s convention? C mandates that the evaluation of a boolean operator (<, >, !, etc) MUST evaluate to either 0 or 1. Returning 0/1 here makes perfect sense.
Other parts of MPI probably use true/false because fortran logicals do not use 0/1 for false/true.
-Nathan Hjelm
participants (1)
-
Kathryn Mohror