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

Initial changes to enable TP elements to pass through xform chain #6

Draft
wants to merge 44 commits into
base: production
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
61a6cac
CHERRY-PICK: SingleGridPytatoArrayContext
kaushikcfd Mar 12, 2022
38e5b0e
Adds more pytato utils: Axes types unification
kaushikcfd Mar 12, 2022
6283a35
Implements FusionContractorArrayContext
kaushikcfd Mar 12, 2022
46c7302
adds feinsum, kanren to deps
kaushikcfd Mar 12, 2022
faaeff1
add missing get_cache_key to _IndirectionMapRecorder
majosm Nov 15, 2022
de7d1b8
Add missing `get_cache_key` to `_IndirectionMapRecorder`
kaushikcfd Nov 15, 2022
5c33900
rearrange Einsum args
majosm Nov 3, 2022
5ed7ea7
Rearrange `Einsum` args
kaushikcfd Nov 15, 2022
a162485
add mpi_distribute
majosm Mar 16, 2022
2b2e4d9
add type hints to mpi_distribute
majosm Jun 29, 2022
9cc9f1c
Merge branch 'mpi-distribute' into production
majosm Jan 11, 2023
431dbe6
make compatible with new distributed DAG partitioner
majosm Jan 19, 2023
f9aec10
Merge branch 'dist-mem-part-2000-compatible' into production
majosm Jan 19, 2023
f1f2e22
attempt to fix an empty mesh issue
majosm Sep 22, 2022
db3ea10
more verbose debug
matthiasdiener May 1, 2023
fbd81e4
Merge pull request #3 from matthiasdiener/verb
majosm May 2, 2023
8146de8
disable offending assertion
majosm May 8, 2023
fcfa178
add axes for reshapes, etc. in direction connection
majosm May 25, 2023
2837ab6
Merge branch 'main' into production-mrgup
MTCam Jun 27, 2023
80a1c9a
Merge branch 'main' into mrgup
MTCam Jun 30, 2023
00fdc66
Merge branch 'main' into production-pilot
MTCam Jul 31, 2023
4a56b6d
Merge branch 'main' into production-pilot
MTCam Aug 14, 2023
5974d6c
Merge branch 'main' into production-pilot
MTCam Sep 6, 2023
353fd25
Add some diagnostic checks to ferret out loop-nest errors.
MTCam Sep 7, 2023
5689add
Add a quick timer for gmsh mesh construction
MTCam Sep 12, 2023
970f387
Merge remote-tracking branch 'origin/production-pilot' into productio…
MTCam Sep 12, 2023
31c7029
Merge branch 'main' into production-pilot
MTCam Sep 18, 2023
1bfa3e1
use immutabledict instead of pyrsistent, immutabels
matthiasdiener Oct 9, 2023
4887dd6
Woops, reading mesh twice.
MTCam Oct 16, 2023
2fc3ef9
Merge branch 'main' into production-pilot
MTCam Oct 26, 2023
116faa8
Merge branch 'production-pilot' into production
MTCam Oct 26, 2023
9392ac7
Merge branch 'main' into production-pilot
MTCam Nov 1, 2023
2887d37
enable length-1 loop removal workaround in loopy's precompute_for_sin…
majosm Nov 2, 2023
ccea29f
Merge branch 'main' into production-pilot
MTCam Nov 29, 2023
cde0db1
remove calls to Einsum.__init__ (loses CreatedAt tags)
majosm Jan 26, 2024
f5250be
Merge pull request #4 from majosm/remove-einsum-init
majosm Jan 26, 2024
8011592
make array context fallbacks optional (disabled by default)
majosm Feb 23, 2024
3e5c7d5
Merge branch 'main' into production-pilot
MTCam Mar 6, 2024
5a274f7
Merge branch 'main' into production-pilot
MTCam Mar 24, 2024
01d488e
Merge branch 'main' into production-pilot
MTCam Apr 10, 2024
f517693
Merge branch 'main' into production-pilot
MTCam Apr 18, 2024
ec11c32
Initial changes to enable TP elements to pass through xform chain
a-alveyblanc Apr 23, 2024
a24f1c4
Merge branch 'production' of https://github.com/illinois-ceesd/meshmo…
a-alveyblanc Apr 24, 2024
6cafe8e
TP update
a-alveyblanc Apr 29, 2024
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
36 changes: 20 additions & 16 deletions examples/simple-dg.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@

from meshmode.array_context import PyOpenCLArrayContext, PytatoPyOpenCLArrayContext
from meshmode.dof_array import DOFArray, flat_norm
from meshmode.array_context import (PyOpenCLArrayContext,
SingleGridWorkBalancingPytatoArrayContext as PytatoPyOpenCLArrayContext)
from arraycontext import (
ArrayContainer,
map_array_container,
with_container_arithmetic,
dataclass_array_container,
)
from meshmode.mesh import BTAG_ALL, BTAG_NONE # noqa
from meshmode.transform_metadata import FirstAxisIsElementsTag

Expand Down Expand Up @@ -455,11 +463,10 @@ def main(lazy=False):

cl_ctx = cl.create_some_context()
queue = cl.CommandQueue(cl_ctx)
actx_outer = PyOpenCLArrayContext(queue, force_device_scalars=True)
if lazy:
actx_rhs = PytatoPyOpenCLArrayContext(queue)
actx = PytatoPyOpenCLArrayContext(queue)
else:
actx_rhs = actx_outer
actx = PyOpenCLArrayContext(queue, force_device_scalars=True)

nel_1d = 16
from meshmode.mesh.generation import generate_regular_rect_mesh
Expand All @@ -475,45 +482,42 @@ def main(lazy=False):

logger.info("%d elements", mesh.nelements)

discr = DGDiscretization(actx_outer, mesh, order=order)
discr = DGDiscretization(actx, mesh, order=order)

fields = WaveState(
u=bump(actx_outer, discr),
v=make_obj_array([discr.zeros(actx_outer) for i in range(discr.dim)]),
u=bump(actx, discr),
v=make_obj_array([discr.zeros(actx) for i in range(discr.dim)]),
)

from meshmode.discretization.visualization import make_visualizer
vis = make_visualizer(actx_outer, discr.volume_discr)
vis = make_visualizer(actx, discr.volume_discr)

def rhs(t, q):
return wave_operator(actx_rhs, discr, c=1, q=q)

compiled_rhs = actx_rhs.compile(rhs)
return wave_operator(actx, discr, c=1, q=q)

def rhs_wrapper(t, q):
r = compiled_rhs(t, actx_rhs.thaw(actx_outer.freeze(q)))
return actx_outer.thaw(actx_rhs.freeze(r))
compiled_rhs = actx.compile(rhs)

t = np.float64(0)
t_final = 3
istep = 0
while t < t_final:
fields = rk4_step(fields, t, dt, rhs_wrapper)
fields = actx.thaw(actx.freeze(fields,))
fields = rk4_step(fields, t, dt, compiled_rhs)

if istep % 10 == 0:
# FIXME: Maybe an integral function to go with the
# DOFArray would be nice?
assert len(fields.u) == 1
logger.info("[%05d] t %.5e / %.5e norm %.5e",
istep, t, t_final, actx_outer.to_numpy(flat_norm(fields.u, 2)))
istep, t, t_final, actx.to_numpy(flat_norm(fields.u, 2)))
vis.write_vtk_file("fld-wave-min-%04d.vtu" % istep, [
("q", fields),
])

t += dt
istep += 1

assert flat_norm(fields.u, 2) < 100
assert actx.to_numpy(flat_norm(fields.u, 2)) < 100


if __name__ == "__main__":
Expand Down
Loading
Loading