-
Notifications
You must be signed in to change notification settings - Fork 23
Multiple volumes #726
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
Multiple volumes #726
Conversation
mirgecom/artificial_viscosity.py
Outdated
| kappa=1., s0=-6., time=0, operator_states_quad=None, | ||
| grad_cv=None, quadrature_tag=None, boundary_kwargs=None, | ||
| kappa=1., s0=-6., time=0, quadrature_tag=DISCR_TAG_BASE, | ||
| volume_dd=DD_VOLUME_ALL, boundary_kwargs=None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete boundary_kwargs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't yet, some of the drivers still use it (isolator and nozzle).
mirgecom/artificial_viscosity.py
Outdated
| kappa=1., s0=-6., time=0, quadrature_tag=DISCR_TAG_BASE, | ||
| volume_dd=DD_VOLUME_ALL, boundary_kwargs=None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
quadrature_tag and volume_dd both contain a discretization tag.
You could do volume_dd=None and then allow (with a deprecation warning) a quadrature_tag to be passed, otherwise raise.
(Here and elsewhere.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we discussed elsewhere, the two discretization tags here are only sometimes redundant. I tried to remove those cases.
mirgecom/artificial_viscosity.py
Outdated
| dd_base = volume_dd | ||
| dd_vol = dd_base.with_discr_tag(quadrature_tag) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm getting myself confused on how dd_base, dd_vol, volume_dd are intended to be different. (Add a comment?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did my best to clarify the naming. I'm now using dd for the function parameters, checking that they're volumes where required, and then using dd_vol and dd_vol_quad internally for the base and quadrature discretizations, respectfully (and using the same naming scheme for other dds like bdry/allfaces and arrays).
mirgecom/artificial_viscosity.py
Outdated
| dd_allfaces = dd_trace.with_domain_tag( | ||
| replace(dd_trace.domain_tag, tag=FACE_RESTR_ALL)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is clunky. 🤷
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in inducer/grudge#280 with with_boundary_tag.
mirgecom/navierstokes.py
Outdated
| discr, gas_model, boundaries, state, *, time=0.0, | ||
| numerical_flux_func=num_flux_central, | ||
| quadrature_tag=DISCR_TAG_BASE, | ||
| quadrature_tag=DISCR_TAG_BASE, volume_dd=DD_VOLUME_ALL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra quadrature_tag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still needed.
mirgecom/navierstokes.py
Outdated
| discr, gas_model, boundaries, state, *, time=0.0, | ||
| numerical_flux_func=num_flux_central, | ||
| quadrature_tag=DISCR_TAG_BASE, | ||
| quadrature_tag=DISCR_TAG_BASE, volume_dd=DD_VOLUME_ALL, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra quadrature_tag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still needed.
| inviscid_numerical_flux_func=inviscid_facial_flux_rusanov, | ||
| gradient_numerical_flux_func=num_flux_central, | ||
| viscous_numerical_flux_func=viscous_facial_flux_central, | ||
| quadrature_tag=DISCR_TAG_BASE, return_gradients=False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra quadrature_tag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still needed.
mirgecom/simutil.py
Outdated
| from meshmode.distributed import get_partition_by_pymetis | ||
| return get_partition_by_pymetis(mesh, num_ranks) | ||
|
|
||
| if comm.Get_rank() == 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all looks pretty bureaucratic. Can we do this in grudge/meshmode? What's the background to this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed from this PR (still need to figure out how to clean it up, but we'll worry about that later.)
| domain_boundary_states, grad_cv, interior_grad_cv_pairs, | ||
| grad_t, interior_grad_t_pairs, quadrature_tag=None, | ||
| numerical_flux_func=viscous_facial_flux_central, time=0.0): | ||
| grad_t, interior_grad_t_pairs, quadrature_tag=DISCR_TAG_BASE, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extra quadrature_tag
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still needed.
3109bca to
faf3717
Compare
7200ebb to
c0780b8
Compare
|
@matthiasdiener @inducer Am I correct in guessing that the current MPI communication tagging strategy isn't guaranteed to work when you call the same operator multiple times in a single compiled function? I ran into some trouble with the example I just set up (multiple-volumes.py), which creates multiple copies of the same mesh with different initial conditions and calls |
I know I wasn't asked, but what about doing something like:
... after making those comm tags importable classes? That way the driver writer can override or pass different tags if needed/wanted? |
I guess so, but it would be nice if we didn't have to do that... That version would also leave me with some (admittedly self-inflicted) challenges, since I made the number of volumes in that example a parameter. 🙂 |
5eaf339 to
87339e5
Compare
87339e5 to
1d235ee
Compare
|
Ready for review again. I'm going to let the production CI fail until this gets pretty close to being ready to merge (and I think the doc CI will fail until inducer/grudge#280 goes in). |
|
The doc CI failures are one thing getting in the way of merging this into main at the moment. @matthiasdiener and I looked at this a couple of weeks ago, and IIRC the conclusion was that it seems to be pulling doc references from grudge main, not the multi-volume branch. Maybe there's a way to work around this? |
75aad74 to
3dfca1b
Compare
examples/multiple-volumes-mpi.py
Outdated
| make_fluid_state | ||
| ) | ||
| from logpyle import IntervalTimer, set_dt | ||
| from mirgecom.euler import extract_vars_for_logging |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should group this import above. There are a couple that need grouping.
Extracted out of #630. Depends on inducer/grudge#246 and inducer/meshmode#342.
Questions for the review @lukeolson:
dcoll,BoundaryDomainTag(from grudge multi-volume), adding a dof descriptordd, promoting the boundary tags.multiple-volumes-mpi.pyto check this off.u=xandu=yon vol 1 and 2, resp, to close this box: https://github.com/illinois-ceesd/mirgecom/pull/726/files#diff-a711e4a672e5ea17608d8536895c9a666557a0872b0b23b2e3f3809874898dfbR91