-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from NOAA-GFDL/feature/tests_readme
[Feature] Tests via Github actions + README
- Loading branch information
Showing
7 changed files
with
89 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: "Lint" | ||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled] | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/[email protected] | ||
with: | ||
submodules: 'recursive' | ||
- name: Step Python 3.8.12 | ||
uses: actions/[email protected] | ||
with: | ||
python-version: '3.8.12' | ||
- name: Install OpenMPI for gt4py | ||
run: | | ||
sudo apt-get install libopenmpi-dev | ||
- name: Install Python packages | ||
run: | | ||
python -m pip install --upgrade pip setuptools wheel | ||
pip install .[develop] | ||
- name: Run lint via pre-commit | ||
run: | | ||
pre-commit run --all-files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: "Unit tests" | ||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled] | ||
|
||
jobs: | ||
all: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/[email protected] | ||
with: | ||
submodules: 'recursive' | ||
- name: Setup Python | ||
uses: actions/[email protected] | ||
with: | ||
python-version: '3.8.12' | ||
- name: Install OpenMPI & Boost for gt4py | ||
run: | | ||
sudo apt-get install libopenmpi-dev libboost1.74-dev | ||
- name: Install Python packages | ||
run: | | ||
python -m pip install --upgrade pip setuptools wheel | ||
pip install .[test] | ||
- name: Run serial-cpu tests | ||
run: | | ||
pytest -x tests | ||
- name: Run parallel-cpu tests | ||
run: | | ||
pytest -x tests/mpi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,21 @@ | ||
# NOAA/NASA Domain Specific Language middleware | ||
|
||
Use `git clone --recurse-submodule` to pull all vetted versions of the submodules used by `ndsl` | ||
NDSL is a middleware for climate and weather modelling developped conjointment by NOAA and NASA. The middleware brings together [GT4Py](https://github.com/GridTools/gt4py/) (the `cartesian` flavor), an ETH CSCS's stencil DSL, and [DaCE](https://github.com/spcl/dace/), an ETH SPCL's data flow framework, both developped for high-performance and portability. On top of those pillars, NDSL deploys a series of optimized APIs for common operations (Halo exchange, domain decomposition, MPI...) and a set of bespoke optimizations for the models targeted by the middleware. | ||
|
||
## Battery-included for FV-based models | ||
|
||
Historically NDSL was developed to port the FV3 dynamical core on the cube-sphere. Therefore, the middleware ships with ready-to-execute specilization for models based on cube-sphere grid and FV-based model in particular. | ||
|
||
## Quickstart | ||
|
||
NDSL submodules `gt4py` and `dace` to point to vetted versions, use `git clone --recurse-submodule`. | ||
|
||
NDSL is __NOT__ available on `pypi`. Installation of the package has to be local, via `pip install ./NDSL` (`-e` supported). The packages 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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters