Skip to content

Latest commit

 

History

History
102 lines (63 loc) · 3.45 KB

File metadata and controls

102 lines (63 loc) · 3.45 KB

NDSL Documentation

NDSL allows atmospheric scientists to write focus on what matters in model development and hides away the complexities of coding for a super computer.

Quick Start

Python 3.11.x is required for NDSL and all its third party dependencies for installation.

NDSL submodules gt4py and dace to point to vetted versions, use git clone --recurse-submodule to update the git submodules.

NDSL is NOT available on pypi. Installation of the package has to be local, via pip install ./NDSL (-e supported). The packages have a few options:

  • ndsl[test]: installs the test packages (based on pytest)
  • ndsl[develop]: installs tools for development and tests.

NDSL uses pytest for its unit tests, the tests are available via:

  • pytest -x test: running CPU serial tests (GPU as well if cupy is installed)
  • mpirun -np 6 pytest -x test/mpi: running CPU parallel tests (GPU as well if cupy is installed)

Requirements & supported compilers

For CPU backends:

  • 3.11.x >= Python < 3.12.x
  • Compilers:
    • GNU 11.2+

For GPU backends (the above plus):

  • CUDA 11.2+
  • Python package:
  • Libraries:
    • MPI compiled with cuda support

NDSL installation and testing

NDSL is not available at pypi, it uses

pip install NDSL

to install NDSL locally.

NDSL has a few options:

  • ndsl[test]: installs the test packages (based on pytest)
  • ndsl[develop]: installs tools for development and tests.

Tests are available via:

  • pytest -x test: running CPU serial tests (GPU as well if cupy is installed)
  • mpirun -np 6 pytest -x test/mpi: running CPU parallel tests (GPU as well if cupy is installed)

Configurations for Pace

Configurations for Pace to use NDSL with different backend:

  • FV3_DACEMODE=Python[Build|BuildAndRun|Run] controls the full program optimizer behavior

    • Python: default, use stencil only, no full program optimization

    • Build: will build the program then exit. This build no matter what. (backend must be dace:gpu or dace:cpu)

    • BuildAndRun: same as above but after build the program will keep executing (backend must be dace:gpu or dace:cpu)

    • Run: load pre-compiled program and execute, fail if the .so is not present (no hash check!) (backend must be dace:gpu or dace:cpu)

  • PACE_FLOAT_PRECISION=64 control the floating point precision throughout the program.

Install Pace with different NDSL backend:

  • Shell scripts to install Pace using NDSL backend on specific machines such as Gaea can be found in examples/build_scripts/.
  • When cloning Pace you will need to update the repository's submodules as well:
git clone --recursive https://github.com/ai2cm/pace.git

or if you have already cloned the repository:

git submodule update --init --recursive
  • Pace requires GCC > 9.2, MPI, and Python 3.8 on your system, and CUDA is required to run with a GPU backend.
  • We recommend creating a python venv or conda environment specifically for Pace.
python3 -m venv venv_name
source venv_name/bin/activate
  • Inside of your pace venv or conda environment pip install the Python requirements, GT4Py, and Pace:
pip3 install -r requirements_dev.txt -c constraints.txt
  • There are also separate requirements files which can be installed for linting (requirements_lint.txt) and building documentation (requirements_docs.txt).