Skip to content

Commit

Permalink
Merge pull request #39 from CDAT/variant
Browse files Browse the repository at this point in the history
Run tests with libnetcdf nompi, mpich and openmpi variants
  • Loading branch information
muryanto1 committed May 26, 2020
2 parents 4889779 + d88d743 commit d7bf59a
Show file tree
Hide file tree
Showing 8 changed files with 195 additions and 46 deletions.
231 changes: 193 additions & 38 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ aliases:
command: |
source $WORKDIR/miniconda/etc/profile.d/conda.sh
conda activate base
conda create -y -n $ENV_NAME --use-local $CHANNELS "$CONDA_PY_VER" $PKG_NAME $PKGS $COVERAGE_PKGS
echo "conda create -y -n $ENV_NAME --use-local $CHANNELS \"$CONDA_PY_VER\" $PKG_NAME $PKGS $COVERAGE_PKGS \"$LIBNETCDF\""
conda create -y -n $ENV_NAME --use-local $CHANNELS "$CONDA_PY_VER" $PKG_NAME $PKGS $COVERAGE_PKGS "$LIBNETCDF"
conda activate $ENV_NAME
conda list
Expand All @@ -52,9 +53,6 @@ aliases:
- &conda_upload
name: conda_upload
command: |
if [[ $CIRCLE_BRANCH != "master" ]]; then
exit 0
fi
source $WORKDIR/miniconda/etc/profile.d/conda.sh
conda activate base
UPLOAD_OPTIONS="-t $CONDA_UPLOAD_TOKEN upload -u $USER -l $LABEL"
Expand All @@ -69,7 +67,10 @@ aliases:
conda deactivate
jobs:
macos_setup:
#
# setup_miniconda, rerender and build -- 'cdutil' is noarch
#
macos_build:
macos:
xcode: "11.4.0"
environment:
Expand All @@ -88,7 +89,7 @@ jobs:
paths:
- macos_build

linux_setup:
linux_build:
machine:
image: circleci/classic:latest
environment:
Expand All @@ -107,15 +108,18 @@ jobs:
paths:
- linux_build

macos_cdutil_py36:
#
# run tests with libnetcdf nompi
#
macos_cdutil_nompi_py36:
macos:
xcode: "11.4.0"
environment:
WORKDIR: /Users/distiller/project/macos_build
PKG_NAME: "cdutil"
REPO_NAME: "cdutil"
ENV_NAME: "test_cdutil"
CONDA_PY_VER: "python>=3.6,<3.7"
LIBNETCDF: "libnetcdf=*=nompi_*"
steps:
- checkout
- attach_workspace:
Expand All @@ -126,15 +130,15 @@ jobs:
path: tests_html
destination: tests_html

macos_cdutil_py37:
macos_cdutil_nompi_py37:
macos:
xcode: "11.4.0"
environment:
WORKDIR: /Users/distiller/project/macos_build
PKG_NAME: "cdutil"
REPO_NAME: "cdutil"
ENV_NAME: "test_cdutil"
CONDA_PY_VER: "python>=3.7,<3.8"
LIBNETCDF: "libnetcdf=*=nompi_*"
steps:
- checkout
- attach_workspace:
Expand All @@ -145,15 +149,15 @@ jobs:
path: tests_html
destination: tests_html

macos_cdutil_py38:
macos_cdutil_nompi_py38:
macos:
xcode: "11.4.0"
environment:
WORKDIR: /Users/distiller/project/macos_build
PKG_NAME: "cdutil"
REPO_NAME: "cdutil"
ENV_NAME: "test_cdutil"
CONDA_PY_VER: "python>=3.8,<3.9"
LIBNETCDF: "libnetcdf=*=nompi_*"
steps:
- checkout
- attach_workspace:
Expand All @@ -164,15 +168,15 @@ jobs:
path: tests_html
destination: tests_html

