From: Erez Haba Date: January 23, 2008 12:19:20 PM CST To: "mpi-21@mpi-forum.org" Subject: RE: [mpi-21] Proposal EH2 & MPI_INPLACE Reply-To: mpi-21@XXXXXXXXXXXXX Thanks Hubert, This is the same discussion we had at the MPI Forum meeting re const. I looked up (again) the C99 standard (and the C89) and the standard does not preclude a function from changing the constant buffer as long as it not done through a pointer that is passed in as const. That is, for the following function void foo(const void* buf1, void* buf2); it is perfectly alright to change buf2 even if it overlaps with buf1. I will bring up this point in the *const* proposal. For your reference, the C99 standard words are: ------ const int *ptr_to_constant; The contents of any object pointed to by ptr_to_constant shall not be modified through that pointer, but ptr_to_constant itself may be changed to point to another object. ------- Note the "...through that pointer..." text. Thanks, .Erez -----Original Message----- From: owner-mpi-21@XXXXXXXXXXXXX On Behalf Of Hubert Ritzdorf Sent: Wednesday, January 23, 2008 10:01 AM To: mpi-21@XXXXXXXXXXXXX Subject: Re: [mpi-21] Proposal EH2 & MPI_INPLACE Erez Haba wrote: > Using the send buffer pointer? > > Can you give an example? > > If you define 2 derived datatypes send_type and recv_type, which don't overlap, you can execute for example MPI_Gather in the following way { int buf[1000]; MPI_Gather (buf, 1, send_type, buf, 1, recv_type, 0, MPI_COMM_WORLD); .... } In this case buf is send and recv buffer of MPI_Gather and buf is IN and OUT argument of MPI_Gather in root process 0. Hubert