[Mpi-22] [Mpi-forum] MPI 2.2 proposal: resolving MPI_Request_free issues

Erez Haba erezh at [hidden]
Thu Jul 17 13:01:24 CDT 2008



-----Original Message-----
From: mpi-22-bounces_at_[hidden] [mailto:mpi-22-bounces_at_[hidden]] On Behalf Of Underwood, Keith D
Sent: Wednesday, July 16, 2008 4:32 PM
To: MPI 2.2
Subject: Re: [Mpi-22] [Mpi-forum] MPI 2.2 proposal:resolving MPI_Request_free issues

>> I don't quite understand examples 1 and 2 (how would they cause segv's
>> in the TCP stack).  It is permissible to (pseudocode):
>>
>>   while (bytes_to_send > 0) {
>>      rc = write(fd, buffer, bytes_to_send);
>>      if (rc > 0) {
>>         buffer += rc;
>>         bytes_to_send -= rc;
>>      } else {
>>         ...error...
>>      }
>>   }
>>   free(buffer);
>>
>> regardless of what the receiver does.  I'm not a kernel guy; does
>> updating TCP sequence numbers also interact with the payload buffer?
>
>[erezh] it will never happen with your code above; but you are not using
>async zcopy.
>The pattern in windows is to use overlapped send (write) which is still
>active when the function returns, and is the most efficient way to send
>your buffer. I know it's possible with Linux but I don't' have the exact
>pattern.

> [Keith]
> So, how does this work for other users of zero copy?  How do they know
> when the send buffer is truly free?

[erezh] you get a notification from your local resource manager; on windows with the overlapped mechanism you have few ways to get notified. 1) The overlapped event get set, the thread can wait on it. 2) a completion port notification that the thread can dequeue. 3) an APC (similar to unix signal) get queued to the thread (thread need to be in an alertable state)



More information about the Mpi-22 mailing list