[MITgcm-support] Question about MPI sums

Martin Losch Martin.Losch at awi.de
Fri Jun 23 01:52:46 EDT 2023


another hack:
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) …

Martin

> On 22. Jun 2023, at 21:07, Samar Khatiwala <samar.khatiwala at earth.ox.ac.uk> wrote:
> 
> Hi Hassan,
> 
> 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?
> 
> Samar
> 
>> On Jun 22, 2023, at 5:51 PM, Hassan Mason <hcm7920 at nyu.edu> wrote:
>> 
>> Hi all,
>> 
>> I'm currently constructing an addition to MITgcm and I'm stuck implementing it with MPI.
>> 
>> 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.
>> 
>> 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?
>> 
>> Thanks!
>> Hassan Mason
>> _______________________________________________
>> MITgcm-support mailing list
>> MITgcm-support at mitgcm.org
>> http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support
> 
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mailman.mitgcm.org/mailman/listinfo/mitgcm-support

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.mitgcm.org/pipermail/mitgcm-support/attachments/20230623/6623f2c5/attachment.html>


More information about the MITgcm-support mailing list