[Mpi-forum] MPI_Pcontrol const argument

William Gropp wgropp at illinois.edu
Fri Apr 7 16:58:02 CDT 2017


That’s exactly what I was referring to - in the Fortran binding, this in an IN argument - which in C terms, means that it is const.  Now, as you note, in C it is passed by value, so “const” doesn’t add anything, other than a type qualifier that the compiler can mumble about.  I think that in looking at the language-independent version, the IN was noted, and const was added without thinking it through.

Bill

William Gropp
Acting Director and Chief Scientist, NCSA
Director, Parallel Computing Institute
Thomas M. Siebel Chair in Computer Science
University of Illinois Urbana-Champaign



> On Apr 7, 2017, at 3:37 PM, Jim Dinan <james.dinan at gmail.com> wrote:
> 
> I think my confusion is that the level argument is passed by value, so it should make no difference to the application whether it's const or not.  The const qualifier seems to place a limitation on an implementation of this routine, but I'm not sure why.
> 
>  ~Jim.
> 
> On Thu, Apr 6, 2017 at 10:48 AM, William Gropp <wgropp at illinois.edu <mailto:wgropp at illinois.edu>> wrote:
> There is no rationale, other than that this is an IN argument and hence is unchanged.  Of course, declaring it as const achieves nothing new.  I think it was just a rote application of that rule, to a routine that is rarely used.
> 
> Bill
> 
> William Gropp
> Acting Director and Chief Scientist, NCSA
> Director, Parallel Computing Institute
> Thomas M. Siebel Chair in Computer Science
> University of Illinois Urbana-Champaign
> 
> 
> 
>> On Apr 6, 2017, at 9:42 AM, Jim Dinan <james.dinan at gmail.com <mailto:james.dinan at gmail.com>> wrote:
>> 
>> Hi All,
>> 
>> I apologize if this is a dumb question -- what's the rationale for the const qualifier on the level argument to MPI_Pcontrol?
>> 
>> int MPI_Pcontrol(const int level, ...)
>> 
>> Cheers,
>>  ~Jim.
>> _______________________________________________
>> mpi-forum mailing list
>> mpi-forum at lists.mpi-forum.org <mailto:mpi-forum at lists.mpi-forum.org>
>> https://lists.mpi-forum.org/mailman/listinfo/mpi-forum <https://lists.mpi-forum.org/mailman/listinfo/mpi-forum>
> 
> _______________________________________________
> mpi-forum mailing list
> mpi-forum at lists.mpi-forum.org <mailto:mpi-forum at lists.mpi-forum.org>
> https://lists.mpi-forum.org/mailman/listinfo/mpi-forum <https://lists.mpi-forum.org/mailman/listinfo/mpi-forum>
> 
> _______________________________________________
> mpi-forum mailing list
> mpi-forum at lists.mpi-forum.org
> https://lists.mpi-forum.org/mailman/listinfo/mpi-forum

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mpi-forum.org/pipermail/mpi-forum/attachments/20170407/084476d3/attachment-0001.html>


More information about the mpi-forum mailing list