<div dir="ltr">Hi Maksim,<div><br></div><div>Since Fortran is case insensitive it is useful to do case insensitive search in the object folder:</div><div><br></div><div>grep -in "MPI_ALLREDUCE" *.F90<br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div dir="ltr"><div dir="ltr"><br></div><div>which will return </div><div><br></div><div>Timers_getSummary.F90:292: call mpi_allreduce(areSame, areSameReduction, 1, MPI_LOGICAL, &</div><div dir="ltr"><br></div><div>amongst many other lines.</div><div><br></div><div>Regarding MPI_ALLREDUCE, here's the mpich manual entry and also the relevant mpitutorial:</div><div><a href="https://www.mpich.org/static/docs/latest/www3/MPI_Allreduce.html">https://www.mpich.org/static/docs/latest/www3/MPI_Allreduce.html</a><br></div><div><a href="https://mpitutorial.com/tutorials/mpi-reduce-and-allreduce/">https://mpitutorial.com/tutorials/mpi-reduce-and-allreduce/</a><br></div><div><br></div><div>Best,</div><div dir="ltr">--------<div>Ryan</div></div></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jun 8, 2021 at 6:58 PM Maksim Kozlov <<a href="mailto:maksim.kozlov@nu.edu.kz">maksim.kozlov@nu.edu.kz</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Ryan!<div>Many thanks for your answer! I would really appreciate it if you tip me off on where I can read about this mysterious MPI_ALLREDUCE. This subroutine is not in the FLASH file system, there is no description of it in the FLASH user's manual yet I would really like to know where should I call it, what are its parameters (are they in or out parameters) and how it works at least in general (without going into details).</div><div>Thank you again!</div><div>Maksim</div></div><div id="gmail-m_191896795465823594DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br> <table style="border-top:1px solid rgb(211,212,222)">
<tbody><tr>
<td style="width:55px;padding-top:18px"><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail" target="_blank"><img src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif" alt="" width="46" height="29" style="width: 46px; height: 29px;"></a></td>
<td style="width:470px;padding-top:17px;color:rgb(65,66,78);font-size:13px;font-family:Arial,Helvetica,sans-serif;line-height:18px">Без вирусов. <a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail" style="color:rgb(68,83,234)" target="_blank">www.avast.com</a> </td>
</tr>
</tbody></table>
<a href="#m_191896795465823594_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"></a></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jun 9, 2021 at 2:49 AM Ryan Farber <<a href="mailto:rjfarber@umich.edu" target="_blank">rjfarber@umich.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Maksim,<div><br></div><div>Something along the lines of </div><div><br></div><div>call MPI_ALLREDUCE(local_total_mass_of_blocks, global_total_mass_of_blocks, 1, FLASH_REAL, MPI_SUM, dr_globalComm, ierror)</div><div><br></div><div>preceded by computing the local_total_mass_of_blocks on each processor (via loop or Fortran intrinsic "sum" along with proper array indexing) should do the trick for what you want.</div><div><br></div><div>Don't forget </div><div><br></div><div>
<p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(251,30,255)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(99,226,255)">#include </span><span style="font-variant-ligatures:no-common-ligatures">"Flash_mpi.h"</span></p><p style="margin:0px;font-variant-numeric:normal;font-variant-east-asian:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(251,30,255)"><br></p></div><div><div><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div>and other variable declarations, etc.</div><div><br></div><div>Best,</div><div dir="ltr">--------<div>Ryan</div></div></div></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jun 8, 2021 at 2:58 AM Maksim Kozlov <<a href="mailto:maksim.kozlov@nu.edu.kz" target="_blank">maksim.kozlov@nu.edu.kz</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Dear flash users,<div>I need to sum some variable over all blocks of the computational domain. Blocks of the computational domain are divided between different processors for parallel computations. Variables blockCount in Simulation_adjustEvolution or count in
gr_expandDomain take into account only blocks processed by one processor not all blocks in the computational domain. Cycles in these subroutines run only through blocks of one processor. I would really appreciate it if somebody gives me an idea on how I can run through all blocks of the computational domain to calculate the sum of some variable over all blocks (for example total volume of blocks or total mass of blocks). </div><div>Thank you very much!</div><div>Maksim Kozlov</div></div><div id="gmail-m_191896795465823594gmail-m_7222565064137780913gmail-m_-5902009028444939821DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br> <table style="border-top:1px solid rgb(211,212,222)">
<tbody><tr>
<td style="width:55px;padding-top:18px"><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail" target="_blank"><img src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif" alt="" width="46" height="29" style="width: 46px; height: 29px;"></a></td>
<td style="width:470px;padding-top:17px;color:rgb(65,66,78);font-size:13px;font-family:Arial,Helvetica,sans-serif;line-height:18px">Без вирусов. <a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail" style="color:rgb(68,83,234)" target="_blank">www.avast.com</a> </td>
</tr>
</tbody></table>
<a href="#m_191896795465823594_m_7222565064137780913_m_-5902009028444939821_DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"></a></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>