McCode
McCode copied to clipboard
Incomplete merge of event-data in MPI mode may cause an incomplete mccode.sim
Seen on Windows in a (big) MPI-run with 72 cores.
After the end of simulation, dataset was not plot-able, mcplot output:
/Applications/McStas-3.1.app/Contents/Resources/mcstas/3.1/tools/Python/mcplot/pyqtgraph/plotfuncs.py:183: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
dataset = np.array(data.zvals)
mcplot error: tuple index out of range
Traceback (most recent call last):
File "/Applications/McStas-3.1.app/Contents/Resources/mcstas/3.1/bin/../tools/Python/mcplot/pyqtgraph/mcplot.py", line 67, in <module>
main(args)
File "/Applications/McStas-3.1.app/Contents/Resources/mcstas/3.1/bin/../tools/Python/mcplot/pyqtgraph/mcplot.py", line 57, in main
raise e
File "/Applications/McStas-3.1.app/Contents/Resources/mcstas/3.1/bin/../tools/Python/mcplot/pyqtgraph/mcplot.py", line 51, in main
plotter.runplot()
File "/Applications/McStas-3.1.app/Contents/Resources/mcstas/3.1/tools/Python/mcplot/pyqtgraph/../../mccodelib/pqtgfrontend.py", line 62, in runplot
plot_node(node, self.plot_func, plt_layout, viewmodel)
File "/Applications/McStas-3.1.app/Contents/Resources/mcstas/3.1/tools/Python/mcplot/pyqtgraph/../../mccodelib/pqtgfrontend.py", line 144, in plot_node
viewbox_lst.append(add_plot(layout, node, plot_func, i, n, viewmodel))
File "/Applications/McStas-3.1.app/Contents/Resources/mcstas/3.1/tools/Python/mcplot/pyqtgraph/../../mccodelib/pqtgfrontend.py", line 382, in add_plot
view_box, plt_itm = plot_node_func(node, i, plt, options)
File "/Applications/McStas-3.1.app/Contents/Resources/mcstas/3.1/tools/Python/mcplot/pyqtgraph/plotfuncs.py", line 33, in plot
view_box, lyt = plot_Data2D(data, plt, log=opts['log'], legend=opts['legend'], icolormap=opts['icolormap'],
File "/Applications/McStas-3.1.app/Contents/Resources/mcstas/3.1/tools/Python/mcplot/pyqtgraph/plotfuncs.py", line 198, in plot_Data2D
img.setImage(dataset)
File "/opt/homebrew/lib/python3.9/site-packages/pyqtgraph/graphicsItems/ImageItem.py", line 286, in setImage
if self.image.shape[0] > 2**15-1 or self.image.shape[1] > 2**15-1:
IndexError: tuple index out of range
Investigation shows that the mccode.sim is truncated, ends like this:
begin data
Date: Mon Aug 08 10:54:02 2022 (1659948842)
type: array_2d(6, 5)
Source: EGCESE (BifrostFullSpectrometer.instr)
component: event_1
position: 1.52851 -1.55771 163.591
title: Intensity Position Position Energy Time_Of_Flight tof at sample Monitor (Square)
Ncount: 999936
filename: event_1_dat_list.p.x.y.E.t.U1
statistics: X0=0; dX=0; Y0=0; dY=0;
signal: Min=0.322215; Max=0.322215; Mean=0;
values: 0 0 0
xvar: List
yvar: p
xlabel: List of neutron events
ylabel: p x y E t U1
zvar: I
zlabel: Signal per bin
xylimits: 1 5 1 6
variables: p x y E t U1
It is uncertain wether the simulation ended up with a complete dataset later.
- We should consider to avoid monitor entries for event lists alltogether.
Related? It looks like the Python interpreter may have been overwhelmed by lots of text output from the many MPI cores...
(Here from 32 processes on DTU windows box)