Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Array context #16

Closed
wants to merge 87 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
5915199
Initial, incomplete adaptation to meshmode's ArrayContext
inducer Jun 15, 2020
66fc944
Improve ArrayContext processing in BoundOperator.{__call__,eval}
inducer Jun 17, 2020
3dbc2c8
Track introduction of ArrayContext.np
inducer Jun 17, 2020
f0e5c54
symbolic.primitives: Fix the dimension check for a few 3D-surface-only
mattwala Jun 30, 2020
5cc8cf5
Merge branch 'master' of https://github.com/inducer/pytential into fi…
mattwala Jun 30, 2020
86934b7
Merge branch 'fix-surface-check' into 'master'
inducer Jul 1, 2020
273ba51
CI: Disable tests, only keep examples for now
mattwala Jul 2, 2020
cf635e0
Update requirements.txt
mattwala Jul 2, 2020
459ec80
Port over examples
mattwala Jul 2, 2020
1306729
Relax sumpy version
mattwala Jul 2, 2020
c738c07
Add utils.py
mattwala Jul 2, 2020
c1678d1
pylint fixes
mattwala Jul 2, 2020
657c35f
flake8 fixes
mattwala Jul 2, 2020
51fa634
requirements.txt: Point to revert-cffi-go-to-pybind branch of islpy
mattwala Jul 2, 2020
8a70c0d
Port over some tests
mattwala Jul 2, 2020
54a125a
flake8 fix
mattwala Jul 2, 2020
36919c9
Improve test specificity
mattwala Jul 2, 2020
c1df687
Merge branch 'master' into array-context
mattwala Jul 2, 2020
16864ec
Port test_symbolic.py
mattwala Jul 2, 2020
fddc8c4
Mark test_muller.py as OK
mattwala Jul 2, 2020
473de87
formatting
mattwala Jul 2, 2020
bb6d56e
Port test_global_qbx.py
mattwala Jul 2, 2020
a7d8282
Misc fixes for test_global_qbx
mattwala Jul 2, 2020
55a2b36
Port test_layer_pot_eigenvalues.py
mattwala Jul 2, 2020
ce86dc6
Point requirements.txt to sumpy master
mattwala Jul 2, 2020
b32792e
Fixes for test_layer_pot_eigenvalues
mattwala Jul 2, 2020
72a09b0
Port test_layer_pot_identity
mattwala Jul 2, 2020
7ce0165
Actually run the tests in test_layer_pot_identity.py
mattwala Jul 2, 2020
25582e5
Port test_layer_pot.py
mattwala Jul 2, 2020
01872e9
port test_matrix to array-context
alexfikl Jul 3, 2020
c3077e9
Port test_scalar_int_eq.py
mattwala Jul 3, 2020
80ab289
port test_linalg_proxy to array-context
alexfikl Jul 3, 2020
87df581
flake8 fixes
mattwala Jul 3, 2020
9b4ce76
Thaw failed_target_flags after QBXTargetAssociationFailedException
mattwala Jul 3, 2020
fee617b
Port test_maxwell.py
mattwala Jul 3, 2020
21d641d
Add test_maxwell.py to setup.cfg tests
mattwala Jul 3, 2020
d4a8585
port test_stokes to array-context
alexfikl Jul 3, 2020
16b103d
enable tests in setup.cfg
alexfikl Jul 3, 2020
d790dfe
Merge branch 'array-context' into array-context-tests
alexfikl Jul 3, 2020
213ee64
Allow tests marked as slowtest to run
mattwala Jul 3, 2020
b57224c
Fix yaml syntax
mattwala Jul 3, 2020
58d21fc
Merge branch 'array-context' into array-context-tests
alexfikl Jul 3, 2020
030c7c0
Document default_vdot()
mattwala Jul 3, 2020
af7ff8c
Improve the documentation in MatVecOp
mattwala Jul 3, 2020
0760994
Remove unneeded FIXME
mattwala Jul 3, 2020
37e9404
remove stray debugging remnants
alexfikl Jul 3, 2020
b5f1e9d
Remove another FIXME
mattwala Jul 3, 2020
740cd15
Apply 1 suggestion(s) to 1 file(s)
Jul 3, 2020
67b1228
Apply 1 suggestion(s) to 1 file(s)
Jul 3, 2020
c09cfb9
Apply 1 suggestion(s) to 1 file(s)
Jul 3, 2020
94a220d
switch argument order in unflatten_to_numpy
alexfikl Jul 3, 2020
6b50ccf
Address more FIXMEs
mattwala Jul 4, 2020
9303cc2
Remove FIXME
mattwala Jul 4, 2020
b51f070
Address another FIXME
mattwala Jul 4, 2020
087411c
Merge branch 'array-context' into 'array-context-tests'
mattwala Jul 4, 2020
d476b09
flake8 fix
mattwala Jul 4, 2020
c28247b
Merge branch 'array-context' into HEAD
mattwala Jul 4, 2020
56373b8
Apply 1 suggestion(s) to 1 file(s)
Jul 4, 2020
27c7922
Apply 1 suggestion(s) to 1 file(s)
Jul 4, 2020
fb062bb
remove partition_by_coarse
alexfikl Jul 4, 2020
58d0dfa
[ci skip] Rename default_vdot to structured_vdot
mattwala Jul 4, 2020
61b6220
Merge branch 'array-context-tests' into 'array-context'
mattwala Jul 4, 2020
ef9c1c4
Undo setup.cfg changes
mattwala Jul 4, 2020
c296c6d
Tweak setup.cfg
mattwala Jul 4, 2020
459f2f1
Undo changes to .gitlab-ci.yml
mattwala Jul 4, 2020
e08ec0e
Re-dangle Conda requirements files
mattwala Jul 4, 2020
15b7c8d
Fix CI failures on master due to recent Sumpy P2P API changes
mattwala Jul 5, 2020
10d1ed7
Merge branch 'track-sumpy-changes' into 'master'
mattwala Jul 5, 2020
3440900
Merge branch 'master' into array-context
mattwala Jul 5, 2020
a2a7273
Tweak comments in examples
mattwala Jul 6, 2020
0a298d9
Fix getting host array
mattwala Jul 6, 2020
db0a8c2
Fix naming to QBXFMMGeometryDataCodeContainer
mattwala Jul 6, 2020
f1d7193
Rename _FMMGeometryCodeContainer to _FMMGeometryDataCodeContainer
mattwala Jul 6, 2020
f1281a0
Update pytential/symbolic/execution.py
mattwala Jul 6, 2020
bdb3cf2
Remove too_slow_test_helmholtz.py
mattwala Jul 6, 2020
10c3787
Make an interleave_dof_arrays underscored method
mattwala Jul 6, 2020
ec9bdb1
Merge branch 'array-context' of https://github.com/inducer/pytential …
mattwala Jul 6, 2020
499ffc3
Delete DielectricSRep2DBoundaryOperator and DielectricSDRep2DBoundary…
mattwala Jul 8, 2020
90056c1
Move flatten() import to top of file, and don't use a separate
mattwala Jul 10, 2020
0c63898
pytential.source: Introduce _SumpyP2PMixin
mattwala Jul 10, 2020
a86f7a9
Fix incorrect parentheses placement
mattwala Jul 10, 2020
0f6471b
Re-dangle islpy back to master
inducer Jul 11, 2020
2fc4fb1
Move Apple CI to Github
inducer Jul 11, 2020
5fe6d92
Merge remote-tracking branch 'gitlab/array-context' into array-context
inducer Jul 11, 2020
ba588a6
Try mac CI with normal conda env without mac workarounds
inducer Jul 11, 2020
753a54a
mac CI: Try and install compiler from conda
inducer Jul 11, 2020
4e7f2db
Apply suggestions from @isuruf to fix Github Mac CI
inducer Jul 11, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove partition_by_coarse
alexfikl committed Jul 4, 2020
commit fb062bb3cf90659aa09ead912e71c1ac9f04c4a3
76 changes: 0 additions & 76 deletions pytential/linalg/proxy.py
Original file line number Diff line number Diff line change
@@ -50,13 +50,6 @@

