From: Richard Treumann Date: January 11, 2008 9:09:44 AM CST To: mpi-21@XXXXXXXXXXXXX Cc: "mpi-21@mpi-forum.org" ,owner-mpi-21@XXXXXXXXXXXXX Subject: Re: [mpi-21] MPI_Pcontrol I do not see that it is relevant to the standards discussion that some compiler may exist that does not support const( ( Assume we modified the MPI standard to say:( int MPI_Send(const void*, int, MPI_Datatype, int, int, MPI_Comm);( ( This clarifies a requirement on the implementor to make sure the code that runs under the call to MPI_Send returns the buffer in exactly the condition it was in before the call. I think every implementor already understood that.( ( Putting the prototype in mpi.h this way tells a compiler that understands the const that optimizations can be made on the assumption that the buffer is returned unchanged.( ( A low feature compiler (Beta Version 0.1 maybe) could be written to tolerate the const but never make any optimizations based on it. Ignoring the const keywork will never give wrong results so compiling an application with an mpi.h that has const keywords and a compiler that ignores them is not a standards violation. It simply passes up a chance to give better performance. Version 1.1 of the compiler can start honoring const and anything that was compiled with V 0.1 before and V1.1 later will now get the optimizations const allows. The generated code will be correct either way.( ( Leaving const out of mpi.h can never produce wrong results for the application. The worst it can do is cause some compiler that could produce faster code if it saw the const to produce slightly less optimized code. To me, that says that if some implementation of MPI is expected to be used with a compiler that trips over the keyword const, the const can be removed from all mpi.h declarations and the implementation is still standards compliant. If the MPI implementation actually returns the send buffer in some modified state, it is a gross violation but leaving out the const keyword for a compiler that does not understand it seems OK.( ( If the target platform later gets a compiler that understands const a new mpi.h file can be provided that does have const in all the right places. Anything that gets recompiled will get the benefit but will work fine with older code that does not get recompiled.( ( Dick ( ( ( Dick Treumann - MPI Team/TCEM ( IBM Systems & Technology Group( Dept 0lva / MS P963 -- 2455 South Road -- Poughkeepsie, NY 12601( Tele (845) 433-7846 Fax (845) 433-8363( ( ( owner-mpi-21@mpi-forum.org wrote on 01/10/2008 07:58:37 PM:( ( > What was the idea behind defining the C interface for MPI_Pcontrol as,( > ( > MPI_Pcontrol(const int level, & )( > ( > Adding the const was a joke, right? It's completely meaningless.( > ( > Btw: all those that are worried about compilers compliant with the ( > const keyword, here you go. We have const in the mpi.h header from ( > MPI v1. The mpi C/C++ compilers are able to handle that keyword.( > ( > Thanks,( > .Erez( > ( >