Code Monkey home page Code Monkey logo

Comments (10)

julien-tierny avatar julien-tierny commented on June 14, 2024

Thanks @m-s-will for reporting this.
Can you please have a closer look into this? (e.g. which line is casing the segfault, what variable is not correctly set, etc.)

@eve-le-guillou have you run into this? any thoughts?

@pierre-guillou any thoughts?

thanks!

from ttk.

emmwel avatar emmwel commented on June 14, 2024

The issue for me was that some variables overflowed when the dataset was 2D.

I did the following in ImplicitTriangulation.cpp:

  • changed createMetaGrid to check whether the globalBounds for the third dimension is 0:
std::array<int, 3> dimensions = {
   static_cast<int>(
     std::round((globalBounds[1] - globalBounds[0]) / this->spacing_[0]))
     + 1,
   static_cast<int>(
     std::round((globalBounds[3] - globalBounds[2]) / this->spacing_[1]))
     + 1,
   static_cast<int>(
     std::round((globalBounds[5] - globalBounds[4]) / this->spacing_[2]))
     + 1,
 };

 if (globalBounds[4] == 0 && globalBounds[5] == 0) {
   // 2d
   dimensions[2] = 1;
 }
  • changed getVertLocalCoords to only remove local grid offset for the third dimension if dimensionality is 3
/ local vertex coordinates
  p[0] -= this->localGridOffset_[0];
  p[1] -= this->localGridOffset_[1];
  if (this->dimensionality_ == 3)
    p[2] -= this->localGridOffset_[2];

With the above nothing crashes and seems to work as it should when comparing to serial results.

from ttk.

m-s-will avatar m-s-will commented on June 14, 2024

On further investigation, the crash appears here, and only if there are more than 2 ranks:

MPI_Sendrecv(&nCells, 1, ttk::getMPIType(nCells), neigh, ttk::MPIrank_,

So it probably has something to do with the neighborhood computation when you have multiple neighbors.

from ttk.

julien-tierny avatar julien-tierny commented on June 14, 2024

@eve-le-guillou can you reproduce the issue? could you try out @emmwel's fix?

from ttk.

pierre-guillou avatar pierre-guillou commented on June 14, 2024

Hello everyone!

I have reproduced the issue on my laptop (2D Wavelet + ScalarFieldSmoother on 4 MPI processes). I get a segfault a bit earlier, at

this->ghostCellsPerOwner_[cellRank].emplace_back(

Here the variable cellRank holds the value -1. Sadly, what @emmwel proposed does not seem to fix this issue.

After looking at what I've coded for the on-the-fly cell rank computation, I noticed that the neighborCellBBoxes overlap in a weird fashion. Those are computed through the localBBox reference and then exchanged between neighbors.

The culprit seem to be the call to triangleToPosition2d at

this->triangleToPosition2d(lcid, p.data());

When comparing triangleToPosition2d to tetrahedronToPosition, there's a divide by 2 missing in the former (a divide by 6 in the latter). Inserting a p[0] /= 2; at line 3118 seem to fix the issue.

Does this fixes the crash for you?

Pierre

from ttk.

m-s-will avatar m-s-will commented on June 14, 2024

Adding the division fixed the problem for me, however while testing it I found another issue, when forcing an explicit Triangulation by using Tetrahedralize beforehand. This leads to an endless loop in exchangeDistributedInternal (called from preconditionDistributedEdges, doIter doesn't seem to stay false, if we force the loop to finish after a few steps, the rest of the pipeline runs correctly, so the edges were preconditioned correctly), in 2D and 3D. I will investigate this further and maybe create another issue, this one seems fixed.

@emmwel does this fix work for you?

from ttk.

emmwel avatar emmwel commented on June 14, 2024

Adding @pierre-guillou's fix worked for the ScalarFieldSmoother, but for the IntegralLines and our own filters I still need my own fix for the filters to work.

from ttk.

m-s-will avatar m-s-will commented on June 14, 2024

It turns out that the problem with IntegralLines and our filters had different sources, so the 2D problem should be fixed with the additional division.

from ttk.

julien-tierny avatar julien-tierny commented on June 14, 2024

thanks a lot @pierre-guillou for the one-liner hot fix :)
would you mind opening a PR for that?
(I can take care of that if you prefer)

from ttk.

julien-tierny avatar julien-tierny commented on June 14, 2024

@m-s-will regarding the explicit triangulation, this is not something we have tested much.
but that should definitely not be buggy as you report.
that'd be great if you could open a separate, detailed issue for that.
thanks!

from ttk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.