<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">another hack:<div>define a global mask that sets everything to zero except for the area (tiles) that you are interested in and use global_sum/global_sum_tiles.F. Maybe a little inefficient (because you sum over a lot of tiles that just contain zeros) …</div><div><br></div><div>Martin<br><div><br><blockquote type="cite"><div>On 22. Jun 2023, at 21:07, Samar Khatiwala <samar.khatiwala@earth.ox.ac.uk> wrote:</div><br class="Apple-interchange-newline"><div>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<div style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">
Hi Hassan,
<div><br>
</div>
<div>I don’t know about MITgcm-specific routines but couldn’t you just use MPI_gather to get all the values to the root rank and then sum over whichever tiles you want?</div>
<div><br>
</div>
<div>Samar<br>
<div><br>
<blockquote type="cite">
<div>On Jun 22, 2023, at 5:51 PM, Hassan Mason <hcm7920@nyu.edu> wrote:</div>
<br class="Apple-interchange-newline">
<div>
<div dir="ltr">
<div class="gmail_default" style="font-size:large">Hi all,</div>
<div class="gmail_default" style="font-size:large"><br>
</div>
<div class="gmail_default" style="font-size:large">I'm currently constructing an addition to MITgcm and I'm stuck implementing it with MPI.</div>
<div class="gmail_default" style="font-size:large"><br>
</div>
<div class="gmail_default" style="font-size:large">I have a value that's calculated for each tile and I need to sum over all tiles aligned in a horizontal direction. In other words, I want to sum over a specific column of tiles, and in the end each tile would
know the sum of the column to which it belongs.</div>
<div class="gmail_default" style="font-size:large"><br>
</div>
<div class="gmail_default" style="font-size:large">I see there are routines like global_sum_tile.F that perform a global sum, but are there any routines that are more selective about the tiles included in the sum? Alternatively, is there a routine that works
like global_sum_tile.F but for element-wise vector addition instead of single values?</div>
<div class="gmail_default" style="font-size:large"><br>
</div>
<div class="gmail_default" style="font-size:large">Thanks!</div>
<div class="gmail_default" style="font-size:large">Hassan Mason</div>
</div>
_______________________________________________<br>
MITgcm-support mailing list<br>
MITgcm-support@mitgcm.org<br>
http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support<br>
</div>
</blockquote>
</div>
<br>
</div>
</div>
_______________________________________________<br>MITgcm-support mailing list<br>MITgcm-support@mitgcm.org<br>http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support<br></div></blockquote></div><br></div></body></html>