From 5fe79faf4f4faca3db05cf92955276d066b6b3ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Kl=C3=B6ckner?= Date: Fri, 21 May 2021 21:52:06 +0000 Subject: [PATCH 01/10] Add arraycontext dep in setup.py and requirements.txt --- requirements.txt | 1 + setup.py | 1 + 2 files changed, 2 insertions(+) diff --git a/requirements.txt b/requirements.txt index 16f533f..b589dfb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -9,6 +9,7 @@ filelock -e git+https://gitlab.tiker.net/inducer/pytential.git#egg=pytential -e git+https://gitlab.tiker.net/inducer/pytools.git#egg=pytools -e git+https://gitlab.tiker.net/inducer/cgen.git#egg=cgen +-e git+https://gitlab.tiker.net/inducer/arraycontext.git#egg=arraycontext -e git+https://gitlab.tiker.net/inducer/meshmode.git#egg=meshmode -e git+https://gitlab.tiker.net/inducer/genpy.git#egg=genpy -e git+https://gitlab.tiker.net/inducer/pyvisfile.git#egg=pyvisfile diff --git a/setup.py b/setup.py index eeb43f8..740739b 100644 --- a/setup.py +++ b/setup.py @@ -113,6 +113,7 @@ def main(): "boxtree", "h5py", "loopy", + "arraycontext", "meshmode", "modepy", "pyevtk", -- GitLab From 6c88153c66c994e5712e148eff35608c3bed935e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Kl=C3=B6ckner?= Date: Fri, 21 May 2021 22:15:57 +0000 Subject: [PATCH 02/10] Add arraycontext dep also in conda env files --- .test-conda-env-py3-macos.yml | 1 + .test-conda-env-py3.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.test-conda-env-py3-macos.yml b/.test-conda-env-py3-macos.yml index cca9d5b..8fe208d 100644 --- a/.test-conda-env-py3-macos.yml +++ b/.test-conda-env-py3-macos.yml @@ -41,6 +41,7 @@ dependencies: - git+https://gitlab.tiker.net/inducer/gmsh_interop - git+https://gitlab.tiker.net/inducer/boxtree - git+https://gitlab.tiker.net/inducer/modepy + - git+https://gitlab.tiker.net/inducer/arraycontext - git+https://gitlab.tiker.net/inducer/meshmode - git+https://gitlab.tiker.net/inducer/pymbolic - git+https://gitlab.tiker.net/inducer/sumpy diff --git a/.test-conda-env-py3.yml b/.test-conda-env-py3.yml index bbe9d8b..df48ceb 100644 --- a/.test-conda-env-py3.yml +++ b/.test-conda-env-py3.yml @@ -39,6 +39,7 @@ dependencies: - git+https://gitlab.tiker.net/inducer/gmsh_interop - git+https://gitlab.tiker.net/inducer/boxtree - git+https://gitlab.tiker.net/inducer/modepy + - git+https://gitlab.tiker.net/inducer/arraycontext - git+https://gitlab.tiker.net/inducer/meshmode - git+https://gitlab.tiker.net/inducer/pymbolic - git+https://gitlab.tiker.net/inducer/sumpy -- GitLab From 782eacabb5cca1722fa417eb0800df1f8dbb2801 Mon Sep 17 00:00:00 2001 From: xywei Date: Fri, 21 May 2021 17:32:24 -0500 Subject: [PATCH 03/10] Switch to upstream boxtree --- requirements.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index b589dfb..099dcc8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,19 +3,19 @@ filelock # git+https://gitlab.tiker.net/xywei/pypvfmm.git#egg=pypvfmm --e git+https://gitlab.tiker.net/xywei/boxtree.git#egg=boxtree -e git+https://gitlab.tiker.net/inducer/gmsh_interop.git#egg=gmsh_interop -e git+https://gitlab.tiker.net/inducer/pytential.git#egg=pytential -e git+https://gitlab.tiker.net/inducer/pytools.git#egg=pytools -e git+https://gitlab.tiker.net/inducer/cgen.git#egg=cgen +-e git+https://gitlab.tiker.net/inducer/loopy.git#egg=loopy +-e git+https://gitlab.tiker.net/inducer/pymbolic.git#egg=pymbolic +-e git+https://gitlab.tiker.net/inducer/boxtree.git#egg=boxtree -e git+https://gitlab.tiker.net/inducer/arraycontext.git#egg=arraycontext -e git+https://gitlab.tiker.net/inducer/meshmode.git#egg=meshmode -e git+https://gitlab.tiker.net/inducer/genpy.git#egg=genpy -e git+https://gitlab.tiker.net/inducer/pyvisfile.git#egg=pyvisfile --e git+https://gitlab.tiker.net/inducer/pymbolic.git#egg=pymbolic -e git+https://gitlab.tiker.net/inducer/sumpy.git#egg=sumpy --e git+https://gitlab.tiker.net/inducer/loopy.git#egg=loopy -e git+https://gitlab.tiker.net/inducer/modepy.git#egg=modepy -e .[test,doc] -- GitLab From 85c47edd16c4cd1f25d91e33fe31bbc7bd4d5820 Mon Sep 17 00:00:00 2001 From: xywei Date: Fri, 21 May 2021 17:44:25 -0500 Subject: [PATCH 04/10] Tag non-conda CI jobs with dealii --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1fc8f6a..5aba752 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -22,7 +22,7 @@ Python 3 POCL: tags: - python3 - pocl - - large-node + - dealii except: - tags artifacts: @@ -45,7 +45,7 @@ Python 3 Intel: tags: - python3 - intel-cl-cpu - - large-node + - dealii except: - tags artifacts: -- GitLab From 694230ac7a3f73fc529eb0d87255b54be4fccd24 Mon Sep 17 00:00:00 2001 From: xywei Date: Fri, 21 May 2021 18:01:05 -0500 Subject: [PATCH 05/10] Build meshgen11 module in conda CI job --- .gitlab-ci.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5aba752..f8229c5 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -58,8 +58,11 @@ Python 3 Conda: - export CONDA_ENVIRONMENT=.test-conda-env-py3.yml - export HDF5_USE_FILE_LOCKING=FALSE - export PYTEST_FLAGS="--cov=volumential" - - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project-within-miniconda.sh - - ". ./build-and-test-py-project-within-miniconda.sh" + - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/main/ci-support.sh + - source ci-support.sh + - build_py_project_in_conda_env + - ((cd contrib/meshgen11_dealii/; ./build.sh) && echo "Using meshgen11_dealii.") || (echo "Using boxtree for meshgen.") + - test_py_project tags: - linux - large-node -- GitLab From 453d6c1df15909633d6d378579f5cdcef1562085 Mon Sep 17 00:00:00 2001 From: xywei Date: Fri, 21 May 2021 18:18:47 -0500 Subject: [PATCH 06/10] Skip non-conda jobs if the runner does not have dealii --- .gitlab-ci.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index f8229c5..4fa0330 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,6 +9,7 @@ Flake8: Python 3 POCL: script: + - if [[ $(dpkg-query -l | grep libdeal.ii-dev | wc -l) = 0 ]]; then echo "Deal.ii not found"; exit 0; fi - export PY_EXE=python3 - export PYOPENCL_TEST=portable:pthread - export HDF5_USE_FILE_LOCKING=FALSE @@ -31,6 +32,7 @@ Python 3 POCL: Python 3 Intel: script: + - if [[ $(dpkg-query -l | grep libdeal.ii-dev | wc -l) = 0 ]]; then echo "Deal.ii not found"; exit 0; fi - export PY_EXE=python3 - source /opt/enable-intel-cl.sh - export PYOPENCL_TEST="intel(r):pu" @@ -65,7 +67,6 @@ Python 3 Conda: - test_py_project tags: - linux - - large-node except: - tags artifacts: @@ -81,8 +82,11 @@ Python 3 Conda Apple: - export CC=clang - export PYTEST_FLAGS="--cov=volumential" - set -o xtrace - - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-and-test-py-project-within-miniconda.sh - - ". ./build-and-test-py-project-within-miniconda.sh" + - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/main/ci-support.sh + - source ci-support.sh + - build_py_project_in_conda_env + - ((cd contrib/meshgen11_dealii/; ./build.sh) && echo "Using meshgen11_dealii.") || (echo "Using boxtree for meshgen.") + - test_py_project tags: - apple except: @@ -99,13 +103,14 @@ Python 3 POCL Examples: - export EXTRA_INSTALL="pybind11 cython numpy pytest scipy mako wheel" - rm -f examples/*.hdf5 - git submodule sync && git submodule update --init --recursive --remote + - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/main/ci-support.sh + - source ci-support.sh + - build_py_project_in_conda_env - ((cd contrib/meshgen11_dealii/; ./build.sh) && echo "Using meshgen11_dealii.") || (echo "Using boxtree for meshgen.") - - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/master/build-py-project-and-run-examples.sh - - ". ./build-py-project-and-run-examples.sh" + - run_examples tags: - python3 - pocl - - large-node except: - tags artifacts: -- GitLab From 71bbfbc1a48880f1bd994267fd0ef79c4d5b23ee Mon Sep 17 00:00:00 2001 From: xywei Date: Fri, 21 May 2021 18:31:19 -0500 Subject: [PATCH 07/10] CI: remove hdf5 filelocking settings, and switch examples to run in conda --- .gitlab-ci.yml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4fa0330..51fc15d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,7 +12,6 @@ Python 3 POCL: - if [[ $(dpkg-query -l | grep libdeal.ii-dev | wc -l) = 0 ]]; then echo "Deal.ii not found"; exit 0; fi - export PY_EXE=python3 - export PYOPENCL_TEST=portable:pthread - - export HDF5_USE_FILE_LOCKING=FALSE - export EXTRA_INSTALL="pybind11 cython numpy pytest pytest-cov scipy mako wheel" - export PYTEST_FLAGS="--cov=volumential" - git submodule sync && git submodule update --init --recursive --remote @@ -36,7 +35,6 @@ Python 3 Intel: - export PY_EXE=python3 - source /opt/enable-intel-cl.sh - export PYOPENCL_TEST="intel(r):pu" - - export HDF5_USE_FILE_LOCKING=FALSE - export PYTEST_FLAGS="--cov=volumential" - export EXTRA_INSTALL="pybind11 cython numpy pytest pytest-cov scipy mako wheel" - git submodule sync && git submodule update --init --recursive --remote @@ -58,7 +56,6 @@ Python 3 Conda: script: - export SUMPY_FORCE_SYMBOLIC_BACKEND=symengine - export CONDA_ENVIRONMENT=.test-conda-env-py3.yml - - export HDF5_USE_FILE_LOCKING=FALSE - export PYTEST_FLAGS="--cov=volumential" - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/main/ci-support.sh - source ci-support.sh @@ -78,7 +75,6 @@ Python 3 Conda Apple: - export LC_ALL=en_US.UTF-8 - export LANG=en_US.UTF-8 - export CONDA_ENVIRONMENT=.test-conda-env-py3-macos.yml - - export HDF5_USE_FILE_LOCKING=FALSE - export CC=clang - export PYTEST_FLAGS="--cov=volumential" - set -o xtrace @@ -95,14 +91,10 @@ Python 3 Conda Apple: reports: junit: test/pytest.xml -Python 3 POCL Examples: +Python 3 Conda Examples: script: - - test -n "$SKIP_EXAMPLES" && exit - - export PY_EXE=python3 - - export PYOPENCL_TEST=portable:pthread - - export EXTRA_INSTALL="pybind11 cython numpy pytest scipy mako wheel" + - export CONDA_ENVIRONMENT=.test-conda-env-py3.yml - rm -f examples/*.hdf5 - - git submodule sync && git submodule update --init --recursive --remote - curl -L -O -k https://gitlab.tiker.net/inducer/ci-support/raw/main/ci-support.sh - source ci-support.sh - build_py_project_in_conda_env -- GitLab From e1c6378c1c40d5610de1991623dd2d73a2d8c808 Mon Sep 17 00:00:00 2001 From: xywei Date: Fri, 21 May 2021 18:38:08 -0500 Subject: [PATCH 08/10] Be explicit about use_rscale when forming expansions in tests --- test/test_nearfield_interaction_completeness.py | 4 ++-- test/test_volume_fmm.py | 10 ++++++---- volumential/table_manager.py | 3 --- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/test/test_nearfield_interaction_completeness.py b/test/test_nearfield_interaction_completeness.py index c1f566c..cd590c7 100644 --- a/test/test_nearfield_interaction_completeness.py +++ b/test/test_nearfield_interaction_completeness.py @@ -136,8 +136,8 @@ def drive_test_completeness(ctx, queue, dim, q_order): knl = LaplaceKernel(dim) out_kernels = [knl] - local_expn_class = VolumeTaylorLocalExpansion - mpole_expn_class = VolumeTaylorMultipoleExpansion + local_expn_class = partial(VolumeTaylorLocalExpansion, use_rscale=None) + mpole_expn_class = partial(VolumeTaylorMultipoleExpansion, use_rscale=None) from volumential.expansion_wrangler_fpnd import ( FPNDExpansionWranglerCodeContainer, diff --git a/test/test_volume_fmm.py b/test/test_volume_fmm.py index df0ca1e..339da12 100644 --- a/test/test_volume_fmm.py +++ b/test/test_volume_fmm.py @@ -223,10 +223,12 @@ def laplace_problem(ctx_factory): knl = LaplaceKernel(dim) out_kernels = [knl] - local_expn_class = LaplaceConformingVolumeTaylorLocalExpansion - mpole_expn_class = LaplaceConformingVolumeTaylorMultipoleExpansion - # local_expn_class = VolumeTaylorLocalExpansion - # mpole_expn_class = VolumeTaylorMultipoleExpansion + local_expn_class = partial(LaplaceConformingVolumeTaylorLocalExpansion, + use_rscale=None) + mpole_expn_class = partial(LaplaceConformingVolumeTaylorMultipoleExpansion, + use_rscale=None) + # local_expn_class = partial(VolumeTaylorLocalExpansion, use_rscale=None) + # mpole_expn_class = partial(VolumeTaylorMultipoleExpansion, use_rscale=None) exclude_self = True from volumential.expansion_wrangler_fpnd import ( diff --git a/volumential/table_manager.py b/volumential/table_manager.py index cb6ad6c..86e520a 100644 --- a/volumential/table_manager.py +++ b/volumential/table_manager.py @@ -34,9 +34,6 @@ import numpy as np import volumential as vm -# from sumpy.expansion.local import VolumeTaylorLocalExpansion -# from sumpy.expansion.multipole import VolumeTaylorMultipoleExpansion -# from sumpy.kernel import LaplaceKernel from volumential.nearfield_potential_table import NearFieldInteractionTable logger = logging.getLogger(__name__) -- GitLab From 72b9efbee52d268dae223902c43f53f45165a702 Mon Sep 17 00:00:00 2001 From: xywei Date: Fri, 21 May 2021 19:35:10 -0500 Subject: [PATCH 09/10] Adapt p2p evaluator for object array --- test/test_volume_fmm.py | 14 ++++++-------- volumential/volume_fmm.py | 24 ++++++++++++------------ 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/test/test_volume_fmm.py b/test/test_volume_fmm.py index 339da12..8ee1084 100644 --- a/test/test_volume_fmm.py +++ b/test/test_volume_fmm.py @@ -216,17 +216,15 @@ def laplace_problem(ctx_factory): # from sumpy.expansion.multipole import VolumeTaylorMultipoleExpansion # from sumpy.expansion.local import VolumeTaylorLocalExpansion - from sumpy.expansion.multipole import ( - LaplaceConformingVolumeTaylorMultipoleExpansion, - ) - from sumpy.expansion.local import LaplaceConformingVolumeTaylorLocalExpansion + from sumpy.expansion.multipole import \ + LinearPDEConformingVolumeTaylorMultipoleExpansion + from sumpy.expansion.local import \ + LinearPDEConformingVolumeTaylorLocalExpansion knl = LaplaceKernel(dim) out_kernels = [knl] - local_expn_class = partial(LaplaceConformingVolumeTaylorLocalExpansion, - use_rscale=None) - mpole_expn_class = partial(LaplaceConformingVolumeTaylorMultipoleExpansion, - use_rscale=None) + local_expn_class = LinearPDEConformingVolumeTaylorLocalExpansion + mpole_expn_class = LinearPDEConformingVolumeTaylorMultipoleExpansion # local_expn_class = partial(VolumeTaylorLocalExpansion, use_rscale=None) # mpole_expn_class = partial(VolumeTaylorMultipoleExpansion, use_rscale=None) diff --git a/volumential/volume_fmm.py b/volumential/volume_fmm.py index 23685ce..0b1a451 100644 --- a/volumential/volume_fmm.py +++ b/volumential/volume_fmm.py @@ -81,10 +81,11 @@ def drive_volume_fmm(traversal, expansion_wrangler, src_weights, src_func, logger.info("start fmm") # accept unpacked inputs when doing fmm for just one source field + dtype = wrangler.dtype if src_weights.ndim == 1: - src_weights = make_obj_array([src_weights]) + src_weights = make_obj_array([src_weights.astype(dtype)]) if src_func.ndim == 1: - src_func = make_obj_array([src_func]) + src_func = make_obj_array([src_func.astype(dtype)]) assert (ns := len(src_weights)) == len(src_func) if ns > 1: @@ -187,8 +188,6 @@ def drive_volume_fmm(traversal, expansion_wrangler, src_weights, src_func, from sumpy import P2P - dtype = wrangler.dtype - p2p = P2P( wrangler.queue.context, wrangler.code.target_kernels, @@ -204,14 +203,15 @@ def drive_volume_fmm(traversal, expansion_wrangler, src_weights, src_func, if hasattr(wrangler, "self_extra_kwargs"): p2p_extra_kwargs.update(wrangler.kernel_extra_kwargs) - evt, (ref_pot,) = p2p( - wrangler.queue, - traversal.tree.targets, - traversal.tree.sources, - (src_weights.astype(dtype),), - **p2p_extra_kwargs - ) - potentials[0] += ref_pot + for iw, sw in enumerate(src_weights): + evt, (ref_pot,) = p2p( + wrangler.queue, + traversal.tree.targets, + traversal.tree.sources, + (sw,), + **p2p_extra_kwargs + ) + potentials[iw] += ref_pot l1_potentials, timing_future = wrangler.eval_direct_p2p( traversal.target_boxes, -- GitLab From 0e3add0620e6c9acabf4fccee2be5d54fa8595a9 Mon Sep 17 00:00:00 2001 From: xywei Date: Fri, 21 May 2021 19:59:50 -0500 Subject: [PATCH 10/10] Allow apple tests to fail --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 51fc15d..355cefb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -90,6 +90,7 @@ Python 3 Conda Apple: artifacts: reports: junit: test/pytest.xml + allow_failure: true Python 3 Conda Examples: script: -- GitLab