<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Dear All,</p>
    <div class="moz-forward-container">
      <p>here is a follow up. 
</p>
      <p>In short crashes still occur.</p>
      <p>Of our many tests I will point out two scenarios:</p>
      <p>a) double planar optic with corrected OFF File. Now the surfaces don't intersect each other anymore they have only common sides.
With this approach the number of points and faces explodes as one goes to a higher number of levels (vertices scale with the square of the levels) 
</p>
      <p>The simulation start to take noticeably longer (several minutes compared two ~20 sec). and we get a 
crash after increasing to 90 levels with the message  
</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">
<span style=" color:#008000;"># McStas 2.7 - Nov. 27, 2020: [pid 4509] Signal 11 detected SIGSEGV (Mem Error)</span></p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#008000;"># Simulation: NNb (NNb_90.instr) </span></p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#008000;"># Breakpoint: end_event (Trace) 0.68 % (    6771.0/ 1000000.0)</span></p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#008000;"># Date:      Wed Jul  7 14:03:06 2021</span></p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#008000;"># Started:   Wed Jul  7 14:03:00 2021</span></p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#008000;"># Last I/O Error: No such file or directory</span></p>
      <p><style type="text/css">p, li { white-space: pre-wrap; }</style></p>
      <p>
</p>
      <p>b) a Single mono Planar mirror</p>
      <p>The simulation crashes with either of the following messages, when the amount of nested levels is above 115. 

</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#008000;"># McStas 2.7 - Nov. 27, 2020: [pid 98724] Signal 11 detected SIGSEGV (Mem Error)</span></p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#008000;"># Simulation: NNb (NNb_115.instr) </span></p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#008000;"># Breakpoint: nested (Trace) 0.18 % (    1821.0/ 1000000.0)</span></p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#008000;"># Date:      Wed Jul  7 12:57:49 2021</span></p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#008000;"># Started:   Wed Jul  7 12:57:49 2021</span></p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#008000;"># Last I/O Error: No such file or directory</span></p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#008000;">
</span></p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" color:#008000;"># McStas 2.7 - Nov. 27, 2020: [pid 1196] Signal 11 detected SIGSEGV (Mem Error)
# Simulation: NNb (NNb.instr) 
# Breakpoint: end_event (Trace) 2.17 % (   21733.0/ 1000000.0)
</span></p>
      <p><style type="text/css">p, li { white-space: pre-wrap; }</style></p>
      <p>Any ideas, which memory runs out?</p>
      <p>We made the observation that when running the same simulation with McStasScript we run into the crash earlier (level 75 instead of the 115)
</p>
      <p>I put the off files of the two cases in the attachment. The instrument files is the same during all tests (means only the OFF of the Guide_anyshape) is changed
</p>
      <p>Hope for any ideas, how to proceed further.</p>
      <p>Thanks in advance,
</p>
      <p>Best, 
</p>
      <p>Richard
</p>
      <p>
</p>
      <p>
