From a7fd5eb820c9a7c1cef4feb381a3caeff3687c67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Kl=C3=B6ckner?= Date: Fri, 21 May 2021 21:26:36 +0000 Subject: [PATCH 01/11] Update .test-conda-env-py3.yml --- .test-conda-env-py3.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.test-conda-env-py3.yml b/.test-conda-env-py3.yml index bbe9d8b..ad4d27d 100644 --- a/.test-conda-env-py3.yml +++ b/.test-conda-env-py3.yml @@ -12,7 +12,7 @@ dependencies: - scipy - numpy - sympy - - matplotlib + - matplotlib-base - cgen - cython - toml -- GitLab From 2958e61d5a9e407554734c833880d47030639220 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 02/11] 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 892defb6385ebec8aa01db0a194ec6a160c08a3b 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 03/11] 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 ad4d27d..093af16 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 8b8e591a1274a58516e86b0567a9ba094921cba7 Mon Sep 17 00:00:00 2001 From: xywei Date: Fri, 21 May 2021 17:32:24 -0500 Subject: [PATCH 04/11] 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 cd7c3feeced041e3ac282fa866874377a6e629d7 Mon Sep 17 00:00:00 2001 From: xywei Date: Fri, 21 May 2021 17:44:25 -0500 Subject: [PATCH 05/11] 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 644580dbed86904d4362e5442c2f97b723ac0580 Mon Sep 17 00:00:00 2001 From: xywei Date: Fri, 21 May 2021 18:01:05 -0500 Subject: [PATCH 06/11] 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 8656cf477d49072e092a3d0115b75335f06ec35c Mon Sep 17 00:00:00 2001 From: xywei Date: Fri, 21 May 2021 18:18:47 -0500 Subject: [PATCH 07/11] 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 51e760d411e63550a8c177e47d93bcf30575cd4b Mon Sep 17 00:00:00 2001 From: xywei Date: Fri, 21 May 2021 18:31:19 -0500 Subject: [PATCH 08/11] 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 e5c1d94d5a42ef1cc7040c6f739984381775d3e7 Mon Sep 17 00:00:00 2001 From: xywei Date: Fri, 21 May 2021 18:38:08 -0500 Subject: [PATCH 09/11] 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 3ee8fb878d6dc295d52333df863cdb0284aabe7c Mon Sep 17 00:00:00 2001 From: xywei Date: Fri, 21 May 2021 19:35:10 -0500 Subject: [PATCH 10/11] 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 58da925227f5b01a2940034e5b5dd872ff70bfca Mon Sep 17 00:00:00 2001 From: xywei Date: Fri, 21 May 2021 19:59:50 -0500 Subject: [PATCH 11/11] 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