geoschem / gchp_legacy

Repository for GEOS-Chem High Performance: software that enables running GEOS-Chem on a cubed-sphere grid with MPI parallelization.
http://wiki.geos-chem.org/GEOS-Chem_HP
Other
7 stars 13 forks source link

[FEATURE REQUEST] Allow createRunDir.sh to run silently (no interactive questions) #38

Closed JiaweiZhuang closed 4 years ago

JiaweiZhuang commented 5 years ago

Problem

createRunDir.sh uses interactive questions. Although this is instructive for first-time users, it makes the installation process hard to automate. Automation is crucial in many scenarios: continuous integration (#36), creating new cloud images and containers, allowing Spack installation and Conda installation (geoschem/geos-chem#47). Spack has a thread on the difficulty of handling interactive questions: spack/spack#7983. In general, removing all interactive parts in the installation process will make any kinds of automatic deployments much easier.

So far I've been using a hacky script to automate the process of building GCHP. To handle the questions from createRunDir.sh, I simply pipe the answers to it:

rm $HOME/.geoschem/config
printf "$HOME/ExtData \n 2 \n 1 \n $HOME/tutorial \n gchp_standard \n n" | ./createRunDir.sh

Each item corresponds to: input data path, simulation type (2 = standard), metfield type (1 = GEOSFP), rundir parent path, rundir name, whether to version-control rundir.

There are multiple problems with this:

Suggestions

Ideally, the script will have strictly two modes: interactive and silent, and nothing in between (no partial answers, to avoid incomplete & stale config files)

The config file should describe all the questions including simulation types, etc. Then, the rundir creation is simply:

./createRunDir.sh --silent=config

The config file may be created manually, or generated by running the script interactively.

As a reference, Intel compilers also have an interactive installation process by default, but also supports Silent Installation.

lizziel commented 5 years ago

I think this feature would also help create many run directories at once, if ever anyone wants to do that. I took a first pass at this, off of GCHP 12.6.1. Instructions are in the createRunDir.sh header. Please give it a try and let me know what you think. https://github.com/geoschem/gchp/commit/380ed9b90f31094bab8f9e8463981e20c8b5284a

lizziel commented 4 years ago

We are planning on putting this capability into 13.0.0.

lizziel commented 4 years ago

@LiamBindle worked on something similar that will address this feature request. See GEOS-Chem PR https://github.com/geoschem/geos-chem/pull/459. We anticipate it going into GEOS-Chem 13.1 for use with both GEOS-Chem Classic and GCHP. I am therefore closing this feature request.