linux_cdutil_py36:
linux_cdutil_nompi_py36:
machine:
image: circleci/classic:latest
environment:
WORKDIR: /home/circleci/project/linux_build
PKG_NAME: "cdutil"
REPO_NAME: "cdutil"
ENV_NAME: "test_cdutil"
CONDA_PY_VER: "python>=3.6,<3.7"
LIBNETCDF: "libnetcdf=*=nompi_*"
steps:
- checkout
- attach_workspace:
Expand All @@ -183,15 +187,15 @@ jobs:
path: tests_html
destination: tests_html

linux_cdutil_py37:
linux_cdutil_nompi_py37:
machine:
image: circleci/classic:latest
environment:
WORKDIR: /home/circleci/project/linux_build
PKG_NAME: "cdutil"
REPO_NAME: "cdutil"
ENV_NAME: "test_cdutil"
CONDA_PY_VER: "python>=3.7,<3.8"
LIBNETCDF: "libnetcdf=*=nompi_*"
COVERAGE: "-c tests/coverage.json --coverage-from-egg"
COVERAGE_PKGS: "coverage coveralls"
steps:
Expand All @@ -205,15 +209,135 @@ jobs:
path: tests_html
destination: tests_html

linux_cdutil_py38:
linux_cdutil_nompi_py38:
machine:
image: circleci/classic:latest
environment:
WORKDIR: /home/circleci/project/linux_build
PKG_NAME: "cdutil"
REPO_NAME: "cdutil"
ENV_NAME: "test_cdutil"
CONDA_PY_VER: "python>=3.8,<3.9"
LIBNETCDF: "libnetcdf=*=nompi_*"
steps:
- checkout
- attach_workspace:
at: .
- run: *setup_run_tests
- run: *run_tests
- store_artifacts:
path: tests_html
destination: tests_html

#
# run tests with libnetcdf mpich
#
macos_cdutil_mpich_py36:
macos:
xcode: "11.4.0"
environment:
WORKDIR: /Users/distiller/project/macos_build
PKG_NAME: "cdutil"
ENV_NAME: "test_cdutil"
CONDA_PY_VER: "python>=3.6,<3.7"
LIBNETCDF: "libnetcdf=*=mpi_mpich_*"
steps:
- checkout
- attach_workspace:
at: .
- run: *setup_run_tests
- run: *run_tests
- store_artifacts:
path: tests_html
destination: tests_html

macos_cdutil_mpich_py37:
macos:
xcode: "11.4.0"
environment:
WORKDIR: /Users/distiller/project/macos_build
PKG_NAME: "cdutil"
ENV_NAME: "test_cdutil"
CONDA_PY_VER: "python>=3.7,<3.8"
LIBNETCDF: "libnetcdf=*=mpi_mpich_*"
steps:
- checkout
- attach_workspace:
at: .
- run: *setup_run_tests
- run: *run_tests
- store_artifacts:
path: tests_html
destination: tests_html

macos_cdutil_mpich_py38:
macos:
xcode: "11.4.0"
environment:
WORKDIR: /Users/distiller/project/macos_build
PKG_NAME: "cdutil"
ENV_NAME: "test_cdutil"
CONDA_PY_VER: "python>=3.8,<3.9"
LIBNETCDF: "libnetcdf=*=mpi_mpich_*"
steps:
- checkout
- attach_workspace:
at: .
- run: *setup_run_tests
- run: *run_tests
- store_artifacts:
path: tests_html
destination: tests_html

linux_cdutil_mpich_py36:
machine:
image: circleci/classic:latest
environment:
WORKDIR: /home/circleci/project/linux_build
PKG_NAME: "cdutil"
ENV_NAME: "test_cdutil"
CONDA_PY_VER: "python>=3.6,<3.7"
LIBNETCDF: "libnetcdf=*=mpi_mpich_*"
steps:
- checkout
- attach_workspace:
at: .
- run: *setup_run_tests
- run: *run_tests
- store_artifacts:
path: tests_html
destination: tests_html

