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

Initial ICI changes #238

Draft
wants to merge 114 commits into
base: dev
Choose a base branch
from
Draft

Initial ICI changes #238

wants to merge 114 commits into from

Conversation

hannahnesser
Copy link
Collaborator

@hannahnesser hannahnesser commented Jul 3, 2024

Name: Hannah Nesser
Institution: JPL

Describe the update

This is a set of changes that:

  • Allow the IMI to run on different clusters with different schedulers (e.g., PBS vs. SBATCH) or different Python environment tools (e.g., conda vs. pip);
  • And, begins to generalize from the IMI to ICI both by changing variable/file/directory names and by beginning to remove hard-coded methane parameters such as methane molar mass and mol/mol -> mixing ratio conversion factors.

As of now, this is up to date with the dev branch. The changes include the following (though I may have forgotten something).

PBS/SBATCH flexibility:

  • I replaced the config option UseSlurm [bool] with SchedulerType [str].
  • I added a function to common.sh that is run as submit_job $SchedulerType SaveOutput JobArguments where SaveOutput is a boolean that determines whether or not the output is appended to imi_output.log. It then calls submit_slurm_job or submit_pbs_job as appropriate. Note: submit_pbs_job currently assumes the use of Pleiades and therefore includes a hardcoded "model" keyword that is required by the system.
  • I added a function convert_sbatch_to_pbs to common.sh that is run in the case that SchedulerType = "PBS". This function searches for all files that have SBATCH in their header and then iteratively replaces the SBATCH commands with the PBS equivalent. This means that any new SBATCH options added to a header should match the formatting in this function or that the sed statement should be expanded to include the new options.

Some changes that were needed to make these changes work:

  • I went through all the SBATCH options and ensured uniform usage (i.e., replaced --time with -t in all cases).
  • I removed all SBATCH -N 1 uses and instead put the node request into submit_job since PBS requires that the number of nodes be assigned only once and that it occur along with CPU requests, etc. in the initial job request.

Conda/pip flexibility:

  • I replaced CondaEnv and CondaPath with PythonEnv in config.yml. This is now a path to a python environment file that is sourced by the IMI instead of assuming that the environment can be activated by conda. (The conda activation lines are now included in the python environment files.)

Methane/CO2 flexibility:

  • I changed many variable names that include TROPOMI to instead include satellite.
  • Similarly, I changed many variable names that include methane or CH4 to include either species or nothing.
  • I added functions to utils to obtain the mixing ratio conversion factor (1e9 vs 1e6) or the molar mass as a function of species.

Hannah Nesser and others added 30 commits March 19, 2024 14:17
…cies, UseScheduler, SchedulerType, DataPathObs, and PythonEnvType/PythonEnvPath
- Conda environment activation is no longer the default. Instead, the config file
  asks the user to specify a path for a file that will activate the Python environment
  (via `source $PythonEnv`). This better supports users on clusters that don't support
  conda.
- slurm is no longer the default scheduler. UseSlurm has been removed from the config
  file and been replaced by SchedulerType. Currently two schedulers are supported:
  slurm and PBS.
- To support this transition, we no longer call sbatch ... within the IMI to the extent
  possible. Instead, we added a utility function submit_job to src/utilities/common.sh
  that is run as
    submit_job $SchedulerType <ScriptName> <ScriptArgument(s)>
  The function then calls either submit_slurm_job or submit_pbs_job.
- We also removed the Boolean usage of UseSlurm. We now assume that a scheduler is
  always used by the IMI.
…laced sbatch with an if/elif/else statement that depends on SchedulerType and adjusts the call to the scheduler within the script (instead of using the utilities/common.sh function submit_job)
Hannah Nesser added 21 commits July 2, 2024 11:07
…mulations

- Changed default file/folder names from 1ppb to lowbg (low background)
- Changed some methane hardcoding (e.g., changed from default 1e-9 low background to
  a species dependent value, started to change some of the tracer defaults in HEMCO coding
…ode (UseEmisSF/UseOHSF if statemetns and also default analyticalInv setting) that were removed in the jacobian bug fix branch
@sabourbaray
Copy link
Contributor

Hi Hannah,

Giving the IMI flexibility to run on different schedulers is great and will help our work at ECCC. We also use PBS Pro but made the changes manually, so this would speed up the process of pulling new IMI updates. Thanks!

@laestrada laestrada changed the base branch from main to dev July 8, 2024 18:18
@hannahnesser
Copy link
Collaborator Author

Hi Sabour,

Great! If you find that something doesn't work, please feel free to fix it. I haven't done a ton of rigorous testing on this because I don't have much of the methane data downloaded (since I'm applying this to CO2).

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.

3 participants