Parallel tessellation

Developers
Johan
2011-11-01
2013-04-22
  • Johan
    Johan
    2011-11-01

    Hi, I'm in the planning process of replacing legacy code with a geometry back-end, that can do a) ray tracing and b) produce a surface representation. (I might have some additional questions on importers, but that's probably a separate post). Now, as far as I can see, BRL-CAD supports my wish list  just fine, but how hard would it be to do tessellation in parallel?

    To me, RT performance is far more important, but there I have no worries. The tessellation is for GUI purposes. From my short expeditions in the code, it appears to me that all threads walking the db tree are operating on the same NMG, but I'm by no means an expert on BRL-CAD, and might have got it completely wrong, hence the question :-)

    Cheers,
    /Johan

     
  • Sean Morrison
    Sean Morrison
    2011-11-16

    Hi Johan,

    Sorry for the delay responding, busy times.  As for your goals, we do support your wish list, excelling at (a) and marginally providing a variety of means for (b).  You won't likely find a more robust and high-performing solid ray tracer.  Also, a lot of effort of late has gone in to improve extraction of surface representations, but that is a rather complex topic it itself.

    As for the usually means to tessellate (calling db_walk_tree() with nmg_leaf_tess() etc), you're right that they do operate on the same NMG.  Most if not all of the NMG routines should be thread safe, it's just not been something we've tested extensively.  So, in theory you certainly could tessellate most of a model in parallel.

    At the lowest level, each primitive has a tessellation function that is called to calculate a polygonal NMG surface representation.  Those are definitely all independent and imminently parallelizable.  Then your pairwise boolean operations should be parallelizable, but you'd probably have to take care to make copies of each primitive NMG being evaluated.

    If you do attempt this, please do join the brlcad-devel mailing list or IRC channel so we can follow your progress and discuss in more detail.

    Cheers!
    Sean

     
  • Johan
    Johan
    2011-11-21

    Hi Sean, and thanks for the reply.

    I'm glad to hear that parallel tesselation can be done, when that becomes a priority. However, my starting point will be integrating BRL-CAD with our existing code (hopefully gaining some speed early next year and taking my little rainy day project into something heftier :-)

    Cheers,
    /Johan

     
  • Sean Morrison
    Sean Morrison
    2011-11-21

    Johan,

    No problem.  When you get deeper into coding issues, feel free to join our IRC channel or brlcad-devel mailing list.  As for integrating with your existing code, be sure to check out our docs on the wiki  along with examples throughout the code.  Asking questions works just fine too - parallel tessellation should be doable, but that doesn't mean it'll be easy.  ;) Mutually interesting project, though, so glad to help.

    http://brlcad.org/wiki/Developing_applications

    Cheers!
    Sean