# {{{ point index partitioning

def _element_node_range(group, ielement):
istart = group.node_nr_base + group.nunit_nodes * ielement
iend = group.node_nr_base + group.nunit_nodes * (ielement + 1)

return np.arange(istart, iend)


def partition_by_nodes(actx, discr, use_tree=True, max_nodes_in_box=None):
"""Generate equally sized ranges of nodes. The partition is created at the
lowest level of granularity, i.e. nodes. This results in balanced ranges
@@ -113,75 +106,6 @@ def partition_by_nodes(actx, discr, use_tree=True, max_nodes_in_box=None):
return BlockIndexRanges(actx.context,
actx.freeze(indices), actx.freeze(ranges))


def partition_from_coarse(actx, resampler, from_indices):
"""Generate a partition of nodes from an existing partition on a
coarser discretization. The new partition is generated based on element
refinement relationships in *resampler*, so the existing partition
needs to be created using :func:`partition_by_elements`,
since we assume that each range contains all the nodes in an element.

The new partition will have the same number of ranges as the old partition.
The nodes inside each range in the new partition are all the nodes in
*resampler.to_discr* that were refined from elements in the same
range from *resampler.from_discr*.

:arg resampler: a
:class:`meshmode.discretization.connection.DirectDiscretizationConnection`.
:arg from_indices: a :class:`sumpy.tools.BlockIndexRanges`.

