[MITgcm-support] zonal or meridional means on multiple processors
Samar Khatiwala
spk at ldeo.columbia.edu
Thu Jan 17 09:12:28 EST 2008
Hi Martin
My memory is somewhat hazy, but I recall doing this for zonal means
by locally SUMMING the variable in x and putting
that sum in a (local) array of length number of local y points. Then
I believe I did an MPI_Gather (or perhaps MPI_Gatherv)
to collect those local arrays on root. Then its a simple matter to
computing zonal means from this information. A bit of a hack
but it seemed to work.
Another possibility (which I haven't tried) would be to create a new
communicator between a group of processors with
MPI_Comm_create ( MPI_Comm comm, MPI_Group group, MPI_Comm *comm_out )
and then using the allreduce operation on that comm.
Samar
On Jan 17, 2008, at 7:57 AM, Martin Losch wrote:
> Hi there,
>
> in a multiprocessor set up I would like to compute a zonal (in i-
> direction) or meridional (in j-direction) mean for an online
> diagnostic. Is there a convenient way of doing this in the MITgcm
> or will I have to get out my MPI handbook (not that I know how to
> use it)?
>
> In ebm_zonalmean I see an example with global_sum, but I am not
> sure that this will work, as global_sum contains an MPI_Allreduce
> which should (in my view of the world) sum over all processors and
> not only over the zonal ones.
>
> Martin
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-support
More information about the MITgcm-support
mailing list