Skip some operations in interior parents computation#4358
Conversation
|
FYI @jwpeterson . |
So ... ex falso? It's not used as often as for side elements, but we set the I'd like to see a test case that this speeds up, though; maybe there's some other way to accomplish that. |
d4a36c8 to
1abd1ce
Compare
Thanks for pointing this out, I have updated some of the comments in my commits.
Here are a couple of screenshots of a model we are interested in (static structural). You can see that it contains many (0D) nodeelems because of all the RBE3 connections plotted in blue. I profiled the mesh stitching time (14 mins), of which 5:45 mins are spent in I also pushed one last commit to be able to completely disable the computation of interior parents, |
|
Job Coverage on 1abd1ce : invalidated by @jwpeterson We had to retarget this PR from master -> devel, I think that may have confused the Coverage job so I'm invalidating it. |
@roystgnr I think @leonardo-mutti-aks was referring specifically to these lines in Lines 1993 to 1999 in 3463d95 In that function at least, we do require the interior parent that we detect to be exactly one dimension higher. Does this mean that My other comment here, after reviewing Lines 2020 to 2041 in 3463d95 In the test case mentioned on this ticket, I verified we spend about 332 of the 802 total seconds in So, given that we aren't currently getting useful interior parents for NodeElems, and we are also spending a lot of time doing so, adding an option to skip it completely like in this PR is reasonable, IMO. I also think that |
Rebased-by: John Peterson <jwpeterson@gmail.com>
…there aren't. Improve the wording of some comments.
1abd1ce to
48a72bb
Compare
…ugging * Move MeshBase::Preparation::operator== to .C file to simplify debugging * Move MeshBase::Preparation::operator bool to .C file to simplify debugging * Mark MeshBase::Preparation::operator bool() explicit * Add MeshBase::Preparation::operator!= implemented in terms of operator== * Move Preparation::operator= to .C file * Move MeshBase::Preparation initialization code to constructor in .C file
…:detect_interior_parents()
Ideally, yeah. In practice, so long as someone is adding edges constructed via
That's painful to see, yeah.
You're probably right, I'd just like to know it was the last resort. Would it be possible to programmatically generate some mesh (maybe the complete graph on N vertices, with NodeElem and Edge2?) that makes it easy to replicate the performance problem? |
|
The MOOSE ARM mac failures appear to be segfaults (Exit Code: -11) but I think they are architecture-specific, and not related to this PR. |
I think I can probably just send you the final stitched mesh from this example if you want it? @leonardo-mutti-aks found in some earlier exploratory profiling that most of the time is spent in building the "node to elem map", which happens at the beginning of the This profiling is a bit too fine-grained to draw a lot of conclusions from (it was logging every map insertion, for example) but I do think that simply building the node to elem map probably dominates the time spent in So, I think (in addition to making |
|
Job Test MOOSE ARM mac on 5811bf3 : invalidated by @jwpeterson Only one ray_tracing test failed, retry to see if it goes away. |
Yeah, would you?
Oh, this is actually something I've been looking at due to other ridiculously-redundant calls from massive stitching operations. Have you tried setting the new (well, 6 month old) |
Sent a Google Drive link over IM.
I have not tried this, but I guess it could probably help us in this case. Unfortunately, we are blocked from updating libmesh at the moment due to the serial-to-parallel restart issue that we discussed over slack previously. I am in the process of testing a workround (0a2d85f), but there seems to sill be some issues with that. It would be good if we could come up with a "real" fix, since I will need to do a libmesh update soon in order to pull in the changes from this PR as well... |
|
The tests all passed except for that one MOOSE ARM mac test failure that I don't think is related to this PR. Hence, I will go ahead and merge this, since @leonardo-mutti-aks has been waiting patiently since December for me to work on it 😓 |



Given that an interior parent
pof an elementelmust satisfyp.dim() == el.dim() + 1,we can skip some computations in
MeshBase::detect_interior_parents():elsuch that there is nopwithp.dim() == el.dim() + 1,pif there is noelwithel.dim() == p.dim() - 1.In models with many elements, especially building the node-to-elem map can be a bottleneck,
so optimization 2 may help easing the computational effort.