Open mvertens opened 4 weeks ago
@mvertens thanks for the analysis there. It sounds like at least for MOSART this wouldn't be a good thing to do right now anyway. @billsacks as our ESMF rep. do you think this would be good to do in the future?
@jedwards4b made the following point about doing this here:
https://github.com/ESCOMP/MOSART/pull/94#pullrequestreview-2101937327
Since, ESMF VM objects abstract the distributed memory communication package it's a general interface where MPI could be switched to another protocol, but all under the covers without touching CESM code. That's a worthwhile thing to do even if we don't do it immediately.
I'd like to understand this better before weighing in on it myself. It sounds like it may complicate the code somewhat, but buys us a potential for more abstraction / long-term maintainability.
Things I'd like to understand - and this probably warrants a discussion with others on the ESMF core team - are:
Exactly the discussion you should have. We may need to move away from mpi or to some combination of mpi with something else - ideally we would keep that complexity isolated. I think that ESMF_VM* will need to be extended to work with scalars and multidimensional arrays. I don't think it would be too complicated and I think this embraces a vision of what the esmf interface should be capable of.
Sounds great, @jedwards4b . I'll add this to the agenda for an upcoming ESMF core team call. The team is stretched thin right now, but we can discuss whether it makes sense to put this on our roadmap.
@jedwards4b - one thing that could help for this discussion is: Do you have any examples of alternative calls? e.g., for mpi_bcast, what would be a specific alternative that could be wrapped by the ESMF calls?
The CMEPS mediator is an example, there are no calls to MPI there, only ESMF is used.
Sorry, let me clarify: what I meant is: what would be the underlying library call that takes the place of mpi_bcast that the ESMF_VMBroadcast might wrap in the future?
I don't have any examples - perhaps Gerhard does.
In MOSART - the calls using
shr_mpi_sum, shr_mpi_max, shr_mpi_min, mpi_barrier, mpi_bcast
could be replaced by calls toESMF_VMAllReduce and ESMF_VMBroadcast.
The following must be taken into account, however:ESMF currently only has interfaces to a small subset of MPI communications and only supports arrays in those interfaces. So this needs to be taken into consideration in the decision to replace the MPI calls with ESMF calls.