ryosuke-hirai / HORMONE

Repository for hydrodynamical code HORMONE
GNU General Public License v3.0
0 stars 1 forks source link

Make masscoordinate function MPI-safe #55

Closed conradtchan closed 2 months ago

conradtchan commented 2 months ago

This makes the masscoordinate function MPI safe.

The outer loop iterates over all radial cells i = is_global, ie_global. If the MPI task contains cells in that shell, it adds to shellmass. Otherwise, shellmass remains zero.

A call to allreduce_mpi sums up contributions to that shell from all MPI tasks. MPI tasks which do not contain that shell contribute zero. Then shellmass is added to the array mc.