<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Dear Erik,</p>
<p>the random seed has an influence on the point (in time) when the
simulation crashes.<br>
That means for certain seeds a simulation run will survive and
crash only after repeating the run with another seed,<br>
or depending on our simulation we have a crash at a run were we
added more nested optical elements.<br>
</p>
<p>If the seed is held fix and an error occurs, it is repeated each
run and becomes reproducible.</p>
<p>Hope that info helps to shed light on the issue.<br>
</p>
<p>Best,</p>
<p> Richard<br>
</p>
<p><br>
</p>
<div class="moz-cite-prefix">On 07/07/2021 14:56, Erik B Knudsen
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:6767a6d1-9fbd-e168-0801-197cce00954e@fysik.dtu.dk">Dear
Richard,
<br>
That is unfortunate. We will investigate the matter on our end.
<br>
From what you describe - it sounds like there is a memory leak
somewhere.
<br>
Is the "point of crash" always the same across simulation runs or
does it vary (as I would expect)? I.e. does it depend on the
random seed?
<br>
<br>
Also thank you for the very thorough report btw. If only they were
all like this.
<br>
<br>
cheers
<br>
Erik
<br>
<br>
On 07/07/2021 14:08, Richard Wagner wrote:
<br>
<blockquote type="cite">Dear all,
<br>
<br>
here is a follow up.
<br>
<br>
In short crashes still occur.
<br>
<br>
Of our many tests I will point out two scenarios:
<br>
<br>
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)
<br>
<br>
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
<br>
<br>
# McStas 2.7 - Nov. 27, 2020: [pid 4509] Signal 11 detected
SIGSEGV (Mem Error)
<br>
<br>
# Simulation: NNb (NNb_90.instr)
<br>
<br>
# Breakpoint: end_event (Trace) 0.68 % ( 6771.0/ 1000000.0)
<br>
<br>
# Date: Wed Jul 7 14:03:06 2021
<br>
<br>
# Started: Wed Jul 7 14:03:00 2021
<br>
<br>
# Last I/O Error: No such file or directory
<br>
<br>
b) a Single mono Planar mirror
<br>
<br>
The simulation crashes with either of the following messages,
when the amount of nested levels is above 115.
<br>
<br>
# McStas 2.7 - Nov. 27, 2020: [pid 98724] Signal 11 detected
SIGSEGV (Mem Error)
<br>
<br>
# Simulation: NNb (NNb_115.instr)
<br>
<br>
# Breakpoint: nested (Trace) 0.18 % ( 1821.0/ 1000000.0)
<br>
<br>
# Date: Wed Jul 7 12:57:49 2021
<br>
<br>
# Started: Wed Jul 7 12:57:49 2021
<br>
<br>
# Last I/O Error: No such file or directory
<br>
<br>
# 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)
<br>
<br>
Any ideas, which memory runs out?
<br>
<br>
We made the observation that when running the same simulation
with McStasScript we run into the crash earlier (level 75
instead of the 115)
<br>
<br>
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
<br>
<br>
Hope for any ideas, how to proceed further.
<br>
<br>
Thanks in advance,
<br>
<br>
Best,
<br>
<br>
Richard
<br>
<br>
On 05/07/2021 11:55, Erik B Knudsen wrote:
<br>
<blockquote type="cite">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">www.ill.eu</a> <<a class="moz-txt-link-abbreviated" href="http://www.ill.eu">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">mcstas-users@mcstas.org</a>
<br>
<a class="moz-txt-link-freetext" href="https://mailman2.mcstas.org/mailman/listinfo/mcstas-users">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">www.ill.eu</a> <<a class="moz-txt-link-abbreviated" href="http://www.ill.eu">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">mcstas-users@mcstas.org</a>
<br>
<a class="moz-txt-link-freetext" href="https://mailman2.mcstas.org/mailman/listinfo/mcstas-users">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">www.ill.eu</a> <<a class="moz-txt-link-abbreviated" href="http://www.ill.eu">www.ill.eu</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"><font color="#3984c6">www.ill.eu</font></a>
<p><br>
</p>
</div>
</body>
</html>