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

Create cupid workflow #176

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

ingridc2051
Copy link

Create a new workflow to allow users to run CUPiD after the short-term archiver.

Created template.cupid file and added a workflow to run it. Added module
load conda to run successfully for. Added a load conda command to the
config_machines.xml file for derecho. Updated the scratch path on
casper.
# Batch system directives
{{ batchdirectives }}

module load conda
Copy link
Contributor

Choose a reason for hiding this comment

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

@jedwards4b even though @ingridc2051 added module load conda/latest to the derecho config_machines.xml file, without this line she gets a CondaError: Run 'conda init' before 'conda activate' error from the conda activate cupid-dev line. Do you happen to know why we seemingly need to load the module twice?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I suspect that it's because the cesm environment is not being loaded by your script - let me look into how to do that and get back to you.

Copy link
Contributor

Choose a reason for hiding this comment

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

@jedwards4b What if we replace the module load conda with source .env_mach_specific.sh? That should get everything from env_machines.xml into the environment of the compute node, right? @ingridc2051 can you try that when you get a chance?

- module load conda
+ source .env_mach_specific.sh

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes - that should work - good idea.

Copy link
Contributor

Choose a reason for hiding this comment

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

It sounds like this worked given the test that @ingridc2051 performed.

@mnlevy1981
Copy link
Contributor

mnlevy1981 commented Jul 23, 2024

Before this PR can be opened up for review and merged in:

  • generate_cupid_config.py needs to under version control (probably in CUPiD?)
  • CUPiD needs to be added as an external in CESM (tools/CUPiD?)
  • generate case.cupid from the template instead of .case.cupid

A second PR to make CUPiD more usable would include

  • Add a RUN_CUPID_ANALYSIS flag to env_run.xml (default FALSE)
  • Move case.cupid to the default workflow, dependent on DOUT_S and RUN_CUPID_ANALYSIS both being true

…mmands in the template are run with the correct environment set up. Add module load nco to config_machines.xml file
template.cupid assumes CUPiD is in the CESM source tree (tools/CUPiD) and runs
the generate script from there. Also cleaned up some white space
generate_cupid_config_file.py now expects some commandline arguments, so the
cupid template as been modified accordingly.
@mnlevy1981
Copy link
Contributor

@jedwards4b What controls whether template.cupid becomes case.cupid (visible) or .case.cupid (hidden)? It's currently the latter, but I think we want it to be visible?

@mnlevy1981 mnlevy1981 mentioned this pull request Sep 8, 2024
6 tasks
@jedwards4b
Copy link
Collaborator

I think that case.st_archive might be a hardcoded special case in the python - I'll look at the code tomorrow and let you know.

@jedwards4b
Copy link
Collaborator

In utils.py at line 2533. I think that we should remove that and make it an option in the config_workflow.xml file instead.

@mnlevy1981
Copy link
Contributor

Cool, I'll make do with the file being hidden for now but we can talk about what it would look like to add a hide_script option to config_workflow.xml and then let CIME's get_batch_script_for_job() depend on that. I assume we'd want the default to be True and case.st_archive (and case.cupid) would set it to False?

{{ batchdirectives }}

source .env_mach_specific.sh
conda activate cupid-dev
Copy link
Contributor

Choose a reason for hiding this comment

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

Cupid-dev is now cupid-infrastructure.

We should then add in generating timeseries files, creating an ADF config file, and running ADF.

We will also want to use cupid-diagnostics (the updated name for cupid-run) below (line 11).

After cupid-diagnostics, we can add cupid-webpage to build the webpage.

These will eventually be populated from an env_?.xml file, but for now starting
a list of variables we want the user to be able to set.

Also added two minor updates:
1. unset PYTHONPATH to ensure we are only using conda-installed python packages
2. The API for the script to generate the ADF config file has been changed - we
now point to the directory containing a CUPiD config file rather than the CUPiD
example
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.

4 participants