Repository navigation
Conversation
bennoschoenstein
left a comment
There was a problem hiding this comment.
Thanks a lot! Exactly what I need 🗡️
|
@m-frey is there anything that is blocking this PR to move forward? |
2015e4c to
fadcf44
Compare
fadcf44 to
a797162
Compare
|
@isteinbrecher could you take a look at this implementation? |
| constraint_vector.sum_into_global_values(1, &constraintViolation, &rowId); | ||
| FOUR_C_ASSERT(Q_Ld.row_map().my_gid(row_id), | ||
| "Constraint equation row {} is not owned by this rank.", row_id); | ||
| Q_Ld.assemble(coefficient, row_id, dof_id); |
There was a problem hiding this comment.
Why is Q_dL not here any more?
There was a problem hiding this comment.
I removed it because in parallel the equation would have to write into rows that belong to another rank. I will put it back and make sure those entries reach the rank that owns the row.
| Q_dL_->complete(*n_condition_map_, stiff_ptr_->domain_map()); | ||
|
|
||
| // Q_dL = Q_Ld^T | ||
| Q_dL_ = Core::LinAlg::matrix_transpose(*Q_Ld_); |
There was a problem hiding this comment.
I get why you do this, but this is a change we don't want, as it restricts the design of the constraint evaluator. In general, a constraint can assemble into Q_dL_ and Q_Ld and the terms can be different.
No case covers this as of now, but we should not narrow the possible applications.
There was a problem hiding this comment.
Agreed. I will remove the transpose here, so the two can differ.
| // Turns floating point exceptions off while this object exists and restores them afterwards. | ||
| // Needed for the ArborX search: a rank without local boundary nodes is empty, which triggers a | ||
| // harmless 0/0. | ||
| class SuspendFloatingPointTrapping | ||
| { | ||
| public: | ||
| SuspendFloatingPointTrapping() | ||
| { | ||
| #ifdef FOUR_C_ENABLE_FE_TRAPPING | ||
| fedisableexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW); | ||
| #endif | ||
| } | ||
| ~SuspendFloatingPointTrapping() | ||
| { | ||
| #ifdef FOUR_C_ENABLE_FE_TRAPPING | ||
| feclearexcept(FE_ALL_EXCEPT); | ||
| fedisableexcept(FE_ALL_EXCEPT); | ||
| feenableexcept(previously_enabled_excepts_); | ||
| #endif | ||
| } | ||
| SuspendFloatingPointTrapping(const SuspendFloatingPointTrapping&) = delete; | ||
| SuspendFloatingPointTrapping& operator=(const SuspendFloatingPointTrapping&) = delete; | ||
|
|
||
| #ifdef FOUR_C_ENABLE_FE_TRAPPING | ||
| private: | ||
| const int previously_enabled_excepts_ = fegetexcept(); | ||
| #endif |
There was a problem hiding this comment.
This seems very fishy to me. Why not use our ArborX interface and if it does not cover this case, adapt the interface. This will be much cleaner than to fiddle with the floating point exceptions here.
There was a problem hiding this comment.
I have to agree with @isteinbrecher. This piece of code should not make it into main. It does not fix the actual problem.
There was a problem hiding this comment.
Done.
The fix is now in global_collision_search: a rank without primitives passes one dummy primitive, and its hits are removed from the results.
The guard in the constraint code is gone.
| @@ -150,9 +195,6 @@ Constraints::SubmodelEvaluator::RveMultiPointConstraintManager::RveMultiPointCon | |||
| *----------------------------------------------------------------------------*/ | |||
| void Constraints::SubmodelEvaluator::RveMultiPointConstraintManager::check_input() | |||
There was a problem hiding this comment.
The diff in this function is not easily readable. Can you please explain why there are so many changes needed here?
There was a problem hiding this comment.
I added comments at the specific locations. Let me know if that clarifies things.
|
@bennoschoenstein Can you please create an issue and describe the problem we encounter here? Thanks. |
Distributed pair search, one owner per constraint, dof lookup instead of ghosting.
Q_dL_ is an FE matrix now, so entries for dof rows owned by another rank are forwarded on complete() instead of deriving Q_dL as the transpose of Q_Ld.
ArborX handles ranks without primitives in the distributed tree since kokkos/ArborX#1404 (4C 4C-multiphysics#2353), which closes 4C-multiphysics#2340.
a0dde28 to
b0970ad
Compare
|
Rebased on current main and removed the dummy-primitive workaround, since #2353 fixes #2340. |
Did this fix your problem with the search? |
|
@isteinbrecher it fixed the problem described in #2340 when a rank is "empty". Is that what you mean with "search"? |
|
@bennoschoenstein Yep, thats what he means. |
|
@bennoschoenstein What is require to move forward with this PR (except for code review & approvals)? |

Description and Context
The periodic RVE boundary conditions in the constraint framework were
serial-only and aborted with a FOUR_C_THROW on more than one rank. This
enables them in parallel.
Changes:
(
global_collision_search) instead of a rank-local BVH query.four nodes of a constraint are locally available.
Q_dLand the residual from a distributed mat-vec, so no off-processor
assembly is needed.
Related Issues and Pull Requests