:return: a :class:`sumpy.tools.BlockIndexRanges`.
"""

if not hasattr(resampler, "groups"):
raise ValueError("resampler must be a DirectDiscretizationConnection.")

from_indices = from_indices.get(actx.queue)

# construct ranges
from_discr = resampler.from_discr
from_grp_ranges = np.cumsum(
[0] + [grp.nelements for grp in from_discr.mesh.groups])
from_el_ranges = np.hstack([
np.arange(grp.node_nr_base, grp.ndofs + 1, grp.nunit_dofs)
for grp in from_discr.groups])

# construct coarse element arrays in each from_range
el_indices = np.empty(from_indices.nblocks, dtype=np.object)
el_ranges = np.full(from_grp_ranges[-1], -1, dtype=np.int)
for i in range(from_indices.nblocks):
ifrom = from_indices.block_indices(i)
el_indices[i] = np.unique(np.digitize(ifrom, from_el_ranges)) - 1
el_ranges[el_indices[i]] = i
el_indices = np.hstack(el_indices)

# construct lookup table
to_el_table = [np.full(g.nelements, -1, dtype=np.int)
for g in resampler.to_discr.groups]

for igrp, grp in enumerate(resampler.groups):
for batch in grp.batches:
to_el_table[igrp][actx.to_numpy(batch.to_element_indices)] = \
from_grp_ranges[igrp] + actx.to_numpy(batch.from_element_indices)

# construct fine node index list
indices = [np.empty(0, dtype=np.int)
for _ in range(from_indices.nblocks)]
for igrp in range(len(resampler.groups)):
to_element_indices = \
np.where(np.isin(to_el_table[igrp], el_indices))[0]

for i, j in zip(el_ranges[to_el_table[igrp][to_element_indices]],
to_element_indices):
indices[i] = np.hstack([indices[i],
_element_node_range(resampler.to_discr.groups[igrp], j)])

ranges = actx.from_numpy(np.cumsum([0] + [b.shape[0] for b in indices]))
indices = actx.from_numpy(np.hstack(indices))

return BlockIndexRanges(resampler.cl_context,
actx.freeze(indices), actx.freeze(ranges))

# }}}