[MITgcm-support] zonal or meridional means on multiple processors
Jean-Michel Campin
jmc at ocean.mit.edu
Thu Jan 17 11:15:31 EST 2008
Hi Martin,
There is a pkg Ed wrote that do regridding (pkg/regrid)
that use a global sum for a vector:
> eesupp/src/global_vec_sum.F
This should do it.
Jean-Michel
On Thu, Jan 17, 2008 at 04:53:12PM +0100, Martin Losch wrote:
> Hi Samar,
> thanks, but it does mean that I'll have to use MPI - routines
> directly, something I usually don't do (I know it's embarrassing,
> that I don't even know the basic). Do you have by any chance the code
> snippet with MPI_Gather in the MITgcm context?
>
> Martin
> On 17 Jan 2008, at 15:12, Samar Khatiwala wrote:
>
> >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
> >
> >_______________________________________________
> >MITgcm-support mailing list
> >MITgcm-support at mitgcm.org
> >http://mitgcm.org/mailman/listinfo/mitgcm-support
>
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-support
More information about the MITgcm-support
mailing list