NCAR / NCAR/ccpp-framework

Add support for MPI_Comm (mpi08) object in capgen

Open
#686 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

capgen-unification enhancement
Dominant language
Python
Stars
25
Forks
67
Avg merge
3d 8h
Merged PRs (30d)
2

Description

Description

The MPI_Comm DDT must be known to capgen to enable passing around variable of type MPI_Comm.

Summary

In trying to incorporate MPI 2008 into CAM-SIMA, @nusbaume ran into an Unknown DDT type, MPI_Comm error (coming from ~line 540 in metadata_table.py).

A few things I noticed when I was trying to understand the underlying issue:

  1. Capgen does not use ccpp_types.F90 at all right now (which I believe is what prebuild uses for this purpose).
  2. Capgen does not currently support the way that ccpp_types.F90/.meta grabs the MPI_Comm DDT. It expects that all DDTs for which you have metadata will be defined in the Fortran (rather than just used and made public)

Previously closed issue: https://github.com/NCAR/ccpp-framework/issues/390

Possible Solution

I'm not sure of the best solution, but a couple thoughts:

  1. Build MPI_Comm into the framework as a DDT that will always be there (though perhaps we'd need a flag to turn this off in case someone is building without MPI).
  2. More generally, update the parser/metadata validation to allow for DDT variables that aren't defined, but just used from an external source and made available/public (as in ccpp_types.F90 currently)

Here's the PR that enabled use of the DDT for prebuild: https://github.com/NCAR/ccpp-framework/pull/523

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with metadata_table.py around line 540, then compare capgen’s handling with ccpp_types.F90 and .meta metadata. Review PR #523 and the previously closed issue #390 before choosing an approach. Done means capgen recognizes MPI_Comm rather than reporting an unknown DDT type.

Written by the indexing model from the issue text.

Assessment

Tech stack
fortran, python
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.