diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1fc8f6a75c2d8366d07446d71d869063aaaf90ca..355cefb66f8d4dd3be0af92ce2dd49cbc0f471fa 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,9 +9,9 @@ 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 - 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 @@ -22,7 +22,7 @@ Python 3 POCL: tags: - python3 - pocl - - large-node + - dealii except: - tags artifacts: @@ -31,10 +31,10 @@ 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" - - 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 @@ -45,7 +45,7 @@ Python 3 Intel: tags: - python3 - intel-cl-cpu - - large-node + - dealii except: - tags artifacts: @@ -56,13 +56,14 @@ 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/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 except: - tags artifacts: @@ -74,12 +75,14 @@ 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 - - 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: @@ -87,22 +90,20 @@ Python 3 Conda Apple: artifacts: reports: junit: test/pytest.xml + allow_failure: true -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 - ((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: diff --git a/.test-conda-env-py3-macos.yml b/.test-conda-env-py3-macos.yml index cca9d5b25425cb8f1b1b028c2f15595aa7ac369b..8fe208d1033d07bba1f2f5f49927bea34a0e2784 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 bbe9d8bc78aa0e31f3159c3f404eaa5943631bd6..df48ceb05de6ec1208c578c35c07a82068f590ed 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 diff --git a/requirements.txt b/requirements.txt index 16f533f24a1af1c57e4b32eb8b04abd83be28b98..099dcc81e227b79587a25dc924f8d9f73d9f9d47 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,18 +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] diff --git a/setup.py b/setup.py index eeb43f8ffdafebb553cd427ab7a90611c1d4458b..740739b61e575ba0fbb53cb07eba6cafc264b396 100644 --- a/setup.py +++ b/setup.py @@ -113,6 +113,7 @@ def main(): "boxtree", "h5py", "loopy", + "arraycontext", "meshmode", "modepy", "pyevtk", diff --git a/test/test_nearfield_interaction_completeness.py b/test/test_nearfield_interaction_completeness.py index c1f566cafd63426eb8630622eb44ea9e542b7e10..cd590c7c803710b5481656072a1c102949fa6698 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 df0ca1e6e520cde84165ae95fa323fd5eb9f4931..8ee1084d4fb87fd1b0b4a51df97172ef6a61cc4d 100644 --- a/test/test_volume_fmm.py +++ b/test/test_volume_fmm.py @@ -216,17 +216,17 @@ 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 = LaplaceConformingVolumeTaylorLocalExpansion - mpole_expn_class = LaplaceConformingVolumeTaylorMultipoleExpansion - # local_expn_class = VolumeTaylorLocalExpansion - # mpole_expn_class = VolumeTaylorMultipoleExpansion + local_expn_class = LinearPDEConformingVolumeTaylorLocalExpansion + mpole_expn_class = LinearPDEConformingVolumeTaylorMultipoleExpansion + # 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 cb6ad6c70910e1f7a1d04149f7bb405cf4afd65a..86e520a7859fdb1a04d988c814276b7afbb2d7b4 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__) diff --git a/volumential/volume_fmm.py b/volumential/volume_fmm.py index 23685ce34fec52d2162f9230972feb03e9209469..0b1a451ee4b973938625199acd6a30f9d2c59cb7 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,