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

Overset intergrid boundary and hole search #597

Open
wants to merge 16 commits into
base: develop
Choose a base branch
from
Open

Overset intergrid boundary and hole search #597

wants to merge 16 commits into from

Conversation

jbakosi
Copy link
Member

@jbakosi jbakosi commented Nov 29, 2023

Overset intergrid boundary and hole search


This change is Reviewable

This adds tagging OversetFE::m_uc with 2.0 values for holes on bg mesh
cut out by an overset mesh, specified by the intergrid surface. See
regression test for details, which also was updated since the m_uc
changes.
The idea is that the surface integral \int v dot n dA will evaluate to
4 pi for a point inside the surface (independent of the surface) and to
zero outside where

v = [ (x-xp)/r^3, (y-yp)/r^3, (z-zp)/r^3 ]
r = sqrt[ (x-xp)^2 + (y-yp)^2 + (z-zp)^2 ]

where [xp,yp,zp] is the point in question and [x,y,z] is a point of the
surface element dA (the triangle centroid is used).
Copy link
Member

@adityakpandare adityakpandare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great work @jbakosi! Thank you! A couple of comments below.

Reviewable status: 0 of 24 files reviewed, 2 unresolved discussions (waiting on @jbakosi)


src/Inciter/OversetFE.cpp line 219 at r1 (raw file):

  }

  for (std::size_t e=0; e<inpoel.size()/4; e++) {

Can we invert this set of loops? i.e. loop over points in bp and flag elements surrounding these points using esup.


src/Inciter/OversetFE.cpp line 923 at r1 (raw file):

          if (blid == 103) {
            for (auto i : ndset) m_uc(i,iflag) = 1.0;
          }

We should now be able to remove this hard coding, since setupIntergridBoundaries() sets up these flags automatically (not based on blid==103 hardcoded.

@jbakosi jbakosi changed the title M4 Overset intergrid boundary and hole search Dec 1, 2023
Copy link
Member Author

@jbakosi jbakosi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 24 files reviewed, 2 unresolved discussions (waiting on @adityakpandare)


src/Inciter/OversetFE.cpp line 219 at r1 (raw file):

Previously, adityakpandare (Aditya Pandare) wrote…

Can we invert this set of loops? i.e. loop over points in bp and flag elements surrounding these points using esup.

Now that I think about this more, I'm not sure if exchanging the loops is clearly better.

If the outer loop is over the set of already-tagged points (in bp), we now need to look in psup to see what edges are connected to the points in bp. That needs the data structure psup first, generated for the full mesh. This is not stored by default. We could store it and then that would be the price. There is always a price of course. Which one is better, only a measurement can decide.

@jbakosi
Copy link
Member Author

jbakosi commented Jan 9, 2024

@adityakpandare I think is ready to merge - after a final look. Thanks for the help with this.

Copy link
Member

@adityakpandare adityakpandare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @jbakosi. The CI ran into the following problems:

  1. The asynclogic_oversetfe tests fails with Exception: Quiescence or another error detected. I am sending the stack trace to your email presently.
  2. All the builds (gnu, intel, release, debug) hang because one of the asynclogic_oversetfe tests deadlocks.
  3. clang throws the following compile-time warnings (-Werror):
src/Inciter/Transporter.cpp:515:66: error: implicit conversion loses integer precision:
'unsigned long' to 'std::unordered_set<int, std::hash<int>, std::equal_to<int>, std::allocator<int>>::value_type' (aka 'int')
[-Werror,-Wshorten-64-to-32]

   for (const auto& ibs : ib) for (auto s : ibs) usedsets.insert( s );
                                                          ~~~~~~  ^
src/Inciter/Discretization.cpp:489:27: error: implicit conversion changes signedness:
'std::tuple_element<0, const std::pair<const int, std::vector<unsigned long, std::allocator<unsigned long>>>>::type' (aka 'const int')
to 'const std::unordered_set<unsigned long, std::hash<unsigned long>, std::equal_to<unsigned long>, std::allocator<unsigned long>>::key_type' (aka 'const unsigned long')
[-Werror,-Wsign-conversion]

             if ( is.count(setid) ) {
                     ~~~~~ ^~~~~

src/Inciter/OversetFE.cpp:187:19: error: implicit conversion changes signedness:
'std::tuple_element<0, const std::pair<const int, std::vector<unsigned long, std::allocator<unsigned long>>>>::type' (aka 'const int')
to 'const std::unordered_set<unsigned long, std::hash<unsigned long>, std::equal_to<unsigned long>, std::allocator<unsigned long>>::key_type' (aka 'const unsigned long')
[-Werror,-Wsign-conversion]

     if ( is.count(setid) ) {
             ~~~~~ ^~~~~

src/Inciter/OversetFE.cpp:288:15: error: unused variable 'ib' [-Werror,-Wunused-variable]

   const auto& ib = g_inputdeck.get< tag::param, tag::compflow,
               ^

Could you take a look at these?

Reviewed 9 of 24 files at r1, all commit messages.
Reviewable status: 9 of 42 files reviewed, 1 unresolved discussion (waiting on @jbakosi)

The following still deadlock:

  inciter:asynclogic_oversetfe_u0.0_migr_pe3
  inciter:asynclogic_oversetfe_u0.0_migr_pe8
  inciter:asynclogic_oversetfe_u0.5_migr_pe1
  inciter:asynclogic_oversetfe_u0.5_migr_pe3
  inciter:asynclogic_oversetfe_u0.5_migr_pe8
  inciter:asynclogic_oversetfe_u0.9_migr_pe1
  inciter:asynclogic_oversetfe_u0.9_migr_pe3
  inciter:asynclogic_oversetfe_u0.9_migr_pe8

i.e., those that actually migrate.
@jbakosi
Copy link
Member Author

jbakosi commented Jan 9, 2024

The asynclogic problems (partially) should be taken care of by 7bdcd1e. Those that migrate still deadlock, you could disable migration for those by

diff --git a/tests/regression/inciter/transport/SlotCyl/asynclogic/CMakeLists.txt b/tests/regression/inciter/transport/SlotCyl/asynclogic/CMakeLists.txt
index 9ded28ef3..aba6eff55 100644
--- a/tests/regression/inciter/transport/SlotCyl/asynclogic/CMakeLists.txt
+++ b/tests/regression/inciter/transport/SlotCyl/asynclogic/CMakeLists.txt
@@ -27,6 +27,7 @@ function(add_async_test scheme virt npes ppn migr)
     set(ARG "-c slot_cyl_${scheme}.q -v -u ${virt} -b ${migr_cmd}")
     set(TEXT_RES "diag.0;diag.1")
     set(TEXT_BAS "noop.ndiff.cfg;noop.ndiff.cfg")
+    set(migr_cmd "")
   else()
     set(ARG "-c slot_cyl_${scheme}.q -i unitcube_1k.exo -v -u ${virt} -b ${migr_cmd}")
     set(TEXT_RES diag)

Unfortunately, this still does not fix migrating overset asynclogic tests.
@jbakosi
Copy link
Member Author

jbakosi commented Jan 9, 2024

I did find a couple of data structures in Discretization that I forgot to pup, fixed in 3d5a030, but that still does not fix the migrating overset asynclogic tests. At this point I'm not sure how to fix those. Unless we come up with something obvious, I vote for disabling those tests, and putting migration to the overset todo list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants