No reason for doing so comes to mind - I suspect the original author probably
started out doing a "free", then discovered that the overlying MPI code was
passing in an array and so just converted it to a memset. Either way, it really
should be the responsibility of the user's code to deal with the memory.
I'll remove it. Thanks for pointing it out!
On Jan 20, 2012, at 1:28 AM, Y.MATSUMOTO wrote:
> Dear All,
>
> Next is question about "MPI_Close_port".
> According to the MPI-2.2 standard,
> the "port_name" argument of
> MPI_Close_port() is marked as 'IN'.
> But, in Open MPI (both trunk and 1.4.x), the content of
> "port_name" is updated in MPI_Close_port().
> It seems to violate the MPI standard.
>
> The following is the suspicious part.
> ---ompi/mca/dpm/orte/dpm_orte.c---
>919 static int close_port(char *port_name)
>920 {
>921 /* the port name is a pointer to an array - DO NOT FREE IT! */
>922 memset(port_name, 0, MPI_MAX_PORT_NAME);
>923 return OMPI_SUCCESS;
>924 }
> ---ompi/mca/dpm/orte/dpm_orte.c---
>
> This memset makes "port_name" "INOUT".
> Would you tell me why call this memset?
>
> Best regards,
> Yuki MATSUMOTO
> MPI development team,
> Fujitsu
>
> ___
> devel mailing list
> de...@open-mpi.org
> http://www.open-mpi.org/mailman/listinfo.cgi/devel