Menu

#237 Segmentation Fault - groovyBC with storedVariables in parallel simulations

fixed
None
high
crash
Always
minor-fix
OpenFOAM v1612+
CentOS 7 64bit
groovyBC
2017-01-25
2017-01-13
No

Hi,
I think this problem is already known... when running simulations with groovyBC in parallel with storedVariables, the simulation crashes if any of the processor regions do not have a part of the patch/patches on which the storedVariables are defined.

This happens because while writing the boundary fields to disc, swak4Foam tries to access the [0]th
index of single value variables, even though the size of the field is zero (which is the case on those
processors which do not have a part of the patch in it), resulting in a segmentation fault.

Please find attached a patch file which could be one way to solve the problem. This patch is based on the "develop" branch of swak4Foam.

1 Attachments

Discussion

  • Bernhard Gschaider

    • status: new --> acknowledged
    • assigned_to: Bernhard Gschaider
     
  • Bernhard Gschaider

    Thanks for the report. I'll have a look.
    Sadly ExpressionResult is one of the ugliest parts of swak4foam (loads of code-repitition)

     
  • Bernhard Gschaider

    When I looked at the patch I had a DejaVu "I know this fix". Then I looked through my swak-branches and it seems I started working on this in November. Don't know what sopped me. Seems I saw a squirrel https://www.youtube.com/watch?v=xrAIGLkSMls

     
  • Philippose Rajan

    Hello Bernhard,
    Yes, That was me :-) I had sent you the patch via a discussion thread on the CFD-Online forum :-) No worries. As I had mentioned at that time, this patch has been working for me, and I have been able to use swak4Foam and groovyBC without any issues :-)

    As you can see, I might be ever so slightly addicted (or dependent?) on the little beast you have brought to life ;-) Within about 5 minutes of putting in a new version of OpenFOAM into my workflow, I already start missing the swak4Foam functionality, and then I have to get it working as soon as I can.

     
  • Bernhard Gschaider

    Sorry to hear about your addiction. I recommend getting professional help about that ;)

    Anyway: fixed version is pushed to the develop-branch. Hope I didn't break anything

    Your version wrote 0 on processors that didn't have faces. I fixed that (I hope) by adding a union to store those values and write them if needed. Needs a bit more memory (and even more on compilers that don't support C++-0x) but that is neglebil compared to regular field data

    If it compiles/works for you I will close this ticket

     
  • Philippose Rajan

    Hello Bernhard,
    A Good Morning to you. I already have found professional help :-)

    I just tried the latest changes you have made to swak4Foam (develop branch), and it works as expected under the following conditions:
    1. Serial simulation
    2. Parallel simulation - split in a way that the patch with the stored variable exists in all processors
    3. Parallel simulation - split in a way that the patch exists in only one of the processors.

    As of now it all seems to be good :-)

    I suggest that you close the ticket and lets hope for the best ;-)

    Regards,
    Philippose

     
  • Bernhard Gschaider

    • status: acknowledged --> fixed
     
  • Bernhard Gschaider

    OK. Great

     

Log in to post a comment.