diff --git a/boxtree/pyfmmlib_integration.py b/boxtree/pyfmmlib_integration.py index da56c1e38bdc3baa34675d7039f3f215f7bff3be..47c617d704426030bbc02eb7e47542672b024d73 100644 --- a/boxtree/pyfmmlib_integration.py +++ b/boxtree/pyfmmlib_integration.py @@ -682,6 +682,11 @@ class FMMLibExpansionWrangler(object): m2l_rotation_angles = self.rotation_data.m2l_rotation_angles() + if len(m2l_rotation_angles) == 0: + # The pyfmmlib wrapper may or may not complain if you give it a + # zero-length array. + return (rotmatf, rotmatb, rotmat_order) + def mem_estimate(order): # Rotation matrix memory cost estimate. return (8 diff --git a/test/test_fmm.py b/test/test_fmm.py index 2bd3f21c46c3959c16d5a804af41f01b54f39171..b5d2e1a5964e6fb15d7909f42d7496d6054fb56c 100644 --- a/test/test_fmm.py +++ b/test/test_fmm.py @@ -725,7 +725,9 @@ def test_fmm_float32(ctx_factory, enable_extents): @pytest.mark.parametrize("well_sep_is_n_away", (1, 2)) @pytest.mark.parametrize("helmholtz_k", (0, 2)) -def test_fmm_with_optimized_3d_m2l(ctx_factory, helmholtz_k, well_sep_is_n_away): +@pytest.mark.parametrize("nsrcntgts", (20, 10000)) +def test_fmm_with_optimized_3d_m2l(ctx_factory, nsrcntgts, helmholtz_k, + well_sep_is_n_away): logging.basicConfig(level=logging.INFO) from pytest import importorskip @@ -736,8 +738,7 @@ def test_fmm_with_optimized_3d_m2l(ctx_factory, helmholtz_k, well_sep_is_n_away) ctx = ctx_factory() queue = cl.CommandQueue(ctx) - nsources = 5000 - ntargets = 5000 + nsources = ntargets = nsrcntgts // 2 dtype = np.float64 sources = p_normal(queue, nsources, dims, dtype, seed=15)