<div dir="ltr">Dear all,<div><br></div><div>I am all set with your suggestions and my program is working quite well without any "unexpected message" since then, thanks again.</div><div><br></div><div>However now I am facing a small problem I describe next.</div>
<div><br></div><div>My receiver process receives actually 2 types of messages (2 different tags):</div><div><ul><li>the basic tag means that the message is a "data message" ("data" tag) that should be processed.</li>
<li>the second one means that the worker process is done and it will send no more messages ("end_of_processing" tag).</li></ul>Once all worker processes send their end_of_processing tag, the receiver process finishes its execution.<br>
</div><div><br></div><div>The problem I noticed is that some of the last messages sent by the worker processes were not being processed. I think the problem is related with the logic I am using with MPI_WAITANY in the receiver process. I am simply counting the number of end_of_processing messages received and if it reaches the number of worker processes, I finish the execution without checking if there are more messages to be received at the MPI_WAITANY queue.</div>
<div><br></div><div>As the order that messages arrive is not relevant for MPI_WAITANY I think that my logic forgets some of the messages at the end of the queue. Is this right?</div><div><br></div><div>Is there any way to check if there is any pending request to be processed?</div>
<div><br></div><div>Best regards,<br></div><div>Luiz</div><div><br></div><div><br></div><div class="gmail_extra"><div class="gmail_quote">On 16 January 2014 16:57, "Antonio J. Peņa" <span dir="ltr"><<a href="mailto:apenya@mcs.anl.gov" target="_blank">apenya@mcs.anl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
<div><br>
A profiling of both of your codes would help to understand where
the time is spent and the difference between them in terms of
performance.<br>
<br>
Antonio<div><div class="h5"><br>
<br>
<br>
On 01/16/2014 12:47 PM, Luiz Carlos da Costa Junior wrote:<br>
</div></div></div><div><div class="h5">
<blockquote type="cite">
<div dir="ltr">Yes, I am comparing original x new implementation.
<div><br>
</div>
<div>The original implementation is as follows.</div>
<div><br>
</div>
<div><span style="font-family:'courier new',monospace">c-----------------------------------------------------------------------</span><br>
</div>
<div>
<div><font face="courier new, monospace"> subroutine
my_receiver_original</font></div>
<div><font face="courier new, monospace">c
------------------------------------------------------------------</font></div>
<div><font face="courier new, monospace"> (...)</font></div>
<div><font face="courier new, monospace"><br>
</font></div>
<div><font face="courier new, monospace">c Local</font></div>
<div><font face="courier new, monospace">c -----</font></div>
<div><font face="courier new, monospace"> integer*4
m_stat(MPI_STATUS_SIZE)</font></div>
<div><font face="courier new, monospace"> character
card*(zbuf) ! buffer for messages received</font></div>
<div><font face="courier new, monospace"><br>
</font></div>
<div><font face="courier new, monospace"> do while(
keep_receiving )</font></div>
<div><font face="courier new, monospace"> call
MPI_RECV(card, zbuf, MPI_CHARACTER,</font></div>
<div><font face="courier new, monospace"> .
MPI_ANY_SOURCE, M_RECCSV, MY_COMM,</font></div>
<div><font face="courier new, monospace"> .
m_stat, m_ierr )</font></div>
<div><font face="courier new, monospace"><br>
</font></div>
<div><font face="courier new, monospace">c Process
message: disk IO</font></div>
<div><font face="courier new, monospace">c
---------------</font></div>
<div><font face="courier new, monospace"> <DO
SOMETHING></font></div>
<div><font face="courier new, monospace"> if(
SOMETHING_ELSE ) then</font></div>
<div><font face="courier new, monospace">
keep_receiving = .false.</font></div>
<div><font face="courier new, monospace"> end if</font></div>
<div><font face="courier new, monospace"> end do</font></div>
<div><font face="courier new, monospace"><br>
</font></div>
<div><font face="courier new, monospace"> (...)</font></div>
<div><font face="courier new, monospace"><br>
</font></div>
<div><font face="courier new, monospace"> return</font></div>
<div><font face="courier new, monospace"> end</font></div>
</div>
<div class="gmail_extra"><br>
Regards,</div>
<div class="gmail_extra">Luiz</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On 16 January 2014 16:19, Balaji,
Pavan <span dir="ltr"><<a href="mailto:balaji@mcs.anl.gov" target="_blank">balaji@mcs.anl.gov</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><br>
On Jan 16, 2014, at 12:16 PM, Luiz Carlos da Costa
Junior <<a href="mailto:lcjunior@ufrj.br" target="_blank">lcjunior@ufrj.br</a>>
wrote:<br>
> No, these failures don't occur all the time. I have
a successful run (with my original implementation) which
I am using as the base case for comparison.<br>
<br>
</div>
What are the two cases you are comparing? Original
implementation vs. new implementation? What’s the
original implementation?<br>
<div>
<div><br>
— Pavan<br>
<br>
_______________________________________________<br>
discuss mailing list <a href="mailto:discuss@mpich.org" target="_blank">discuss@mpich.org</a><br>
To manage subscription options or unsubscribe:<br>
<a href="https://lists.mpich.org/mailman/listinfo/discuss" target="_blank">https://lists.mpich.org/mailman/listinfo/discuss</a><br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
<br>
<fieldset></fieldset>
<br>
<pre>_______________________________________________
discuss mailing list <a href="mailto:discuss@mpich.org" target="_blank">discuss@mpich.org</a>
To manage subscription options or unsubscribe:
<a href="https://lists.mpich.org/mailman/listinfo/discuss" target="_blank">https://lists.mpich.org/mailman/listinfo/discuss</a></pre>
</blockquote>
<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888"><pre cols="72">--
Antonio J. Peņa
Postdoctoral Appointee
Mathematics and Computer Science Division
Argonne National Laboratory
9700 South Cass Avenue, Bldg. 240, Of. 3148
Argonne, IL 60439-4847
<a href="mailto:apenya@mcs.anl.gov" target="_blank">apenya@mcs.anl.gov</a>
<a href="http://www.mcs.anl.gov/~apenya" target="_blank">www.mcs.anl.gov/~apenya</a></pre>
</font></span></div>
<br>_______________________________________________<br>
discuss mailing list <a href="mailto:discuss@mpich.org">discuss@mpich.org</a><br>
To manage subscription options or unsubscribe:<br>
<a href="https://lists.mpich.org/mailman/listinfo/discuss" target="_blank">https://lists.mpich.org/mailman/listinfo/discuss</a><br></blockquote></div><br></div></div>