Skip to content

ABI: MPI_Abi_set_fortran_booleans() is broken, boolean values may not fit in C int #886

Open
@dalcinl

Description

@dalcinl

The current C prototype of MPI_Abi_set_fortran_booleans is

int MPI_Abi_set_fortran_booleans(int logical_size, int logical_true, int logical_false);

However, for logical size={8|16}, the values of logical_{true|false} may not fit in a C int.

Jeff has proposed the following quick fix in private communication with me:

int MPI_Abi_set_fortran_booleans(int logical_size, const void *logical_true, const void *logical_false);

PS: If the main intention of this API is to be called from Fortran, maybe we can take one small step further and use the Fortran-default pass-by-address for all arguments, that is, use const int *logical_size, --- --- this way saving about one second to type the extra VALUE attribute that would be required otherwise in the Fortran side to declare the Fortran interface to this BIND(C) routine.

Metadata

Metadata

Assignees

Labels

chap-abiABI Chapter Committeehad readingCompleted the formal proposal readingmpi-5.0For inclusion in the MPI 5.0 standardscheduled first-and-only voteFirst-and-only vote is scheduled for the next meetingwg-abiABI Working Groupwg-fortranFortran Working Group

Type

No type

Projects

Status

Had Reading

Relationships

None yet

Development

No branches or pull requests

Issue actions