<div dir="ltr">Hi,<br><br>You can use probing techniques to determine length of the message coming from master. It works well. Also to send large message you need to uses non-blocking techniques which the buffer length can be determined in advanced for MPI.(This buffer length is different from the array length). Sending an array with 10000 element (Char array) is quiet possible based on my experience. <br>
<br>Good luck,<br><br>Reza<br><br><div class="gmail_quote">On Tue, Aug 12, 2008 at 11:11 PM, David Gingold <span dir="ltr"><<a href="mailto:david.gingold@sicortex.com">david.gingold@sicortex.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div style="">
<br><div><div class="Ih2E3d"><div>On Aug 11, 2008, at 10:22 PM, Robert Kubrick wrote:</div><br></div><div class="Ih2E3d"><blockquote type="cite"><div style="margin: 0px;">I want to send a number of elements through MPI_Send. However the receiving process does not know the maximum number of elements in the array (it might be very large). The code will look something like:</div>
<div style="margin: 0px; min-height: 14px;"><br></div><div style="margin: 0px;">MASTER:</div><div style="margin: 0px;">char buf[500];</div><div style="margin: 0px;">...</div><div style="margin: 0px;">MPI_Send(&buf, 500, SomeDerivedType, 1, ...);</div>
<div style="margin: 0px; min-height: 14px;"><br></div><div style="margin: 0px;">==============</div><div style="margin: 0px; min-height: 14px;"><br></div><div style="margin: 0px;">WORKER:</div><div style="margin: 0px;">char buf[100];</div>
<div style="margin: 0px;">const int Master = 0;</div><div style="margin: 0px;">MPI_Irecv(&buf, 100, SomeDerivedType, Master, ...);</div></blockquote><br></div></div><div>Robert, bear in mind that your example exceeds the bounds of the MPI standard. MPI is required to support calling Recv with a buffer larger than needed, but not with one smaller than needed.</div>
<div><br></div><div>I mention this not (only) to be pedantic. Some MPI implementations do not support what you are doing.</div><div><br></div><div>-dg</div><div><br></div><font color="#888888"><div> <span style="border-collapse: separate; border-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><span style="border-collapse: separate; border-spacing: 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px;"><div>
--</div><div>David Gingold</div><div>Principal Software Engineer</div><div>SiCortex</div><div>Three Clock Tower Place, Suite 210</div><div>Maynard MA 01754</div><div>(978) 897-0214 x224</div><div><br></div><br></span></span> </div>
<br></font></div></blockquote></div><br><br clear="all"><br>-- <br>Gholamreza Sobhaninejad(Reza)<br>PhD candidate, University of Tokyo<br>Earthquake Research Institute<br>Tel: 090-9807-2477<br>
</div>