</p>
      <div class="moz-cite-prefix">On 05/07/2021 11:55, Erik B Knudsen
        wrote:<br>
      </div>
      <blockquote type="cite"
        cite="mid:8a5ae460-4865-acb0-728d-0f111093f51f@fysik.dtu.dk">Dear
        Richard, <br>
        Very good to hear. For sure, overlapping polygons is expected to
        create problems and undefined behaviour. The underlying routine
        that checks polygon intersections does not check for
        consistency, and instead only checks which polygon it hits
        first, which could be the wrong one. <br>
        That the problem only arises at a certain level of complexity is
        perhaps connected to the sheer number of overlaps becoming large
        - but that is merely guesswork on my part. <br>
        <br>
        Looking forward to hearing the further output of your efforts. <br>
        <br>
        cheers <br>
        Erik <br>
        <br>
        On 02/07/2021 13:30, Richard Wagner wrote: <br>
        <blockquote type="cite">Dear all, <br>
          <br>
          we had in the meantime a detailed look in the matter from our
          side and suspect know a problem with the OFF-file <br>
          <br>
          If we use a mono planar version of the optic (see example in
          the attachment) we can increase the nested levels ad lib. <br>
          We are only limited by the fact that the spacing between the
          levels is becoming so small, that it makes no sense to
          continue. <br>
          <br>
          A major difference between the single and double planar optic
          is that the double planar OFF-File has surfaces that intersect
          each other. <br>
          <br>
          I don't know if this is "allowed" or if it can cause McStas to
          have problems during the simulation. <br>
          Until a certain level of complexity it worked fine. <br>
          <br>
          What we are currently doing is to change the function (written
          in python), that generates the double planar OFF-file to
          generate additional vertexes and faces at the intersection of
          the surfaces. So we end up having a cleanly defined optic with
          no 'undefined intersections'. <br>
          <br>
          I will report the outcome of this changes. <br>
          <br>
          Best, <br>
          <br>
          Richard <br>
          <br>
          <br>
          <br>
          <br>
          On 02/07/2021 09:35, Erik B Knudsen wrote: <br>
          <blockquote type="cite">Dear Richard, <br>
            Thank you for the thorough and detailed report. We will take
            a look at your problem asap and report back. <br>
            cheers <br>
            Erik <br>
            <br>
            On 29/06/2021 18:31, Richard Wagner wrote: <br>
            <blockquote type="cite">Dear McStas experts, <br>
              <br>
              We are currently doing simulations with nested elliptical
              optics and so far things ran quiet smoothly. <br>
              <br>
              We generate the OFF file for the optic ourselves and use
              the Guide_anyshape component. <br>
              <br>
              We start with an outer layer and continue to add inner
              layers one at a time. <br>
              If we then get to optical components that have a high
              number of levels we run into the problem, that McStas
              crashes resp. aborts the simulation. <br>
              <br>
              Output in that case reads: <br>
              <br>
              # McStas 2.7 - Nov. 27, 2020: [pid 64818] Signal 11
              detected SIGSEGV (Mem Error) <br>
              # Simulation: NNb (NNb.instr) <br>
              # Breakpoint: psd_monitor (Trace) 2.46 % (   24574.0/
              1000000.0) <br>
              # Date:      Tue Jun 29 17:44:13 2021 <br>
              # Started:   Tue Jun 29 17:44:13 2021 <br>
              # Last I/O Error: No such file or directory <br>
              # McStas 2.7 - Nov. 27, 2020: Simulation stop (abort). <br>
              <br>
              Or <br>
              <br>
              # McStas 2.7 - Nov. 27, 2020: [pid 66573] Signal 10
              detected [proc 0] SIGBUS (Bus error) <br>
              # Simulation: NNb (NNb.instr) <br>
              # Breakpoint: nested (Trace) 85.56 % (  855555.0/
              1000000.0) <br>
              # Date:      Tue Jun 29 18:00:32 2021 <br>
              # Started:   Tue Jun 29 18:00:28 2021 <br>
              # Last I/O Error: No such file or directory <br>
              <br>
              There are many messages such as the following in the
              Mcstas Window, too: <br>
              <br>
              Guide_anyshape: nested: Warning: Reflectivity R=7.02318
              > 1 lowered to R=1. <br>
              Guide_anyshape: nested: Warning: Reflectivity R=7.02365
              > 1 lowered to R=1. <br>
              Guide_anyshape: nested: Warning: Reflectivity R=7.02412
              > 1 lowered to R=1. <br>
              Guide_anyshape: nested: Warning: Reflectivity R=7.0246
              > 1 lowered to R=1. <br>
              <br>
              I put an example of an instrument file (+OFF , +Source
              Component) of a failed run for a 1m optic in the
              attachment. <br>
              <br>
              The trace run for instrument visualization works. <br>
              We only run into the problem for short optics <=2 m,
              were a high number of nested levels is needed to
              completely cover the cross section. <br>
              <br>
              We run into the problem on Ubuntu 18.04 and MacOs Big Sur
              machines. <br>
              <br>
              Any ideas what's the problem? Are the spacing of the
              elliptical getting to narrow, perhaps? <br>
              <br>
              Thanks in advance, <br>
              <br>
              Richard <br>
              <br>
              <br>
              -- <br>
              *Richard Wagner* <br>
              Research Engineer <br>
              Nuclear and Particle Physics Group <br>
              Institut Laue-Langevin - ILL <br>
              71, avenue des Martyrs <br>
              CS 20156 <br>
              38042 Grenoble Cedex 9 <br>
              France <br>
              <br>
              <a class="moz-txt-link-abbreviated"
                href="http://www.ill.eu" moz-do-not-send="true">www.ill.eu</a>
              <<a class="moz-txt-link-abbreviated"
                href="http://www.ill.eu" moz-do-not-send="true">www.ill.eu</a>>
              <br>
              <br>
              <br>
              <br>
              _______________________________________________ <br>
              mcstas-users mailing list <br>
              <a class="moz-txt-link-abbreviated"
                href="mailto:mcstas-users@mcstas.org"
                moz-do-not-send="true">mcstas-users@mcstas.org</a> <br>
              <a class="moz-txt-link-freetext"
                href="https://mailman2.mcstas.org/mailman/listinfo/mcstas-users"
                moz-do-not-send="true">https://mailman2.mcstas.org/mailman/listinfo/mcstas-users</a>
              <br>
              <br>
            </blockquote>
            <br>
          </blockquote>
          -- <br>
          *Richard Wagner* <br>
          Research Engineer <br>
          Nuclear and Particle Physics Group <br>
          Institut Laue-Langevin - ILL <br>
          71, avenue des Martyrs <br>
          CS 20156 <br>
          38042 Grenoble Cedex 9 <br>
          France <br>
          <br>
          <a class="moz-txt-link-abbreviated" href="http://www.ill.eu"
            moz-do-not-send="true">www.ill.eu</a> <<a
            class="moz-txt-link-abbreviated" href="http://www.ill.eu"
            moz-do-not-send="true">www.ill.eu</a>> <br>
          <br>
          <br>
          <br>
          _______________________________________________ <br>
          mcstas-users mailing list <br>
          <a class="moz-txt-link-abbreviated"
            href="mailto:mcstas-users@mcstas.org" moz-do-not-send="true">mcstas-users@mcstas.org</a>
          <br>
          <a class="moz-txt-link-freetext"
            href="https://mailman2.mcstas.org/mailman/listinfo/mcstas-users"
            moz-do-not-send="true">https://mailman2.mcstas.org/mailman/listinfo/mcstas-users</a>
          <br>
          <br>
        </blockquote>
        <br>
      </blockquote>
      <div class="moz-signature">-- <br>
        <b>Richard Wagner</b><br>
        Research Engineer<br>
        Nuclear and Particle Physics Group<br>
        Institut Laue-Langevin - ILL<br>
        71, avenue des Martyrs<br>
        CS 20156<br>
        38042 Grenoble Cedex 9<br>
        France <br>
        <br>
        <a href="www.ill.eu" moz-do-not-send="true"><font
            color="#3984c6">www.ill.eu</font></a>
        <p>
</p>
      </div>
    </div>
  </body>
</html>