linux_cdutil_mpich_py37:
machine:
image: circleci/classic:latest
environment:
WORKDIR: /home/circleci/project/linux_build
PKG_NAME: "cdutil"
ENV_NAME: "test_cdutil"
CONDA_PY_VER: "python>=3.7,<3.8"
LIBNETCDF: "libnetcdf=*=mpi_mpich_*"
COVERAGE: "-c tests/coverage.json --coverage-from-egg"
COVERAGE_PKGS: "coverage coveralls"
steps:
- checkout
- attach_workspace:
at: .
- run: *setup_run_tests
- run: *run_tests
- run: *run_coveralls
- store_artifacts:
path: tests_html
destination: tests_html

linux_cdutil_mpich_py38:
machine:
image: circleci/classic:latest
environment:
WORKDIR: /home/circleci/project/linux_build
PKG_NAME: "cdutil"
ENV_NAME: "test_cdutil"
CONDA_PY_VER: "python>=3.8,<3.9"
LIBNETCDF: "libnetcdf=*=mpi_mpich_*"
steps:
- checkout
- attach_workspace:
Expand Down Expand Up @@ -243,31 +367,62 @@ workflows:
version: 2
cdutil:
jobs:
- macos_setup
- linux_setup
- macos_cdutil_py36:
- macos_build
- linux_build
- macos_cdutil_nompi_py36:
requires:
- macos_setup
- macos_cdutil_py37:
- macos_build
- macos_cdutil_nompi_py37:
requires:
- macos_setup
- macos_cdutil_py38:
- macos_build
- macos_cdutil_nompi_py38:
requires:
- macos_setup
- linux_cdutil_py36:
- macos_build
- linux_cdutil_nompi_py36:
requires:
- linux_setup
- linux_cdutil_py37:
- linux_build
- linux_cdutil_nompi_py37:
requires:
- linux_setup
- linux_cdutil_py38:
- linux_build
- linux_cdutil_nompi_py38:
requires:
- linux_setup
- linux_build

- macos_cdutil_mpich_py36:
requires:
- macos_build
- macos_cdutil_mpich_py37:
requires:
- macos_build
- macos_cdutil_mpich_py38:
requires:
- macos_build
- linux_cdutil_mpich_py36:
requires:
- linux_build
- linux_cdutil_mpich_py37:
requires:
- linux_build
- linux_cdutil_mpich_py38:
requires:
- linux_build

- upload:
requires:
- macos_cdutil_py36
- macos_cdutil_py37
- macos_cdutil_py38
- linux_cdutil_py36
- linux_cdutil_py37
- linux_cdutil_py38
- macos_cdutil_nompi_py36
- macos_cdutil_nompi_py37
- macos_cdutil_nompi_py38
- linux_cdutil_nompi_py36
- linux_cdutil_nompi_py37
- linux_cdutil_nompi_py38

- macos_cdutil_mpich_py36
- macos_cdutil_mpich_py37
- macos_cdutil_mpich_py38
- linux_cdutil_mpich_py36
- linux_cdutil_mpich_py37
- linux_cdutil_mpich_py38
filters:
branches:
only: master

1 change: 0 additions & 1 deletion cdutil/create_landsea_mask.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import cdms2
import MV2
import os
import cdat_info
import pkg_resources

egg_path = pkg_resources.resource_filename(pkg_resources.Requirement.parse("cdutil"), "share/cdutil")
Expand Down
1 change: 0 additions & 1 deletion cdutil/region.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Adapted for numpy/ma/cdms2 by convertcdms.py
from cdms2.selectors import SelectorComponent
import cdat_info
import warnings


Expand Down
1 change: 0 additions & 1 deletion cdutil/sftbyrgn.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import genutil
import cdms2
import os
import cdat_info
import pkg_resources


Expand Down
3 changes: 1 addition & 2 deletions cdutil/times.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import cdms2
import cdtime
import numpy.ma
import cdat_info

try:
basestring
Expand Down Expand Up @@ -320,7 +319,7 @@ def mergeTime(ds, statusbar=1, fill_value=1.e20):
raise Exception # to exit the it and i loops
elif val.value > vals[v]:
break
except BaseException as err:
except BaseException:
pass
if statusbar is not None and nt != 1:
if not isinstance(prev[0], type(0)):
Expand Down
Loading

0 comments on commit d7bf59a

Please sign in to comment.