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

Adaptivity + Stateful Materials + Repartitioning #4532

Closed
permcody opened this issue Jan 14, 2015 · 6 comments · Fixed by #23603
Closed

Adaptivity + Stateful Materials + Repartitioning #4532

permcody opened this issue Jan 14, 2015 · 6 comments · Fixed by #23603
Assignees
Labels
C: Framework P: normal A defect affecting operation with a low possibility of significantly affects. T: task An enhancement to the software.

Comments

@permcody
Copy link
Member

Right now we can do any 2 of 3 of these things. We need to be able to marshal and communicate our material properties when the mesh is repartitioned. Our current idea is to rekey our material property database on libMesh's "unique_id" instead of elem pointers.

Note: Material data types are templated so users can use any type they want. dataLoad() and dataStore() must be implemented for every type used as a Material property.

@permcody permcody added C: Framework T: task An enhancement to the software. P: normal A defect affecting operation with a low possibility of significantly affects. labels Jan 14, 2015
@permcody
Copy link
Member Author

Found a test that is now tripping an assert 100% of the time when running on certain numbers of processors.

stateful_adaptivity_test.i fails with n_cpus = 3:
Assertion `props().contains(child_elem)' failed
Child element pointer is not in the MaterialProps data structure
at /Users/permcj/projects/moose/framework/src/materials/MaterialPropertyStorage.C, line 224

This assertion was only recently added as a sanity check here:
#4641

@friedmud
Copy link
Contributor

Just to be clear: this is failing in the PR... right? Or do you mean that it is failing all the time (like with the current HEAD)?

@permcody
Copy link
Member Author

This is only failing with the PR. I thought it was head but I was mistaken.

@rwcarlsen
Copy link
Contributor

@roystgnr - where would I need to be poking around in libMesh to see how to transfer stateful material properties between processes upon repartitioning? Is there a pattern that you could point me toward that I could follow - e.g. like how elements are sent between processes?

@roystgnr
Copy link
Contributor

roystgnr commented Mar 23, 2017 via email

@friedmud
Copy link
Contributor

friedmud commented Mar 23, 2017

We currently index stateful data based on Elem pointers... that needs to change to indexing based on Elem::unique_id.

All of the stateful data is already serializable and can be sent as std::string. @permcody already knows how to do that and can show you.

After the adaptivity system has done its thing you can go over the local active elements and look for any that have missing stateful data. There'll then need to be a broadcast where all procs ask for stateful data they are missing. Everyone can receive the lists and then look through their own stateful data (based on unique_id) and find data that needs to be sent out. They can then serialize it and ship it.

roystgnr added a commit to roystgnr/moose that referenced this issue Aug 17, 2017
Otherwise we hit a "no Stateful Materials with Adaptivity and
DistributedMesh" warning, presumably due to issue idaholab#4532.
jarons pushed a commit to jarons/moose that referenced this issue Oct 5, 2017
Otherwise we hit a "no Stateful Materials with Adaptivity and
DistributedMesh" warning, presumably due to issue idaholab#4532.
roystgnr added a commit to roystgnr/moose that referenced this issue Jan 11, 2023
There are a number of places in the code and in input files where
partitioning can be disabled, and just reporting "Partitioner: metis" is
misleading if we're not actually using the partitioner.

Refs idaholab#4532, for which I'm currently stripping the third layer of
partitioning-disabling workaround off a test case...
roystgnr added a commit to roystgnr/moose that referenced this issue Feb 28, 2023
This is enough to solve idaholab#4532 for me.  With these changes we should no
longer be automatically using workarounds instead.  I'll fix up the
regression tests where we were manually using workarounds too.
roystgnr added a commit to roystgnr/moose that referenced this issue Mar 2, 2023
* Improvements to mesh redistribution

  * `ReplicatedMesh` and serialized `DistributedMesh` objects now also
    call `GhostingFunctor::redistribute()` callbacks (enabling
    communication of distributed data like MOOSE stateful materials on
    top of replicated mesh data).
  * GhostingFunctor code now supports (in deprecated builds) less
    strict behavior from subclasses.
  * Redundant calls to `redistribute()` in special cases have been
    combined.
  * `scatter_constraints()` now uses a more optimal data structure.
  * `send_coarse_ghosts()` and `redistribute()` now use the NBX
    parallel synchronization algorithm.  These had been the last two
    distributed algorithms in libMesh using older less-scalable
    MPI techniques.
  * Bug fix: in some use cases (including MOOSE applications using
    mesh refinement) libMesh could fail to properly synchronize
    changing nodeset definitions

* Side boundary ids now be set on child elements, not just coarse mesh
  elements, allowing for adaptive refinement of sidesets.
* Clearer error messages are now printed when a `parallel_only`
  assertion is failed.
* `subdomain_id` has been added to output when printing `Elem` info.
* `send_list` data is now properly prepared in all use cases.  This
  fixes Geometric MultiGrid compatibility with PETSc 3.18, and may
  give slight performance improvements elsewhere.
* A `System::has_constraint_object()` query API has been added.
* Bug fixes for msys2 / Windows builds, TIMPI `set_union` of maps with
  inconsistent values assigned to the same key, packed-range
  communication of pairs with fixed-size data and padding bytes.

Refs #000

This is also a prerequisite to the fixes for idaholab#4532
roystgnr added a commit to roystgnr/moose that referenced this issue Mar 2, 2023
* Improvements to mesh redistribution

  * `ReplicatedMesh` and serialized `DistributedMesh` objects now also
    call `GhostingFunctor::redistribute()` callbacks (enabling
    communication of distributed data like MOOSE stateful materials on
    top of replicated mesh data).
  * GhostingFunctor code now supports (in deprecated builds) less
    strict behavior from subclasses.
  * Redundant calls to `redistribute()` in special cases have been
    combined.
  * `scatter_constraints()` now uses a more optimal data structure.
  * `send_coarse_ghosts()` and `redistribute()` now use the NBX
    parallel synchronization algorithm.  These had been the last two
    distributed algorithms in libMesh using older less-scalable
    MPI techniques.
  * Bug fix: in some use cases (including MOOSE applications using
    mesh refinement) libMesh could fail to properly synchronize
    changing nodeset definitions

* Side boundary ids now be set on child elements, not just coarse mesh
  elements, allowing for adaptive refinement of sidesets.
* Clearer error messages are now printed when a `parallel_only`
  assertion is failed.
* `subdomain_id` has been added to output when printing `Elem` info.
* `send_list` data is now properly prepared in all use cases.  This
  fixes Geometric MultiGrid compatibility with PETSc 3.18, and may
  give slight performance improvements elsewhere.
* A `System::has_constraint_object()` query API has been added.
* Bug fixes for msys2 / Windows builds, TIMPI `set_union` of maps with
  inconsistent values assigned to the same key, packed-range
  communication of pairs with fixed-size data and padding bytes.

Refs #000

This is also a prerequisite to the fixes for idaholab#4532
roystgnr added a commit to roystgnr/moose that referenced this issue Mar 4, 2023
This is enough to solve idaholab#4532 for me.  With these changes we should no
longer be automatically using workarounds instead.  I'll fix up the
regression tests where we were manually using workarounds too.
roystgnr added a commit to roystgnr/moose that referenced this issue Mar 4, 2023
This is enough to solve idaholab#4532 for me.  With these changes we should no
longer be automatically using workarounds instead.  I'll fix up the
regression tests where we were manually using workarounds too.
roystgnr added a commit to roystgnr/moose that referenced this issue Apr 4, 2023
This is enough to solve idaholab#4532 for me.  With these changes we should no
longer be automatically using workarounds instead.  I'll fix up the
regression tests where we were manually using workarounds too.
roystgnr added a commit to roystgnr/moose that referenced this issue Apr 14, 2023
This is enough to solve idaholab#4532 for me.  With these changes we should no
longer be automatically using workarounds instead.  I'll fix up the
regression tests where we were manually using workarounds too.
roystgnr added a commit to roystgnr/moose that referenced this issue Apr 14, 2023
This is enough to solve idaholab#4532 for me.  With these changes we should no
longer be automatically using workarounds instead.  I'll fix up the
regression tests where we were manually using workarounds too.
roystgnr added a commit to roystgnr/moose that referenced this issue Apr 19, 2023
We're on a new subdomain now; it *doesn't* necessarily have the
properties the old one did.

This fixes assertion failures in idaholab#23603 code for me - hopefully with
this we *really* have closed idaholab#4532
maxnezdyur pushed a commit to maxnezdyur/moose that referenced this issue Apr 20, 2023
This is enough to solve idaholab#4532 for me.  With these changes we should no
longer be automatically using workarounds instead.  I'll fix up the
regression tests where we were manually using workarounds too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: Framework P: normal A defect affecting operation with a low possibility of significantly affects. T: task An enhancement to the software.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants