Newsgroups: comp.parallel.mpi
From: llewins@msmail4.hac.com (Lloyd J Lewins)
Subject: Re: Buffer too small in MPI_Recv?
Organization: Hughes Aerospace Electronics Co.
Date: Fri, 15 Dec 1995 09:49:44 -0800
Message-ID: <llewins-1512950949440001@x-147-16-95-58.es.hac.com>

In article <4an5lv$3d4@knot.queensu.ca>, chang@mjs1.Phy.QueensU.CA wrote:

> It turns out the error message is somehow misleading.

Maybe not. I would think that the original error message was caused
because the user buffer specified in the MPI_Recv call was too small. For
example, if the incoming message was 100 bytes, but the matching receive
specified 4 MPI_INTS, the user buffer would be too small to hold the
entire message, and an error would be generated. Perhaps when you have
(the more complex) ISend version of your code, you introduced a bug of
this type. I would recomend that you use tags (or communicators) to
distinguish messages of different sizes.

I would avoid using MPI_Bsend unless your application really requires
buffering to avoid deadlock issues. I would certainly avoid MPI_IBSEND -
its unlikely to do you any good.

> The reason for MPI_ISEND is that the
> communication system can do the communication by itself, and communication
> and computation can overlap.

This is not the only reason, the other is simply to decouple the sender
and receiver, particularly since standard mode sends may be synchronous.
Legitimate implementations of MPI do not have to overlap communication
with computation, although the SP2 may.
 
> What can I do if I want non-buffered send? If I have a large message to send,
> and want to avoid copying from buf to system allocated buffer, I would want
> to use non-buffered send.

There is no way to assure non-buffered sends. Its up to the
implementation, which may avoid buffers if it can, and if it would improve
performance.

--------------------------------------------------------------------------
Lloyd J Lewins                                  Mail Stop: RE/R1/B507
Hughes Aerospace and Electronics Co.            P.O. Box 92426
                                                Los Angeles, CA 90009-2426
Email: llewins@msmail4.hac.com                  USA
Tel: 1 (310) 334-1145
Any opinions are not neccessarily mine, let alone my employers!!

