Folks,

a bunch of C bindings have comments such as
/* XXX -- CONST -- do not cast away const -- update mca/coll */
and that has been there for a long time.

i made PR #839 https://github.com/open-mpi/ompi/pull/839 to fix this.
the change is quite massive (270 files) since :
- the C bindings had to be modified
- the MCA frameworks had to be modified
- the MCA components had to be modified

i did my best to update all the components, but i was not able to build all of them
(mainly because i do not have the required libs)
if a component is not updated, the worst case scenario should be a warning about
function types.

currently, 99% of the work is done.
components based on Mellanox proprietary libraries (fca, mxm and hcoll) still issue some warnings, the root cause is proprietary libs interfaces should be updated with the const keywords where needed.

i did not change MPI_Reduce_local (ompi/mpi/c/reduce_local.c)
the reason is there is the change would have been half baked anyway.
it could have fully baked if the MPI_User_function type was
typedef void (MPI_User_function)(const void *, void *, int *, MPI_Datatype *);
instead of
typedef void (MPI_User_function)(void *, void *, int *, MPI_Datatype *);

fwiw, in MPI 2.2, the C++ binding has the const modifier, but not the C one.
per #140 https://svn.mpi-forum.org/trac/mpi-forum-web/ticket/140

/* NOT CHANGING the following API's to keep backward compatibility and ease of use */

so it seems it was intentional not to add the const modifier to MPI_User_function

as i wrote earlier, the change is quite massive.
i plan to commit it by the end of next week, unless there are any objections.
(and then i will PR for v2.x, and v1.10 but only if there is a request)

Cheers,

Gilles

Reply via email to