Skip to content

Commit

Permalink
Merge pull request #210 from geoschem/docs/updates
Browse files Browse the repository at this point in the history
Updates to GCHP documentation
  • Loading branch information
LiamBindle committed Mar 18, 2022
2 parents 4018d8e + 8303b8a commit b8fa2b9
Show file tree
Hide file tree
Showing 20 changed files with 539 additions and 705 deletions.
6 changes: 3 additions & 3 deletions docs/source/bibtex.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"Long_et_al._2015",
"Eastham_et_al._2018",
"Zhuang_et_al._2020",
"Bindle_et_al._2020"
"Bindle_et_al._2021"
],
"stretched-grid": [
"Bindle_et_al._2020"
"Bindle_et_al._2021"
]
}
}
}
2 changes: 1 addition & 1 deletion docs/source/geos-chem-shared-docs
5 changes: 3 additions & 2 deletions docs/source/getting-started/key-references.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Key References
* Columnar operators are described in :cite:`Long_et_al._2015`.
* GEOS-Chem High Performance (GCHP) is described in :cite:`Eastham_et_al._2018`.
* GCHP execution on the cloud and MPI considerations are described in :cite:`Zhuang_et_al._2020`.
* Grid-stretching is described in :cite:`Bindle_et_al._2020`.
* Grid-stretching is described in :cite:`Bindle_et_al._2021`.
* Major GCHP developments in v13 are described in :cite:`Martin_et_al._2022`.

.. bibliography::
.. bibliography::
17 changes: 2 additions & 15 deletions docs/source/getting-started/quick-start.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,7 @@ Checkout the GEOS-Chem version that you want to use:

.. code-block:: console
gcuser:~/GCHP$ git checkout 13.0.0-beta.1
.. note::
Version 13 is not officially released yet. Until then, the most recent
commit to :literal:`main` is the most stable version of GCHP. Therefore,
we recommend you checkout :literal:`main`, rather than a version
like :literal:`13.0.0-beta.1`. E.g.:

.. code-block:: console
$ git checkout main # recommended until version 13 is officially released
Once version 13 is released, we will resume recommending users checkout
a specific version.
gcuser:~/GCHP$ git checkout 13.3.4
Initialize and update all the submodules:

