Hi Joe,<br><br>I found the article you wrote for Linux Journal right about the time you emailed last night - thanks for the reference and the suggestions! I find that 1 beer and coding is ok, but num_beer .ge. 2 makes me too poetic and insufficiently detail oriented. Debugging the next morning is never fun.<br>
<br><div class="gmail_quote">On Fri, Nov 21, 2008 at 9:23 AM, Joe Landman <span dir="ltr"><<a href="mailto:landman@scalableinformatics.com">landman@scalableinformatics.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 class="Ih2E3d">Geoff Jacobs wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
If this were done with MPI, one would have to be careful of the<br>
boundaries on the matrix as it's partitioned for computation. OpenMP is<br>
intelligent enough to hold off computation on the tiles south and east<br>
of the first until the first is done, and so forth?<br>
</blockquote>
<br></div>
No... I didn't address the interior vs exterior. I have a nice worked example where I convert this sort of code into an exterior, a skin, and the communication for an MPI and OpenMP version. Scales pretty well. You are right, I should have fixed that as well.<div class="Ih2E3d">
<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
! now all you need is a "linear scan" to find positive elements in<br>
! dv. You can approach these as sum reductions, and do them in<br>
! parallel<br>
do i=1,Nx<br>
sum=0.0<br>
do j=1,Ny<br>
sum = sum + dabs(dv(i,j) .gt. 0.0) * dv(i,j)<br>
end do<br>
if (sum .gt. 0.0) converged = 0<br>
end do<br>
<br>
The basic idea is to replace the inner loop conditionals and remove as<br>
many of the shared variables as possible.<br>
</blockquote>
<br>
Yup, keep things pipelined.<br>
</blockquote>
<br></div>
That was the idea, though I didn't compile/test the code to be sure it would work. That and I usually try to avoid real coding when I am tired at night. Coding and beer don't mix (for me).<div><div></div><div class="Wj3C7c">
<br>
<br>
<br>
<br>
-- <br>
Joseph Landman, Ph.D<br>
Founder and CEO<br>
Scalable Informatics LLC,<br>
email: <a href="mailto:landman@scalableinformatics.com" target="_blank">landman@scalableinformatics.com</a><br>
web : <a href="http://www.scalableinformatics.com" target="_blank">http://www.scalableinformatics.com</a><br>
<a href="http://jackrabbit.scalableinformatics.com" target="_blank">http://jackrabbit.scalableinformatics.com</a><br>
phone: +1 734 786 8423 x121<br>
fax : +1 866 888 3112<br>
cell : +1 734 612 4615<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>- - - - - - - - - - - - - - - - - - - - - <br>Nathan Moore<br>Assistant Professor, Physics<br>Winona State University<br>AIM: nmoorewsu <br>- - - - - - - - - - - - - - - - - - - - -<br>