Skip to content

Commit

Permalink
deprecate mpi_communicator argument in create_discretization_collection
Browse files Browse the repository at this point in the history
  • Loading branch information
majosm committed Aug 25, 2022
1 parent 826cfb6 commit cfad592
Show file tree
Hide file tree
Showing 14 changed files with 21 additions and 40 deletions.
6 changes: 2 additions & 4 deletions examples/autoignition-mpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,7 @@ def main(actx_class, ctx_factory=cl.create_some_context, use_logmgr=True,
generate_mesh)
local_nelements = local_mesh.nelements

dcoll = create_discretization_collection(actx, local_mesh, order=order,
mpi_communicator=comm)
dcoll = create_discretization_collection(actx, local_mesh, order=order)
nodes = actx.thaw(dcoll.nodes())
ones = dcoll.zeros(actx) + 1.0

Expand Down Expand Up @@ -320,8 +319,7 @@ def get_fluid_state(cv, tseed):
else:
rst_cv = restart_data["cv"]
old_dcoll = \
create_discretization_collection(actx, local_mesh, order=rst_order,
mpi_communicator=comm)
create_discretization_collection(actx, local_mesh, order=rst_order)
from meshmode.discretization.connection import make_same_mesh_connection
connection = make_same_mesh_connection(actx, dcoll.discr_from_dd("vol"),
old_dcoll.discr_from_dd("vol"))
Expand Down
3 changes: 1 addition & 2 deletions examples/doublemach-mpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,7 @@ def main(ctx_factory=cl.create_some_context, use_logmgr=True,

from mirgecom.discretization import create_discretization_collection
order = 3
dcoll = create_discretization_collection(actx, local_mesh, order=order,
mpi_communicator=comm)
dcoll = create_discretization_collection(actx, local_mesh, order=order)
nodes = actx.thaw(dcoll.nodes())

from grudge.dof_desc import DISCR_TAG_QUAD
Expand Down
3 changes: 1 addition & 2 deletions examples/heat-source-mpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ def main(actx_class, ctx_factory=cl.create_some_context, use_logmgr=True,

order = 3

dcoll = create_discretization_collection(actx, local_mesh, order=order,
mpi_communicator=comm)
dcoll = create_discretization_collection(actx, local_mesh, order=order)

if dim == 2:
# no deep meaning here, just a fudge factor
Expand Down
4 changes: 1 addition & 3 deletions examples/hotplate-mpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,7 @@ def main(ctx_factory=cl.create_some_context, use_logmgr=True,
local_nelements = local_mesh.nelements

order = 1
dcoll = create_discretization_collection(
actx, local_mesh, order=order, mpi_communicator=comm
)
dcoll = create_discretization_collection(actx, local_mesh, order=order)
nodes = actx.thaw(dcoll.nodes())

if logmgr:
Expand Down
4 changes: 1 addition & 3 deletions examples/lump-mpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,7 @@ def main(actx_class, ctx_factory=cl.create_some_context, use_logmgr=True,
local_nelements = local_mesh.nelements

order = 3
dcoll = create_discretization_collection(
actx, local_mesh, order=order, mpi_communicator=comm
)
dcoll = create_discretization_collection(actx, local_mesh, order=order)
nodes = actx.thaw(dcoll.nodes())

vis_timer = None
Expand Down
4 changes: 1 addition & 3 deletions examples/mixture-mpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,7 @@ def main(actx_class, ctx_factory=cl.create_some_context, use_logmgr=True,
local_nelements = local_mesh.nelements

order = 3
dcoll = create_discretization_collection(
actx, local_mesh, order=order, mpi_communicator=comm
)
dcoll = create_discretization_collection(actx, local_mesh, order=order)
nodes = actx.thaw(dcoll.nodes())

vis_timer = None
Expand Down
4 changes: 1 addition & 3 deletions examples/nsmix-mpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,7 @@ def main(ctx_factory=cl.create_some_context, use_logmgr=True,
local_nelements = local_mesh.nelements

order = 1
dcoll = create_discretization_collection(
actx, local_mesh, order=order, mpi_communicator=comm
)
dcoll = create_discretization_collection(actx, local_mesh, order=order)
nodes = actx.thaw(dcoll.nodes())
ones = dcoll.zeros(actx) + 1.0

Expand Down
4 changes: 1 addition & 3 deletions examples/poiseuille-mpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,7 @@ def main(ctx_factory=cl.create_some_context, use_logmgr=True,
local_nelements = local_mesh.nelements

order = 2
dcoll = create_discretization_collection(
actx, local_mesh, order=order, mpi_communicator=comm
)
dcoll = create_discretization_collection(actx, local_mesh, order=order)
nodes = actx.thaw(dcoll.nodes())

if use_overintegration:
Expand Down
4 changes: 1 addition & 3 deletions examples/pulse-mpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,7 @@ def main(actx_class, ctx_factory=cl.create_some_context, use_logmgr=True,
local_nelements = local_mesh.nelements

order = 1
dcoll = create_discretization_collection(
actx, local_mesh, order=order, mpi_communicator=comm
)
dcoll = create_discretization_collection(actx, local_mesh, order=order)
nodes = actx.thaw(dcoll.nodes())

if use_overintegration:
Expand Down
4 changes: 1 addition & 3 deletions examples/scalar-lump-mpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,7 @@ def main(actx_class, ctx_factory=cl.create_some_context, use_logmgr=True,
local_nelements = local_mesh.nelements

order = 3
dcoll = create_discretization_collection(
actx, local_mesh, order=order, mpi_communicator=comm
)
dcoll = create_discretization_collection(actx, local_mesh, order=order)
nodes = actx.thaw(dcoll.nodes())

vis_timer = None
Expand Down
4 changes: 1 addition & 3 deletions examples/sod-mpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,7 @@ def main(actx_class, ctx_factory=cl.create_some_context, use_logmgr=True,
local_nelements = local_mesh.nelements

order = 1
dcoll = create_discretization_collection(
actx, local_mesh, order=order, mpi_communicator=comm
)
dcoll = create_discretization_collection(actx, local_mesh, order=order)
nodes = actx.thaw(dcoll.nodes())

vis_timer = None
Expand Down
4 changes: 1 addition & 3 deletions examples/vortex-mpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,7 @@ def main(actx_class, ctx_factory=cl.create_some_context, use_logmgr=True,
local_nelements = local_mesh.nelements

order = 3
dcoll = create_discretization_collection(
actx, local_mesh, order=order, mpi_communicator=comm
)
dcoll = create_discretization_collection(actx, local_mesh, order=order)
nodes = actx.thaw(dcoll.nodes())

vis_timer = None
Expand Down
7 changes: 2 additions & 5 deletions examples/wave-mpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,7 @@ def main(actx_class, snapshot_pattern="wave-mpi-{step:04d}-{rank:04d}.pkl",

order = 3

dcoll = create_discretization_collection(
actx, local_mesh, order=order, mpi_communicator=comm
)
dcoll = create_discretization_collection(actx, local_mesh, order=order)
nodes = actx.thaw(dcoll.nodes())

current_cfl = 0.485
Expand Down Expand Up @@ -161,8 +159,7 @@ def main(actx_class, snapshot_pattern="wave-mpi-{step:04d}-{rank:04d}.pkl",
old_order = restart_data["order"]
if old_order != order:
old_dcoll = create_discretization_collection(
actx, local_mesh, order=old_order, mpi_communicator=comm
)
actx, local_mesh, order=old_order)
from meshmode.discretization.connection import make_same_mesh_connection
connection = make_same_mesh_connection(actx, dcoll.discr_from_dd("vol"),
old_dcoll.discr_from_dd("vol"))
Expand Down
6 changes: 6 additions & 0 deletions mirgecom/discretization.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@
def create_discretization_collection(actx, volume_meshes, order, *,
mpi_communicator=None, quadrature_order=-1):
"""Create and return a grudge DG discretization collection."""
if mpi_communicator is not None:
from warnings import warn
warn(
"mpi_communicator argument is deprecated and will disappear in Q4 2022.",
DeprecationWarning, stacklevel=2)

from grudge.dof_desc import DISCR_TAG_BASE, DISCR_TAG_QUAD
from grudge.discretization import make_discretization_collection
from meshmode.discretization.poly_element import (
Expand Down

0 comments on commit cfad592

Please sign in to comment.