Expand Down Expand Up @@ -168,4 +155,4 @@ GCHP simulation, and then you submit that script to your scheduler (SLURM, LSF,


Those are the basics of using GCHP! See the user guide, step-by-step guides, and reference pages
for more detailed instructions.
for more detailed instructions.
9 changes: 4 additions & 5 deletions docs/source/getting-started/requirements.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ System Requirements
Software Requirements
---------------------

To use GCHP you need a compute environment with the following software:
To build and run GCHP you compute :term:`environment` needs the following software:

* Git
* Make (or GNUMake)
Expand All @@ -28,11 +28,10 @@ To use GCHP you need a compute environment with the following software:
* NetCDF (with C, C++, and Fortran support)
* ESMF version ≥ 8.0.0

Your system administrator can tell you what software is available and how to activate it.
Your system administrator should be able to tell you if this software is already available on your cluster, and if so, how to activate it.
If it is not already available, they might be able to build it for you.

If you need to install any of these software yourself, you can do that
manually (build from source), but it is faster and easier to do it with Spack. See
our guide on :ref:`installing GCHP's dependencies with Spack <installing_with_spack>`.
If you need to build GCHP's dependencies yourself, see :ref:`building_gchp_dependencies`.

.. _hardware_requirements:

Expand Down
14 changes: 3 additions & 11 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,6 @@ GEOS-Chem High Performance
<a href="https://github.com/geoschem/GCHP/releases"><img src="https://img.shields.io/github/v/release/geoschem/GCHP?include_prereleases&label=Latest%20Pre-Release"></a>
</p>

.. important:: This is a prerelease of the GEOS-Chem High Performance user guide.
These pages are the most up-to-date and accurate instructions for GCHP, but they
are still a work in progress.

Contributions (e.g., suggestions, edits, revisions) would be greatly appreciated. See
:ref:`editing this guide <editing_this_user_guide>` and our :doc:`contributing guidelines <reference/CONTRIBUTING>`.
If you find a something hard to understand---let us know!

The `GEOS--Chem model <http://acmg.seas.harvard.edu/geos/>`_ is a global 3-D model of atmospheric
composition driven by assimilated meteorological observations from the Goddard Earth Observing
System (GEOS) of the `NASA Global Modeling and Assimilation Office <http://gmao.gsfc.nasa.gov/>`_.
Expand Down Expand Up @@ -73,7 +65,8 @@ with Spack, as well as how to use Spack to install GCHP's dependencies if needed
supplement/rundir-config.rst
supplement/config-files.rst
supplement/job-script-examples.rst
supplement/spack.rst
supplement/building-gchp-dependencies.rst
supplement/setting-up-aws-parallelcluster.rst
supplement/containers.rst
supplement/plotting-output.rst
stretched-grid.rst
Expand All @@ -89,11 +82,10 @@ with Spack, as well as how to use Spack to install GCHP's dependencies if needed
:maxdepth: 1
:caption: Help & Reference

reference/known-bugs.rst
reference/SUPPORT.md
reference/CONTRIBUTING.md
geos-chem-shared-docs/editing_these_docs.rst
reference/git-submodules.rst
reference/glossary.rst
reference/versioning.rst
reference/uploading_to_spack.rst
reference/uploading_to_spack.rst
23 changes: 22 additions & 1 deletion docs/source/reference/glossary.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,25 @@ Terminology

compile
Generating an executable program from source code (which is in a plain-text format).

dependencies
The software libraries that are needed to compile GCHP. These include HDF5, NetCDF, and ESMF.
See :ref:`software_requirements` for a complete list.

environment
The software packages and software configuration that are active in your current :term:`terminal` or :term:`script`.
In Linux, the :file:`${HOME}/.bashrc` script performs automatic configuration when your terminal starts. You can
manually configure your environment by running commands like :command:`source path_to_a_script` or with tools
like TCL or LMod for modulefiles. Software containers are effectively a prepackaged operating system + software + environment.

software environment
See :term:`environment`.

terminal
A command-line.

script
A file that scripts a sequence of commands. Typically a bash that is written to execute a sequence of commands.

checkpoint file
See :term:`restart file`.
Expand Down Expand Up @@ -48,4 +67,6 @@ Terminology
and facilitates component interconnections.

HISTORY
The MAPL :term:`gridded component` that handles model output. All GCHP output diagnostics are facilitated by HISTORY.
The MAPL :term:`gridded component` that handles model output. All GCHP output diagnostics are facilitated by HISTORY.


41 changes: 0 additions & 41 deletions docs/source/reference/known-bugs.rst

This file was deleted.

2 changes: 1 addition & 1 deletion docs/source/stretched-grid.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Stretched-Grid Simulations
==========================

.. note::
Stretched-grid simulations are described in :cite:`Bindle_et_al._2020`. The paper also discusses things
Stretched-grid simulations are described in :cite:`Bindle_et_al._2021`. The paper also discusses things
you should consider, and offers guidance for choosing appropriate stretching parameters.

A stretched-grid is a cubed-sphere grid that is "stretched" to enhance its resolution in a region.
Expand Down
165 changes: 165 additions & 0 deletions docs/source/supplement/building-gchp-dependencies.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
.. _building_gchp_dependencies:

Building GCHP's Dependencies
============================

This page has instructions for building GCHP's :term:`dependencies`.
These are the software libraries that are needed to compile and execute the GCHP program.
These instructions are meant for users that are working on a cluster where GCHP's :ref:`software_requirements` are not already available.


.. note::
This is not the only way to build the GCHP dependencies.
It is possible to download and compile the source code for each library manually.
Spack automates this process, thus it is the recommended method.

The general workflow is the following:

#. Install Spack and perform first-time setup
#. Install the recommended compiler
#. Build GCHP's dependencies
#. Generate a load script (a script that loads the GCHP dependencies in your environment)


1. Install Spack and do first-time setup
----------------------------------------

Decide where you want to install Spack. A few details you should consider are:

* this directory will be ~5-20 GB (keep in mind that some clusters limit :file:`$HOME` to a few GB)
* this directory cannot be moved (needs redo if you need to move it in the future)
* if other people are going to use these dependencies, this directory should be in a shared location

Once you choose an install location, proceed with the commands below.
You can copy-paste these commands, but lookout for lines marked with a :literal:`# (modifiable) ...` comment as they might require modification.

.. important::
All commands in this tutorial are executed in the same directory.

Install spack and perform the following first-time setup.

.. code-block:: console
$ cd $HOME # (modifiable) cd to the install location you chose
$ git clone -c feature.manyFiles=true https://github.com/spack/spack.git # download Spack
$ source spack/share/spack/setup-env.sh # load Spack
$ spack external find # find software that is already available
Next, download a copy of the GCHP source code.
The GCHP source code has a :file:`spack/` subdirectory with important Spack settings.
The GCHP version should not matter, but it is good practice to use the latest version.

.. code-block:: console
$ git clone https://github.com/geoschem/GCHP.git # we need the GCHP/spack subdirectory
2. Install the recommended compiler
-----------------------------------

Next, install the recommended compiler, :literal:`intel-oneapi-compilers`.
Note the :literal:`-C GCHP/spack` argument---this specifies custom Spack setting for GCHP.

.. code-block:: console
$ spack -C GCHP/spack install intel-oneapi-compilers # install the recommended compiler
This should take a few minutes. Once the package is installed, add it as a compiler.

.. code-block:: console
$ spack compiler add $(spack location -i intel-oneapi-compilers)/compiler/latest/linux/bin/intel64 # register the compiler with spack
.. note::
You can run the command :literal:`spack find` to list all the packages that are installed.

You can run the command :literal:`spack compiler list` to list the registered compilers.
After the :command:`spack compiler add` command above, you should see a compiler named :literal:`intel@XXXX.XX`, where :literal:`XXXX.XX` is the compiler version.

3. Build GCHP's dependencies
---------------------------------

The next step is building the GCHP dependencies. This will be done a :command:`spack install` command, which has the following syntax.

.. code::
spack <scope-arguments> install <install-spec>
:literal:`<scope-arguments>` is a placeholder for arguments like :literal:`-C GCHP/spack`, which configures recommended Spack settings for use with GCHP.
:literal:`<install-spec>` is a placeholder for arguments that specify what package to install.

To install the GCHP dependencies, choose one of the following for :literal:`<install-spec>`:

* :literal:`esmf%intel ^intel-oneapi-mpi` - **(Recommended)** Default GCHP dependencies, using Intel compilers and Intel MPI.
* :literal:`esmf%intel ^openmpi` - Default GCHP dependencies, using Intel compilers and OpenMPI.

For :literal:`<scope-arguments>`, you should always include :literal:`-C GCHP/spack`. This configures settings for the
GCHP dependencies. Note that :literal:`GCHP/spack` has subdirectories with platform-specific settings for certain platforms (e.g., AWS ParallelCluster).
Check to see if any subdirectories look relevant to you.

The remainder of these instructions use AWS ParallelCluster as an example, so the commands use :literal:`-C GCHP/spack -C GCHP/spack/aws-parallelcluster-3.0.1` for :literal:`<scope-arguments>`.
If no subdirectories are relevant to you, just use :literal:`-C GCHP/spack`.

.. note::
You can see that packages that will be installed with the :command:`spack spec` command. For example,


.. code-block:: console
$ scope_args="-C GCHP/spack -C GCHP/spack/aws-parallelcluster-3.0.1" # (modifiable) see description of <scope-arguments>
$ install_spec="esmf%intel ^intel-oneapi-mpi" # (modifiable) see description of <install-spec>
$ spack ${scope_args} spec -I ${install_spec}
Input spec
--------------------------------
- esmf%intel
Concretized
--------------------------------
- esmf@8.0.1%intel@2021.5.0~debug~external-lapack+mpi+netcdf~pio~pnetcdf~xerces arch=linux-amzn2-x86_64
- ^intel-oneapi-mpi@2021.5.1%gcc@7.3.1+external-libfabric~ilp64 arch=linux-amzn2-x86_64
- ^libfabric@1.13.0%gcc@7.3.1~debug~kdreg fabrics=efa,mrail,rxd,rxm,shm,sockets,tcp,udp arch=linux-amzn2-x86_64
- ^libxml2@2.9.12%intel@2021.5.0~python arch=linux-amzn2-x86_64
- ^libiconv@1.16%intel@2021.5.0 libs=shared,static arch=linux-amzn2-x86_64
- ^pkgconf@1.8.0%intel@2021.5.0 arch=linux-amzn2-x86_64
- ^xz@5.2.5%intel@2021.5.0~pic libs=shared,static arch=linux-amzn2-x86_64
- ^zlib@1.2.11%intel@2021.5.0+optimize+pic+shared arch=linux-amzn2-x86_64
- ^netcdf-c@4.8.1%intel@2021.5.0~dap~fsync~hdf4~jna~mpi~parallel-netcdf+pic+shared arch=linux-amzn2-x86_64
- ^hdf5@1.12.1%intel@2021.5.0~cxx~fortran+hl~ipo~java~mpi+shared~szip~threadsafe+tools api=default build_type=RelWithDebInfo patches=ee351eb arch=linux-amzn2-x86_64
- ^cmake@3.22.2%intel@2021.5.0~doc~ncurses+openssl+ownlibs~qt build_type=Release arch=linux-amzn2-x86_64
- ^openssl@1.0.2k-fips%intel@2021.5.0~docs certs=system arch=linux-amzn2-x86_64
- ^m4@1.4.16%intel@2021.5.0+sigsegv arch=linux-amzn2-x86_64
- ^netcdf-fortran@4.5.3%intel@2021.5.0~doc+pic+shared arch=linux-amzn2-x86_64
The :command:`spack spec` command is not necessary, but it can be helpful to see exactly what packages will be installed.

The following commands build the GCHP dependencies. Note that this may take several hours.

.. code-block:: console
$ scope_args="-C GCHP/spack -C GCHP/spack/aws-parallelcluster-3.0.1" # (modifiable) see description of <scope-arguments>
$ install_spec="esmf%intel ^intel-oneapi-mpi" # (modifiable) see description of <install-spec>
$ spack ${scope_args} install ${install_spec}
4. Generate a load script
------------------------------

The last step is generating a script that loads the these dependencies.
This is a file that you will :literal:`source` before you build or run GCHP.
The following commands generate a script called :literal:`geoschem_deps-YYYY.MM` where :literal:`YYYY.MM` is the current year and month.

.. code-block:: console
$ load_script_name="geoschem_deps-$(date +%Y.%m)" # (modifiable) rename if you want to
$ spack ${scope_args} module tcl refresh -y # regenerate all the modulefiles
$ spack ${scope_args} module tcl loads -r -p $(pwd)/spack/share/spack/modules/linux-*-x86_64/ intel-oneapi-compilers cmake > ${load_script_name}
$ spack ${scope_args} module tcl loads -r -p $(pwd)/spack/share/spack/modules/linux-*-x86_64/ ${install_spec} >> ${load_script_name}
For me, this generated a load script named :file:`geoschem_deps-2022.03`.
In terminals or scripts you can load the GCHP dependencies by running:

.. code-block:: console
$ source /YOUR_PATH_TO/geoschem_deps-2022.03 # loads the the dependencies (replace YOUR_PATH_TO)
You can copy or move the load script to other directories. At this point, you can remove the :file:`GCHP` directory as it is not needed.
The :file:`spack` directory needs to remain.
2 changes: 1 addition & 1 deletion docs/source/supplement/job-script-examples.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.. _example_job_scripts:

Example Job Scripts
===================
Expand Down Expand Up @@ -37,4 +38,3 @@ simplicity, and build your own automated functionality with time.

* Auto-requeuing C360 simulation (Compute1): :download:`c360_requeuing.sh <../../../run/runScriptSamples/operational_examples/wustl_gcst/c360_requeuing.sh>`
* 1 month benchmark simulation (Cannon): :download:`gchp.benchmark.run <../../../run/runScriptSamples/operational_examples/harvard_gcst/gchp.benchmark.run>`

0 comments on commit b8fa2b9

Please sign in to comment.