<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hi Peter,</p>
<p>I had a look at the 'stack smashing detected' error you reported
(below) when using:</p>
<ul>
<li>instrument screw_n</li>
<li>Guide_anyshape component with large OFF (nice twisted guide
made of triangles)<br>
</li>
<li>mpi with 24 cores</li>
</ul>
<p>I can reproduce the bug. I find that wether it is controlled from
iFit or from the command line with mcrun does not make any
difference. The bug occurs in both usages, even with very few
neutron counts (1e4), in the middle of the TRACE (not at final
data merge).<br>
</p>
<p>The reported error is:</p>
<ul>
<li>*** stack smashing detected ***: <unknown> terminated</li>
</ul>
<p>and it mostly takes place at the 'screw' component which is the
Guide_anyshape(OFF). It triggers a SIGTERM or SIGABRT which
usually saves results but stops further neutron events (partial
computation). But it also involves the Octo_sm monitor
(Monitor_nD).<br>
</p>
<p><b>McStas 2.5 test (Ubuntu 18.04)</b><br>
</p>
<p>When executed from iFit, the error also shows as:<br>
</p>
<ul>
<li># Fatal : unrecoverable loop ! Suicide (naughty boy).</li>
<li>[warn] Epoll ADD(4) on fd 37 failed. Old events were 0; read
change was 0 (none); write change was 1 (add): Bad file
descriptor</li>
<li>[farhimacpro:05429] pmix_usock_msg_send_bytes: write failed:
Broken pipe (32) [sd = 112]<br>
</li>
</ul>
<p>This is clearly related to <i>openMPI</i>, and more specifically
to
<i> libevent</i>.<br>
</p>
<p>I have executed the same with a serial computation, and it all
goes OK, even when compiled with MPI, and executed with --mpi=1.</p>
<p>I have no idea why this happens, as Guide_anyshape has no I/O
routine except at the start (read the OFF), but the issue comes in
the middle of the TRACE, in connection with Octo_sm...<br>
</p>
<p><b>Conclusion<br>
</b></p>
<p>I have no idea what the error is, as of today. <br>
</p>
<p><b>Fallback solutions</b><br>
</p>
<p>In all cases, make sure the 'L' value is larger than the
Guide_anyshape length (OFF 'width').<br>
</p>
<p><i>Solution 1: </i>Removing the Octo_sm component seems to solve
the issue. So this is a possibility.</p>
<p><i>Solution 2:</i> (recommended) You can as well replace it with
e.g.:</p>
<p>COMPONENT Octo_sm = Divergence_monitor(xwidth = h, yheight = w,<br>
nh=100, nv=100, maxdiv_h=10, maxdiv_v=0.1,
filename="Octo_sm.dat")<br>
AT (0, 0, L+0.04) RELATIVE arm_geks<br>
</p>
<p><i>Solution 3: </i>An other solution is serial execution which
works, as far as I have seen. You can force iFit/mccode to work in
serial with:</p>
<ul>
<li>m=mccode('screw_n.instr','mpi=1'); <i>% at creation</i><br>
</li>
</ul>
<p>or</p>
<ul>
<li>m=mccode('screw_n.instr');</li>
<li>m.UserData.options.mpi=1; <i>% after creation</i></li>
</ul>
<p>Then you can run parameter scans and optimisations. It is just
longer.</p>
<p><b>Final question</b></p>
<p>Would you accept if I add one of your OFF twisted guides into
McStas/Data, as well as the PYK reactor source parameters in
Source_gen doc ?<br>
</p>
<p>Emmanuel.<br>
</p>
<div class="moz-cite-prefix">On 2/11/19 6:53 PM, farhi wrote:<br>
</div>
<blockquote type="cite"
cite="mid:da26b2ba7f463f4c8b50a43f761e40d1@ill.fr">Hello Peter, <br>
<br>
Would you be so kind to send me your H3 McStas model, as well as
the 15.off file so that I can nail down the error ? <br>
<br>
Emmanuel. <br>
<br>
Le 2019-02-11 17:29, Петр Коник a écrit : <br>
<blockquote type="cite">Dear all! <br>
<br>
We currently try to use a quiet large .off file to finely
represent a <br>
complex geometry guide. While mcstas itself works well (if
executed <br>
from the mcgui), ifit script, which we use to scan parameters, <br>
irregularly crash. Here is the error - it looks like it is some
<br>
trouble with the array allocated sizes. Any ideas how to fix
that? <br>
<br>
Sorry for large text - we really don't know which part is
important. <br>
<br>
Best regards, <br>
Peter Konik <br>
<br>
mpirun -n 8
/tmp/tp538a3bb9_21a0_4166_b4ea_597a15889e55/screw_n.out <br>
--ncount=1000000
--dir=/tmp/tp538a3bb9_21a0_4166_b4ea_597a15889e55/sim <br>
L=15 guide_m=6 lambda=2 <br>
mpirun -n 8
/tmp/tp538a3bb9_21a0_4166_b4ea_597a15889e55/screw_n.out <br>
--ncount=1000000
--dir=/tmp/tp538a3bb9_21a0_4166_b4ea_597a15889e55/sim <br>
L=15 guide_m=6 lambda=2: Quit <br>
Simulation 'H3' <br>
(/tmp/tp538a3bb9_21a0_4166_b4ea_597a15889e55/screw_n.instr):
running <br>
on 8 nodes (master is 'konik-N46JV', MPI version 3.1). <br>
[H3] Initialize <br>
[H3] Initialize <br>
[H3] Initialize <br>
[H3] Initialize <br>
Loading geometry file (OFF/PLY): data/length/extra_fine/15.off <br>
Number of vertices: 5694 <br>
[H3] Initialize <br>
[H3] Initialize <br>
[H3] Initialize <br>
[H3] Initialize <br>
Number of polygons: 11366 <br>
Warning: Neither xwidth, yheight or zdepth are defined. <br>
The file-defined (non-scaled) geometry the OFF
geometry <br>
data/length/extra_fine/15.off will be applied! <br>
Bounding box dimensions for geometry
data/length/extra_fine/15.off: <br>
Length=0.150000 (100.000%) <br>
Width= 15.000000 (100.000%) <br>
Depth= 0.150000 (100.000%) <br>
*** stack smashing detected ***: <unknown> terminated <br>
<br>
# McStas 2.5 - Dec. 12, 2018: [pid 13264] Signal 6 detected
[proc 7] <br>
SIGABRT (Abort) <br>
# Simulation: H3
(/tmp/tp538a3bb9_21a0_4166_b4ea_597a15889e55/screw_n.instr) <br>
# Breakpoint: Octo_sm (Trace) 6.47 % ( 8089.0/ 125000.0) <br>
# Date: Mon Feb 11 19:13:44 2019 <br>
# Started: Mon Feb 11 19:13:43 2019 <br>
# Last I/O Error: Function not implemented <br>
# McStas 2.5 - Dec. 12, 2018: Simulation stop (abort). <br>
<br>
# McStas 2.5 - Dec. 12, 2018: [pid 13258] Signal 15 detected
[proc 6] <br>
SIGTERM (Termination) <br>
# Simulation: H3
(/tmp/tp538a3bb9_21a0_4166_b4ea_597a15889e55/screw_n.instr) <br>
# Breakpoint: screw (Trace) 20.96 % ( 26205.0/ 125000.0) <br>
# Date: Mon Feb 11 19:13:45 2019 <br>
# Started: Mon Feb 11 19:13:43 2019 <br>
# McStas 2.5 - Dec. 12, 2018: Finishing simulation (save results
and exit) <br>
<br>
# McStas 2.5 - Dec. 12, 2018: [pid 13255] Signal 15 detected
[proc 5] <br>
SIGTERM (Termination) <br>
# Simulation: H3
(/tmp/tp538a3bb9_21a0_4166_b4ea_597a15889e55/screw_n.instr) <br>
# Breakpoint: screw (Trace) 19.39 % ( 24240.0/ 125000.0) <br>
# Date: Mon Feb 11 19:13:45 2019 <br>
# Started: Mon Feb 11 19:13:43 2019 <br>
# McStas 2.5 - Dec. 12, 2018: Finishing simulation (save results
and exit) <br>
<br>
Finally [H3: /tmp/tp538a3bb9_21a0_4166_b4ea_597a15889e55/sim].
Time: 2 [s] <br>
<br>
# McStas 2.5 - Dec. 12, 2018: [pid 13248] Signal 15 detected
[proc 2] <br>
SIGTERM (Termination) <br>
# Simulation: H3
(/tmp/tp538a3bb9_21a0_4166_b4ea_597a15889e55/screw_n.instr) <br>
# Breakpoint: screw (Trace) 19.55 % ( 24443.0/ 125000.0) <br>
# Date: Mon Feb 11 19:13:45 2019 <br>
# Started: Mon Feb 11 19:13:43 2019 <br>
# McStas 2.5 - Dec. 12, 2018: Finishing simulation (save results
and exit) <br>
<br>
Finally [H3: /tmp/tp538a3bb9_21a0_4166_b4ea_597a15889e55/sim].
Time: 2 [s] <br>
<br>
# McStas 2.5 - Dec. 12, 2018: [pid 13247] Signal 15 detected
[proc 1] <br>
SIGTERM (Termination) <br>
# Simulation: H3
(/tmp/tp538a3bb9_21a0_4166_b4ea_597a15889e55/screw_n.instr) <br>
# Breakpoint: screw (Trace) 20.48 % ( 25600.0/ 125000.0) <br>
# Date: Mon Feb 11 19:13:45 2019 <br>
# Started: Mon Feb 11 19:13:43 2019 <br>
# McStas 2.5 - Dec. 12, 2018: Finishing simulation (save results
and exit) <br>
<br>
Finally [H3: /tmp/tp538a3bb9_21a0_4166_b4ea_597a15889e55/sim].
Time: 2 [s] <br>
<br>
# McStas 2.5 - Dec. 12, 2018: [pid 13250] Signal 15 detected
[proc 4] <br>
SIGTERM (Termination) <br>
# Simulation: H3
(/tmp/tp538a3bb9_21a0_4166_b4ea_597a15889e55/screw_n.instr) <br>
# Breakpoint: screw (Trace) 20.61 % ( 25768.0/ 125000.0) <br>
# Date: Mon Feb 11 19:13:45 2019 <br>
# Started: Mon Feb 11 19:13:43 2019 <br>
# McStas 2.5 - Dec. 12, 2018: Finishing simulation (save results
and exit) <br>
<br>
# McStas 2.5 - Dec. 12, 2018: [pid 13249] Signal 15 detected
[proc 3] <br>
SIGTERM (Termination) <br>
# Simulation: H3
(/tmp/tp538a3bb9_21a0_4166_b4ea_597a15889e55/screw_n.instr) <br>
# Breakpoint: screw (Trace) 26.14 % ( 32672.0/ 125000.0) <br>
# Date: Mon Feb 11 19:13:45 2019 <br>
# Started: Mon Feb 11 19:13:43 2019 <br>
# McStas 2.5 - Dec. 12, 2018: Finishing simulation (save results
and exit) <br>
<br>
Finally [H3: /tmp/tp538a3bb9_21a0_4166_b4ea_597a15889e55/sim].
Time: 2 [s] <br>
<br>
# McStas 2.5 - Dec. 12, 2018: [pid 13246] Signal 15 detected
[proc 0] <br>
SIGTERM (Termination) <br>
# Simulation: H3
(/tmp/tp538a3bb9_21a0_4166_b4ea_597a15889e55/screw_n.instr) <br>
# Breakpoint: screw (Trace) 20.70 % ( 25879.0/ 125000.0) <br>
# Date: Mon Feb 11 19:13:45 2019 <br>
# Started: Mon Feb 11 19:13:43 2019 <br>
# McStas 2.5 - Dec. 12, 2018: Finishing simulation (save results
and exit) <br>
<br>
Save [H3] <br>
[warn] Epoll ADD(4) on fd 49 failed. Old events were 0; read
change <br>
was 0 (none); write change was 1 (add): Bad file descriptor <br>
[warn] Epoll ADD(4) on fd 43 failed. Old events were 0; read
change <br>
was 0 (none); write change was 1 (add): Bad file descriptor <br>
--------------------------------------------------------------------------
<br>
mpirun noticed that process rank 7 with PID 0 on node
konik-N46JV <br>
exited on signal 3 (Quit). <br>
--------------------------------------------------------------------------
<br>
<br>
Error: Could not evaluate Expression in model screw_n.instr
McCode <br>
[mccode] iF495774 <br>
self = iFunc_McCode (methods,doc,plot,code) 1D model:
"screw_n.instr <br>
McCode [mccode]" <br>
Expression: UD = this.UserData; options=UD.options;if <br>
~isempty(options.dir) && ... <br>
Description: McCode virtual experiment screw_n.instr <br>
Set UserData.options.monitor to specify a given monitor file
pattern, <br>
or [] to get the last. <br>
Monitors are stored in UserData.monitors <br>
Available monitors: <br>
* Octo_large <br>
* Octo_med <br>
* Octo_sm <br>
iData iD500632=load(iData,... [100 1] Intensity [n/s/bin](x)
<br>
"mccode.sim McCode sim file I=1.02353e+09 I_err=1.02353e+09 N=1
<br>
X0=0.0131313 dX=0;" <br>
</tmp/tp538a3bb9_21a0_4166_b4ea_597a15889e55/sim/Octo_sm_1549901622.vd>
<br>
Axis 1 "x" label is "Vert. Divergence [deg]", range [-0.1:0.1]
<br>
Tag: 'iF495774' <br>
Date: '11-Feb-2019 19:12:49' <br>
Name: 'screw_n.instr McCode [mccode]' <br>
Parameters: {3×1 cell} <br>
Guess: [10 6 5] <br>
Constraint: [1×1 struct] <br>
Dimension: 1 <br>
ParameterValues: [3×1 double] <br>
UserData: [1×1 struct] <br>
Duration: 0.7051 <br>
class: 'iFunc_McCode' <br>
<br>
Parameters (3): <br>
p( 1)= L=15 <br>
p( 2)= guide_m=6 <br>
p( 3)= lambda=2 <br>
Other Parameters: <br>
'' <br>
'UD = this.UserData; options=UD.options;' <br>
'if ~isempty(options.dir) &&
isempty(dir(options.dir));' <br>
'try; mkdir(options.dir); end;' <br>
'end;' <br>
'if isempty(options.dir) || isempty(dir(options.dir));' <br>
'options.dir=tempname;' <br>
'mkdir(options.dir);' <br>
'options.use_tmpdir = true;' <br>
'else options.use_tmpdir = false;' <br>
<br>
... <br>
'ax='x,y,z,t';' <br>
'nd=exist('t')+exist('z')+exist('y')+exist('x');' <br>
'if min(nd,this.Dimension)>0, ax=eval([ '{' <br>
ax(1:(2*min(nd,this.Dimension))) '}']); else ax={}; end;' <br>
'if ~isempty(ax) && exist('x') &&
~isempty(x) && <br>
~all(isnan(x(:))), signal = interp(signal, ax{:});' <br>
'else x=getaxis(signal,1); y=getaxis(signal,2); <br>
z=getaxis(signal,3); t=getaxis(signal,4); end;' <br>
'end;' <br>
<br>
Name Size Bytes Class
Attributes <br>
<br>
ME 1x1 3878 MException <br>
UD 1x1 1029966 struct <br>
cmd 1x163 326 char <br>
duration 1x1 8 double <br>
f 0x1 0 cell <br>
iFunc_ax 1x14 28 char <br>
iFunc_dim 1x1 8 double <br>
iFunc_t0 1x6 48 double <br>
iFunc_this 1x1 1070328 iFunc_McCode <br>
index 0x0 0 double <br>
options 1x1 2461 struct <br>
p 1x3 24 double <br>
result 1x4667 9334 char <br>
signal 0x0 0 double <br>
status 1x1 8 double <br>
struct_p 1x1 552 struct <br>
this 1x1 1070328 iFunc_McCode <br>
varargin 1x0 0 cell <br>
x 51x1 408 double <br>
<br>
Error using iFunc/feval>iFunc_feval_expr (line 414) <br>
Model screw_n.instr McCode [mccode] iF495774 failed to execute
mpirun <br>
-n 8 /tmp/tp538a3bb9_21a0_4166_b4ea_597a15889e55/screw_n.out <br>
--ncount=1000000
--dir=/tmp/tp538a3bb9_21a0_4166_b4ea_597a15889e55/sim <br>
L=15 guide_m=6 lambda=2 <br>
iFunc:feval: Saved state in <br>
/media/konik/a09e43d5-7f1d-47d7-b0ae-2df53071d43b/JOB/Octagon-guide/Octagon-guide/simulation/iFunc_feval_error
<br>
Error using iFunc/feval>iFunc_feval_expr (line 432) <br>
Failed model evaluation. Saved state in <br>
/media/konik/a09e43d5-7f1d-47d7-b0ae-2df53071d43b/JOB/Octagon-guide/Octagon-guide/simulation/iFunc_feval_error
<br>
<br>
Error in iFunc/feval (line 344) <br>
[signal,ax,p,model,duration] = iFunc_feval_expr(model,
varargin{:}); <br>
<br>
Error in iFunc_McCode/feval (line 139) <br>
[signal, self, ax, name] = feval@iFunc(self,
varargin{:}); <br>
<br>
Error in iData>iData_iFunc2iData (line 268) <br>
[signals, this_in, axs, names] = feval(this_in, varargin{:});
<br>
<br>
Error in iData (line 189) <br>
[this_out, this_in] = iData_iFunc2iData(this_in,
axes_in, <br>
varargin{2:end}); <br>
<br>
Error in screw_length_scan (line 42) <br>
results = iData(model,parameters); <br>
_______________________________________________ <br>
ifit-users mailing list <br>
<a class="moz-txt-link-abbreviated"
href="mailto:ifit-users@mccode.org">ifit-users@mccode.org</a>
<br>
<a class="moz-txt-link-freetext"
href="https://mailman2.mccode.org/mailman/listinfo/ifit-users">https://mailman2.mccode.org/mailman/listinfo/ifit-users</a>
<br>
</blockquote>
<br>
</blockquote>
<pre class="moz-signature" cols="72">--
Emmanuel FARHI, \|/ ____ \|/
Spectroscopy Group Institut Laue-Langevin (ILL) Grenoble ~@-/ oO \-@~
71 av des Martyrs,CS 20156,38042 Grenoble Cedex 9,France /_( \__/ )_\
Work :Tel (33/0) 4 76 20 71 35. Fax (33/0) 4 76 48 39 06 \__U_/
</pre>
</body>
</html>