NCAR / ccpp-framework

Common Community Physics Package (CCPP)
http://www.dtcenter.org/community-code/common-community-physics-package-ccpp/
Other
26 stars 64 forks source link

Remove run phase requirement from capgen #543

Closed peverwhee closed 8 months ago

peverwhee commented 8 months ago

Description

Capgen should no longer require a run phase, to allow for more flexibility.

Solution

I don't have a full solution - but updates will be needed to ccpp_suite.py and possibly suite_objects.py to remove some of the default behavior/handling of groups/run phases.

gold2718 commented 8 months ago

Out of curiosity, what is the use case for this? I think it would be nice to document something here.

climbfuji commented 8 months ago

The UFS Weather Model has a few schemes that only have a timestep_init phase, but not a run phase. Thus, schemes that run at every time step, but not as part of the run phase. One of the reasons if not the main reason is that these schemes need to do something at the beginning of every time step but can't do this as one of the first schemes in the run phase because they can't be using threading. They need to see the entire computational domain of an MPI task and they may be doing I/O (such as reading updated coefficients for radiation etc).

gold2718 commented 8 months ago

Thanks. I wonder if this is an optimal solution or if we should instead modify the idea of timestep_initial and timestep_final to be run_nothreading. This would generalize what a CCPP suite can be. It also changes the way a host model would implement a CCPP interface. It would have to query the suite about its groups and call each one appropriately (threaded or not). This feels expensive to implement but might be a nice long-term goal. For now, making run optional sounds like a good step.

dustinswales commented 8 months ago

Here's the solution I used to get around this issue with Capgen in the CCPP SCM, https://github.com/dustinswales/ccpp-framework/commit/934f1f542875d7fb2cb79ba931cd7f551f56a57d. Not sure if this is ideal, but it did the trick.

mkavulich commented 8 months ago

Resolved by #548