|
1 | 1 | # NDSL Documentation |
2 | 2 |
|
3 | | -NDSL allows atmospheric scientists to write focus on what matters in model development and hides away the complexities of coding for a super computer. |
| 3 | +NDSL is a middleware for climate and weather modelling developed jointly by NOAA and NASA. It allows atmospheric scientists to focus on what matters in model development and essentially decouples performance engineering from model development. |
4 | 4 |
|
5 | | -## Quick Start |
| 5 | +## Portable performance |
6 | 6 |
|
7 | | -Python `3.11.x` is required for NDSL and all its third party dependencies for installation. |
| 7 | +NDSL brings together [GT4Py](https://github.com/GridTools/gt4py/) and [DaCe](https://github.com/spcl/dace/), two libraries developed for high-performance and portability. On top of those pillars, NDSL deploys a series of optimized APIs for common operations, e.g. halo exchange or domain decomposition, and tools to port existing models. |
8 | 8 |
|
9 | | -NDSL submodules `gt4py` and `dace` to point to vetted versions, use `git clone --recurse-submodule` to update the git submodules. |
| 9 | +## Batteries-included for FV-based models |
10 | 10 |
|
11 | | -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: |
| 11 | +Historically, NDSL was developed to port the FV3 dynamical core on the cubed-sphere. Therefore, the middleware ships with ready-to-execute specialization for models based on cubed-sphere grids and FV-based models in particular. |
12 | 12 |
|
13 | | -- `ndsl[test]`: installs the test packages (based on `pytest`) |
14 | | -- `ndsl[develop]`: installs tools for development and tests. |
15 | | - |
16 | | -NDSL uses pytest for its unit tests, the tests are available via: |
17 | | - |
18 | | -- `pytest -x test`: running CPU serial tests (GPU as well if `cupy` is installed) |
19 | | -- `mpirun -np 6 pytest -x test/mpi`: running CPU parallel tests (GPU as well if `cupy` is installed) |
20 | | - |
21 | | -## Requirements & supported compilers |
22 | | - |
23 | | -For CPU backends: |
24 | | - |
25 | | -- 3.11.x >= Python < 3.12.x |
26 | | -- Compilers: |
27 | | - - GNU 11.2+ |
28 | | - |
29 | | -For GPU backends (the above plus): |
30 | | - |
31 | | -- CUDA 11.2+ |
32 | | -- Python package: |
33 | | - - `cupy` (latest with proper driver support [see install notes](https://docs.cupy.dev/en/stable/install.html)) |
34 | | -- Libraries: |
35 | | - - MPI compiled with cuda support |
36 | | - |
37 | | -## NDSL installation and testing |
38 | | - |
39 | | -NDSL is not available at `pypi`, it uses |
40 | | - |
41 | | -```bash |
42 | | -pip install NDSL |
43 | | -``` |
44 | | - |
45 | | -to install NDSL locally. |
46 | | - |
47 | | -NDSL has a few options: |
48 | | - |
49 | | -- `ndsl[test]`: installs the test packages (based on `pytest`) |
50 | | -- `ndsl[develop]`: installs tools for development and tests. |
51 | | - |
52 | | -Tests are available via: |
53 | | - |
54 | | -- `pytest -x test`: running CPU serial tests (GPU as well if `cupy` is installed) |
55 | | -- `mpirun -np 6 pytest -x test/mpi`: running CPU parallel tests (GPU as well if `cupy` is installed) |
56 | | - |
57 | | -## Configurations for Pace |
58 | | - |
59 | | -Configurations for Pace to use NDSL with different backend: |
60 | | - |
61 | | -- FV3_DACEMODE=Python[Build|BuildAndRun|Run] controls the full program optimizer behavior |
62 | | - |
63 | | - - Python: default, use stencil only, no full program optimization |
64 | | - |
65 | | - - Build: will build the program then exit. This _build no matter what_. (backend must be `dace:gpu` or `dace:cpu`) |
66 | | - |
67 | | - - BuildAndRun: same as above but after build the program will keep executing (backend must be `dace:gpu` or `dace:cpu`) |
68 | | - |
69 | | - - 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`) |
70 | | - |
71 | | -- NDSL_LITERAL_PRECISION=64 controls the floating point precision throughout the program. |
72 | | - |
73 | | -Install Pace with different NDSL backend: |
74 | | - |
75 | | -- Shell scripts to install Pace using NDSL backend on specific machines such as Gaea can be found in `examples/build_scripts/`. |
76 | | -- When cloning Pace you will need to update the repository's submodules as well: |
77 | | - |
78 | | -```bash |
79 | | -git clone --recursive https://github.com/ai2cm/pace.git |
80 | | -``` |
81 | | - |
82 | | - or if you have already cloned the repository: |
83 | | - |
84 | | -```bash |
85 | | -git submodule update --init --recursive |
86 | | -``` |
87 | | - |
88 | | -- Pace requires GCC > 9.2, MPI, and Python 3.8 on your system, and CUDA is required to run with a GPU backend. |
89 | | -- We recommend creating a python `venv` or conda environment specifically for Pace. |
90 | | - |
91 | | -```bash |
92 | | -python3 -m venv venv_name |
93 | | -source venv_name/bin/activate |
94 | | -``` |
95 | | - |
96 | | -- Inside of your pace `venv` or conda environment pip install the Python requirements, GT4Py, and Pace: |
97 | | - |
98 | | -```bash |
99 | | -pip3 install -r requirements_dev.txt -c constraints.txt |
100 | | -``` |
101 | | - |
102 | | -- There are also separate requirements files which can be installed for linting (`requirements_lint.txt`) and building documentation (`requirements_docs.txt`). |
| 13 | +Next: get [up and running](./quickstart.md). |
0 commit comments