Open MPI logo

Open MPI Development Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Development mailing list

Subject: Re: [OMPI devel] [OMPI svn] svn:open-mpi r18303
From: Ralph Castain (rhc_at_[hidden])
Date: 2008-04-25 17:25:03


As I said, it makes no difference to me. I just want to ensure that everyone
agrees on the interpretation of the MPI standard. We have had these
discussion in the past, with differing views. My guess here is that the port
was left open mostly because the person who wrote the C-binding forgot to
close it. ;-)

So, you MPI folks: do we allow multiple connections against a single port,
and leave the port open until explicitly closed? If so, then do we generate
an error if someone calls MPI_Finalize without first closing the port? Or do
we automatically close any open ports when finalize is called?

Or do we automatically close the port after the connect/accept is completed?

Thanks
Ralph

On 4/25/08 3:13 PM, "Aurélien Bouteiller" <bouteill_at_[hidden]> wrote:

> Actually, the port was still left open forever before the change. The
> bug damaged the port string, and it was not usable anymore, not only
> in subsequent Comm_accept, but also in Close_port or Unpublish_name.
>
> To more specifically answer to your open port concern, if the user
> does not want to have an open port anymore, he should specifically
> call MPI_Close_port and not rely on MPI_Comm_accept to close it.
> Actually the standard suggests the exact contrary: section 5.4.2
> states "it must call MPI_Open_port to establish a port [...] it must
> call MPI_Comm_accept to accept connections from clients". Because
> there is multiple clients AND multiple connections in that sentence, I
> assume the port can be used in multiple accepts.
>
> Aurelien
>
> Le 25 avr. 08 à 16:53, Ralph Castain a écrit :
>
>> Hmmm...just to clarify, this wasn't a "bug". It was my understanding
>> per the
>> MPI folks that a separate, unique port had to be created for every
>> invocation of Comm_accept. They didn't want a port hanging around
>> open, and
>> their plan was to close the port immediately after the connection was
>> established.
>>
>> So dpm_orte was written to that specification. When I reorganized
>> the code,
>> I left the logic as it had been written - which was actually done by
>> the MPI
>> side of the house, not me.
>>
>> I have no problem with making the change. However, since the
>> specification
>> was created on the MPI side, I just want to make sure that the MPI
>> folks all
>> realize this has now been changed. Obviously, if this change in spec
>> is
>> adopted, someone needs to make sure that the C and Fortran bindings -
>> do not-
>> close that port any more!
>>
>> Ralph
>>
>>
>>
>> On 4/25/08 2:41 PM, "bouteill_at_[hidden]" <bouteill_at_[hidden]> wrote:
>>
>>> Author: bouteill
>>> Date: 2008-04-25 16:41:44 EDT (Fri, 25 Apr 2008)
>>> New Revision: 18303
>>> URL: https://svn.open-mpi.org/trac/ompi/changeset/18303
>>>
>>> Log:
>>> Fix a bug that rpevented to use the same port (as returned by
>>> Open_port) for
>>> several Comm_accept)
>>>
>>>
>>> Text files modified:
>>> trunk/ompi/mca/dpm/orte/dpm_orte.c | 19 ++++++++++---------
>>> 1 files changed, 10 insertions(+), 9 deletions(-)
>>>
>>> Modified: trunk/ompi/mca/dpm/orte/dpm_orte.c
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =
>>> =====================================================================
>>> --- trunk/ompi/mca/dpm/orte/dpm_orte.c (original)
>>> +++ trunk/ompi/mca/dpm/orte/dpm_orte.c 2008-04-25 16:41:44 EDT
>>> (Fri, 25 Apr
>>> 2008)
>>> @@ -848,8 +848,14 @@
>>> {
>>> char *tmp_string, *ptr;
>>>
>>> + /* copy the RML uri so we can return a malloc'd value
>>> + * that can later be free'd
>>> + */
>>> + tmp_string = strdup(port_name);
>>> +
>>> /* find the ':' demarking the RML tag we added to the end */
>>> - if (NULL == (ptr = strrchr(port_name, ':'))) {
>>> + if (NULL == (ptr = strrchr(tmp_string, ':'))) {
>>> + free(tmp_string);
>>> return NULL;
>>> }
>>>
>>> @@ -863,15 +869,10 @@
>>> /* see if the length of the RML uri is too long - if so,
>>> * truncate it
>>> */
>>> - if (strlen(port_name) > MPI_MAX_PORT_NAME) {
>>> - port_name[MPI_MAX_PORT_NAME] = '\0';
>>> + if (strlen(tmp_string) > MPI_MAX_PORT_NAME) {
>>> + tmp_string[MPI_MAX_PORT_NAME] = '\0';
>>> }
>>> -
>>> - /* copy the RML uri so we can return a malloc'd value
>>> - * that can later be free'd
>>> - */
>>> - tmp_string = strdup(port_name);
>>> -
>>> +
>>> return tmp_string;
>>> }
>>>
>>> _______________________________________________
>>> svn mailing list
>>> svn_at_[hidden]
>>> http://www.open-mpi.org/mailman/listinfo.cgi/svn
>>
>>
>> _______________________________________________
>> devel mailing list
>> devel_at_[hidden]
>> http://www.open-mpi.org/mailman/listinfo.cgi/devel
>
>
> _______________________________________________
> devel mailing list
> devel_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/devel