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

Remove run phase requirement from capgen #543

Closed
peverwhee opened this issue Mar 5, 2024 · 5 comments
Closed

Remove run phase requirement from capgen #543

peverwhee opened this issue Mar 5, 2024 · 5 comments

Comments

@peverwhee
Copy link
Collaborator

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
Copy link
Collaborator

gold2718 commented Mar 6, 2024

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

@climbfuji
Copy link
Collaborator

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
Copy link
Collaborator

gold2718 commented Mar 6, 2024

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
Copy link
Collaborator

Here's the solution I used to get around this issue with Capgen in the CCPP SCM, dustinswales@934f1f5.
Not sure if this is ideal, but it did the trick.

mkavulich pushed a commit that referenced this issue Mar 18, 2024
Here we include a small fix to allow for schemes without run phases.

Capgen assumes that all schemes have a run phase, which is not true in practice. During the "scheme analyze" section, if a scheme doesn't contain a run phase we set a flag to true (no_run_phase). Then this flag is queried later in the "scheme write" section.

There are no interface changes.

Addresses #543

Testing has been expanded to contain a scheme w/o a run phase.
@mkavulich
Copy link
Collaborator

Resolved by #548

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants