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

Add Initial Condition Handling to EAMxx DAG Generator #6860

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

mjs271
Copy link
Contributor

@mjs271 mjs271 commented Dec 19, 2024

Finishes PR #3101 originally submitted to the scream repo the atmospheric DAG generator (atmosphere_process_dag.xpp) and atmosphere driver to get things working again. Namely,

There are now 2 checkpoints during AtmosphereDriver::initialize() at which we build the most complete DAG available and write it to file.
This is intended to serve as a diagnostic tool in case a build crashes, giving the user information about the created/initialized processes or fields.
These checkpoints occur at the end of the following functions, and the associated DAG is written out to a .dot file in the run directory:

  1. create_fields()--scream_atm_createField_dag.dot
  2. initialize_atm_procs()--scream_atm_initProc_dag.dot

I've added some code that enables the DAG to properly handle initial conditions and determine whether they are missing at the time when he DAG is generated, and if so this is indicated in the corresponding node (see images in original PR for examples).
In the initial DAG, (within initialize_atm_procs()), an extra box is added to the DAG with a disclaimer that any fields indicated as missing may be provided by the forthcoming initial condition file.
A node for the Initial Condition is now displayed on the DAG with edges leading to the "Begin of Atm Time Step" node adn any nodes for a process that uses and does not change a field from the initial condition.
I've made some minor formatting changes for readability and to more clearly indicate the different types of objects represented on the DAG--e.g., the Begin/End of Atm. Timestep nodes are colored differently, and fields are printed in green when provided directly by the initial condition at initialization.
I've also fenced-off the write_dag() statements to ensure they are only printed by the main MPI thread, since I noticed occasional formatting errors due to a presumptive race condition.
Additionally, when running as an eamxx standalone test, the filenames of the DAGs are tagged with .np<N> to avoid conflicts writing to file.
Lastly, I added a RESOURCE_LOCK to the standalone test mam4_srf_online_emiss_mam4_constituent_fluxes that appeared to be failing due to incorrect order of running the tests being compared.

Note: Closes E3SM/scream Issue #1869.

…ating as such

fixed minor bug--still an issue with 2 fields in p3 for pg2 cases

print formatting fix for dag

remove 2 intermediate DAGs

add descriptor box for IC fields
@mjs271 mjs271 force-pushed the mjs271/eamxx/DAG-refactor branch from ef142bc to c15b1e5 Compare December 19, 2024 13:31
@mjs271
Copy link
Contributor Author

mjs271 commented Dec 19, 2024

Looks like I can't add reviewers, so tagging those from original PR @bartgol @tcclevenger @jgfouca @mahf708 @AaronDonahue

@mjs271
Copy link
Contributor Author

mjs271 commented Dec 19, 2024

Note that the eamxx-sa/gcc-cuda/* test failures are expected. The fix for mam4_aero_microphys_standalone_baseline_cmp will be in a following PR shortly

m_ad_status |= s_fields_created;

// If the user requested it, we can save a dictionary of the FM fields to file
auto& driver_options_pl = m_atm_params.sublist("driver_options");
// auto& driver_options_pl = m_atm_params.sublist("driver_options");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line can be deleted

@@ -9,6 +9,7 @@ CreateADUnitTest(${TEST_BASE_NAME}
LABELS physics mam4_srf_online_emiss mam4_constituent_fluxes
MPI_RANKS ${TEST_RANK_START} ${TEST_RANK_END}
FIXTURES_SETUP_INDIVIDUAL ${FIXTURES_BASE_NAME}
PROPERTIES RESOURCE_LOCK ${FIXTURES_BASE_NAME}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you serializing these tests? Is this b/c of the generated dag? Imho, we can just let them run in ||, even if they overwrite each other's dag...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one was unrelated to the dag, though kept crashing while I was debugging. Could be idiosyncratic to whichever machine I was on, this appeared to fix it. I'm also ok with reverting and keeping an eye out

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was it only this test that failed? You could modify its input.yaml file to set the dag verbosity to 0 (or whatever turns it completely off). That is, assuming the dag was the issue...

Copy link
Contributor

@bartgol bartgol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I have one question on the test modification.

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

Successfully merging this pull request may close these issues.

Output Atm DAG file is incorrect
3 participants