Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should MAPL_Comms routines support 3d and 4d? #3324

Open
mathomp4 opened this issue Jan 15, 2025 · 0 comments
Open

Should MAPL_Comms routines support 3d and 4d? #3324

mathomp4 opened this issue Jan 15, 2025 · 0 comments
Assignees
Labels
❓ Question Further information is requested

Comments

@mathomp4
Copy link
Member

Recently, in helping @briardew try various things to get his code working on SLES15, he pointed me to the CO code:

https://github.com/GEOS-ESM/GOCART/blob/76a694c11f0e69ace310139770094981732d1476/ESMF/GOCART_GridComp/CO_GridComp/CO_GridCompMod.F90#L777

which has that sort of code that was in PChem: A parallel read of a file that we converted to read-on-root-and-broadcast.

Well, I did the same sort of thing and one thing I did to be "smart" was convert:

  length = SIZE(gcCO%sdat)
  CALL MPI_Bcast(gcCO%sdat, length, MPI_REAL, 0, comm, status)
  VERIFY_(status)

to:

  length = SIZE(gcCO%sdat)
  CALL MAPL_CommsBcast(vm, gcCO%sdat, length, 0, comm, status)
  VERIFY_(status)

But that failed. Why? Well, gcCO%sdat is 4-d:

        REAL, POINTER :: sdat(:,:,:,:)

and a couple other of them are 3-d. And MAPL_CommsBcast is overloaded only to 2d:

MAPL/base/MAPL_Comms.F90

Lines 91 to 114 in c65548b

interface MAPL_CommsBcast
module procedure MAPL_CommsBcast_STRING_0
module procedure MAPL_CommsBcast_L4_0
module procedure MAPL_CommsBcast_I4_0
module procedure MAPL_CommsBcast_R4_0
module procedure MAPL_CommsBcast_R8_0
module procedure MAPL_CommsBcast_I4_1
module procedure MAPL_CommsBcast_R4_1
module procedure MAPL_CommsBcast_R8_1
module procedure MAPL_CommsBcast_I4_2
module procedure MAPL_CommsBcast_R4_2
module procedure MAPL_CommsBcast_R8_2
module procedure MAPL_CommsBcastVm_STRING_0
module procedure MAPL_CommsBcastVm_L4_0
module procedure MAPL_CommsBcastVm_I4_0
module procedure MAPL_CommsBcastVm_R4_0
module procedure MAPL_CommsBcastVm_R8_0
module procedure MAPL_CommsBcastVm_I4_1
module procedure MAPL_CommsBcastVm_R4_1
module procedure MAPL_CommsBcastVm_R8_1
module procedure MAPL_CommsBcastVm_I4_2
module procedure MAPL_CommsBcastVm_R4_2
module procedure MAPL_CommsBcastVm_R8_2
end interface

So I suppose my questions are:

  1. Is there a reason we only overload to 2d?
  2. If not, is there a reason we haven't overloaded higher?
@mathomp4 mathomp4 added the ❓ Question Further information is requested label Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❓ Question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants