Ticket #1313 (closed: fixed)

Opened 10 years ago

Last modified 5 years ago

Modify SimpleRebin algorithm to work with EventWorkspace

Reported by: Janik Zikovsky Owned by: Janik Zikovsky
Priority: major Milestone: Iteration 24
Component: Keywords:
Cc: Blocked By:
Blocking: Tester: Michael Reuter

Description

SimpleRebin needs to check if its input workspace is an EventWorkspace, and simply setX in this case (it does not need to recalculate everything immediately).

Change History

comment:1 Changed 10 years ago by Janik Zikovsky

  • Status changed from new to accepted

comment:2 Changed 10 years ago by Janik Zikovsky

(In [4854]) Refs #1313; first go at modifying SimpleRebin to handle EventWorkspace. Can now determine the type of the input workspace and dynamic cast to an EventWorkspace.

comment:3 Changed 10 years ago by Janik Zikovsky

(In [4907]) Refs #1313 - disable test that is segfaulting.

comment:4 Changed 10 years ago by Janik Zikovsky

(In [4911]) Refs #1313, simpleRebin works with EventWorkspace, but only if inputworkspace = outputworkspace

comment:5 Changed 10 years ago by Janik Zikovsky

(In [4947]) Refs #1313, SimpleRebin works for a different output workspace too. Needs testing in GUI.

comment:6 Changed 10 years ago by Janik Zikovsky

(In [4958]) Refs #1267: throw an error if you access event list data after finishing; Also Refs #1313, axes set in simpleRebin

comment:7 Changed 10 years ago by Janik Zikovsky

(In [5049]) Refs #1296: set the default X histogram axis; fixed tof unit conversion. Also Refs #1313: simpleRebin Y unit is copied

comment:8 Changed 10 years ago by Russell Taylor

(In [5076]) Minor Rebin amendments. Re #1313.

comment:9 Changed 10 years ago by Russell Taylor

(In [5077]) Fix Windows build. Re #1313.

comment:10 Changed 10 years ago by Janik Zikovsky

(In [5081]) Refs #1313: fixes bug where input workspace was modified. Refs #1365: fix a test build error.

comment:11 Changed 10 years ago by Janik Zikovsky

(In [5248]) Refs #1313: sped up rebinning for EventWorkspace. Fixed memory leak when deleting EventWorkspace. Still can't recover memory when rebinning, though.

comment:12 Changed 10 years ago by Janik Zikovsky

(In [5264]) Refs #1313: Parallelized simple rebin code, in the case of EventWorkspace->WS2D

comment:13 Changed 10 years ago by Janik Zikovsky

  • Status changed from accepted to closed
  • Resolution set to fixed

(In [5266]) Closes #1313: SimpleRebin works reliably; valgrind does not find any memory leaks.

comment:14 Changed 10 years ago by Russell Taylor

  • Status changed from closed to reopened
  • Resolution fixed deleted

comment:15 Changed 10 years ago by Russell Taylor

(In [5316]) Use cow_ptr dereference operator where appropriate. Re #1313.

comment:16 Changed 10 years ago by Peter Peterson

(In [5339]) Copy properties from the parent. Refs #1313.

comment:17 Changed 10 years ago by Janik Zikovsky

  • Status changed from reopened to accepted

comment:18 Changed 10 years ago by Janik Zikovsky

(In [5602]) Refs #1313: fixed a bug with Event histogramming when the first event TOF was smaller than the first bin. Also, should fix test build that refs #1357.

comment:19 Changed 10 years ago by Janik Zikovsky

I am getting a semi-reproducible segfault in MantidPlot with the following steps:

  1. Load PG3_732 neutron event data.
  2. AlignDetectors in the same event workspace
  3. DiffractionFocussing, same WS
  4. Rebin: 0, 1e-3, 3.0; same WS
  5. Display data
  6. Plot all 3 spectra
  7. Rebin again: 1, 1e-6, 1.2. Sometimes this segfaults right away, sometimes I have to rebin a couple more times before it segfaults.

I reproduced this in the release but I am usually in a debug MantidPlot+libraries build.

comment:20 Changed 10 years ago by Janik Zikovsky

(Reposting to fix formatting)

I am getting a semi-reproducible segfault in MantidPlot with the following steps:

  1. Load PG3_732 neutron event data.
  2. AlignDetectors in the same event workspace
  3. DiffractionFocussing, same WS
  4. Rebin: 0, 1e-3, 3.0; same WS
  5. Display data
  6. Plot all 3 spectra
  7. Rebin again: 1, 1e-6, 1.2. Sometimes this segfaults right away, sometimes I have to rebin a couple more times before it segfaults.

I reproduced this in the release but I am usually in a debug MantidPlot+libraries build.

comment:21 Changed 10 years ago by Janik Zikovsky

I have identified the bug as being specific to MantidPlot, and in particular, you need to have a plot window open while rebinning for it to fail. Stack trace:

Thread [1] (Suspended: Signal 'SIGSEGV' received. Description: Segmentation fault.)

70 MantidQwtData::x() /home/janik/Code/Mantid/Code/qtiplot/qtiplot/src/Mantid/MantidCurve.cpp:377 0x000000000096c6c7 69 QwtPlotCurve::drawSteps(QPainter*, QwtScaleMap const&, QwtScaleMap const&, int, int) const() 0x00007ffff759ab52 68 QwtPlotCurve::draw(QPainter*, QwtScaleMap const&, QwtScaleMap const&, int, int) const() 0x00007ffff7598eb2 67 MantidCurve::draw() /home/janik/Code/Mantid/Code/qtiplot/qtiplot/src/Mantid/MantidCurve.cpp:163 0x000000000096ad52 66 QwtPlot::drawItems(QPainter*, QRect const&, QwtScaleMap const*, QwtPlotPrintFilter const&) const() 0x00007ffff7594960 65 Plot::drawItems() /home/janik/Code/Mantid/Code/qtiplot/qtiplot/src/Plot.cpp:223 0x000000000082294f 64 QwtPlot::drawCanvas() 0x00007ffff7594aba 63 QwtPlotCanvas::drawCanvas() 0x00007ffff75ada34 62 QwtPlotCanvas::drawContents() 0x00007ffff75adb86 61 QwtPlotCanvas::paintEvent() 0x00007ffff75add6f 60 QWidget::event() 0x00007ffff2b1e7a0 59 QFrame::event() 0x00007ffff2e7a2a6 58 QApplicationPrivate::notify_helper() 0x00007ffff2acfefc 57 QApplication::notify() 0x00007ffff2ad71ce 56 MantidApplication::notify() /home/janik/Code/Mantid/Code/qtiplot/qtiplot/src/Mantid/MantidApplication.cpp:23 0x00000000008f3af7 55 QCoreApplication::notifyInternal() 0x00007ffff2321c2c 54 QWidgetPrivate::drawWidget() 0x00007ffff2b25b93 53 QWidgetPrivate::paintSiblingsRecursive() 0x00007ffff2b262f0 52 QWidgetPrivate::paintSiblingsRecursive() 0x00007ffff2b26204 51 QWidgetPrivate::drawWidget() 0x00007ffff2b25803 50 QWidgetPrivate::paintSiblingsRecursive() 0x00007ffff2b262f0 49 QWidgetPrivate::drawWidget() 0x00007ffff2b25803 48 QWidgetPrivate::paintSiblingsRecursive() 0x00007ffff2b262f0 47 QWidgetPrivate::drawWidget() 0x00007ffff2b25803 46 QWidgetPrivate::paintSiblingsRecursive() 0x00007ffff2b262f0 45 QWidgetPrivate::drawWidget() 0x00007ffff2b25803 44 QWidgetPrivate::paintSiblingsRecursive() 0x00007ffff2b262f0 43 QWidgetPrivate::drawWidget() 0x00007ffff2b25803 42 QWidgetPrivate::paintSiblingsRecursive() 0x00007ffff2b262f0 41 QWidgetPrivate::drawWidget() 0x00007ffff2b25803 40 QWidgetPrivate::paintSiblingsRecursive() 0x00007ffff2b262f0 39 QWidgetPrivate::drawWidget() 0x00007ffff2b25803 38 QWidgetPrivate::paintSiblingsRecursive() 0x00007ffff2b262f0 37 QWidgetPrivate::drawWidget() 0x00007ffff2b25803 36 <symbol is not available> 0x00007ffff2c97e1e 35 QWidgetPrivate::syncBackingStore() 0x00007ffff2b17fa0 34 QWidget::event() 0x00007ffff2b1e5b8 33 QMainWindow::event() 0x00007ffff2e949db 32 QApplicationPrivate::notify_helper() 0x00007ffff2acfefc 31 QApplication::notify() 0x00007ffff2ad71ce 30 MantidApplication::notify() /home/janik/Code/Mantid/Code/qtiplot/qtiplot/src/Mantid/MantidApplication.cpp:23 0x00000000008f3af7 29 QCoreApplication::notifyInternal() 0x00007ffff2321c2c 28 <symbol is not available> 0x00007ffff2c95317 27 <symbol is not available> 0x00007ffff2c984f6 26 QWidget::repaint() 0x00007ffff2b19f1b 25 QwtPlotCanvas::replot() 0x00007ffff75adea0 24 QwtPlot::replot() 0x00007ffff7594d44 23 MantidCurve::dataReset() /home/janik/Code/Mantid/Code/qtiplot/qtiplot/src/Mantid/MantidCurve.cpp:275 0x000000000096bae4 22 MantidCurve::qt_metacall() /home/janik/Code/Mantid/Code/qtiplot/tmp/qtiplot/debug/moc_MantidCurve.cpp:75 0x0000000000a82401 21 QMetaObject::activate() 0x00007ffff2336ddc 20 MantidCurve::resetData() /home/janik/Code/Mantid/Code/qtiplot/tmp/qtiplot/debug/moc_MantidCurve.cpp:88 0x0000000000a82483 19 MantidCurve::afterReplaceHandle() /home/janik/Code/Mantid/Code/qtiplot/qtiplot/src/Mantid/MantidCurve.cpp:281 0x000000000096bbb3 18 ObserverCallback::handleAfterReplace() /home/janik/Code/Mantid/Code/qtiplot/qtiplot/src/Mantid/WorkspaceObserver.cpp:16 0x000000000096cdac 17 ObserverCallback::qt_metacall() /home/janik/Code/Mantid/Code/qtiplot/tmp/qtiplot/debug/moc_WorkspaceObserver.cpp:83 0x0000000000a82af2 16 QObject::event() 0x00007ffff23310f9 15 QApplicationPrivate::notify_helper() 0x00007ffff2acfefc 14 QApplication::notify() 0x00007ffff2ad71ce 13 MantidApplication::notify() /home/janik/Code/Mantid/Code/qtiplot/qtiplot/src/Mantid/MantidApplication.cpp:23 0x00000000008f3af7 12 QCoreApplication::notifyInternal() 0x00007ffff2321c2c 11 QCoreApplicationPrivate::sendPostedEvents() 0x00007ffff232280a 10 <symbol is not available> 0x00007ffff234a533 9 g_main_context_dispatch() 0x00007fffec5febce 8 <symbol is not available> 0x00007fffec602598 7 g_main_context_iteration() 0x00007fffec6026c0 6 QEventDispatcherGlib::processEvents() 0x00007ffff234a1a6 5 <symbol is not available> 0x00007ffff2b644be 4 QEventLoop::processEvents() 0x00007ffff2320532 3 QEventLoop::exec() 0x00007ffff2320904 2 QCoreApplication::exec() 0x00007ffff2322ab9 1 main() /home/janik/Code/Mantid/Code/qtiplot/qtiplot/src/main.cpp:175 0x000000000081d343

comment:22 Changed 10 years ago by Janik Zikovsky

Once again, the formatting was screwed up:

Thread [1] (Suspended: Signal 'SIGSEGV' received. Description: Segmentation fault.)	
	70 MantidQwtData::x() /home/janik/Code/Mantid/Code/qtiplot/qtiplot/src/Mantid/MantidCurve.cpp:377 0x000000000096c6c7	
	69 QwtPlotCurve::drawSteps(QPainter*, QwtScaleMap const&, QwtScaleMap const&, int, int) const()  0x00007ffff759ab52	
	68 QwtPlotCurve::draw(QPainter*, QwtScaleMap const&, QwtScaleMap const&, int, int) const()  0x00007ffff7598eb2	
	67 MantidCurve::draw() /home/janik/Code/Mantid/Code/qtiplot/qtiplot/src/Mantid/MantidCurve.cpp:163 0x000000000096ad52	
	66 QwtPlot::drawItems(QPainter*, QRect const&, QwtScaleMap const*, QwtPlotPrintFilter const&) const()  0x00007ffff7594960	
	65 Plot::drawItems() /home/janik/Code/Mantid/Code/qtiplot/qtiplot/src/Plot.cpp:223 0x000000000082294f	
	64 QwtPlot::drawCanvas()  0x00007ffff7594aba	
	63 QwtPlotCanvas::drawCanvas()  0x00007ffff75ada34	
	62 QwtPlotCanvas::drawContents()  0x00007ffff75adb86	
	61 QwtPlotCanvas::paintEvent()  0x00007ffff75add6f	
	60 QWidget::event()  0x00007ffff2b1e7a0	
	59 QFrame::event()  0x00007ffff2e7a2a6	
	58 QApplicationPrivate::notify_helper()  0x00007ffff2acfefc	
	57 QApplication::notify()  0x00007ffff2ad71ce	
	56 MantidApplication::notify() /home/janik/Code/Mantid/Code/qtiplot/qtiplot/src/Mantid/MantidApplication.cpp:23 0x00000000008f3af7	
	55 QCoreApplication::notifyInternal()  0x00007ffff2321c2c	
	54 QWidgetPrivate::drawWidget()  0x00007ffff2b25b93	
	53 QWidgetPrivate::paintSiblingsRecursive()  0x00007ffff2b262f0	
	52 QWidgetPrivate::paintSiblingsRecursive()  0x00007ffff2b26204	
	51 QWidgetPrivate::drawWidget()  0x00007ffff2b25803	
	50 QWidgetPrivate::paintSiblingsRecursive()  0x00007ffff2b262f0	
	49 QWidgetPrivate::drawWidget()  0x00007ffff2b25803	
	48 QWidgetPrivate::paintSiblingsRecursive()  0x00007ffff2b262f0	
	47 QWidgetPrivate::drawWidget()  0x00007ffff2b25803	
	46 QWidgetPrivate::paintSiblingsRecursive()  0x00007ffff2b262f0	
	45 QWidgetPrivate::drawWidget()  0x00007ffff2b25803	
	44 QWidgetPrivate::paintSiblingsRecursive()  0x00007ffff2b262f0	
	43 QWidgetPrivate::drawWidget()  0x00007ffff2b25803	
	42 QWidgetPrivate::paintSiblingsRecursive()  0x00007ffff2b262f0	
	41 QWidgetPrivate::drawWidget()  0x00007ffff2b25803	
	40 QWidgetPrivate::paintSiblingsRecursive()  0x00007ffff2b262f0	
	39 QWidgetPrivate::drawWidget()  0x00007ffff2b25803	
	38 QWidgetPrivate::paintSiblingsRecursive()  0x00007ffff2b262f0	
	37 QWidgetPrivate::drawWidget()  0x00007ffff2b25803	
	36 <symbol is not available> 0x00007ffff2c97e1e	
	35 QWidgetPrivate::syncBackingStore()  0x00007ffff2b17fa0	
	34 QWidget::event()  0x00007ffff2b1e5b8	
	33 QMainWindow::event()  0x00007ffff2e949db	
	32 QApplicationPrivate::notify_helper()  0x00007ffff2acfefc	
	31 QApplication::notify()  0x00007ffff2ad71ce	
	30 MantidApplication::notify() /home/janik/Code/Mantid/Code/qtiplot/qtiplot/src/Mantid/MantidApplication.cpp:23 0x00000000008f3af7	
	29 QCoreApplication::notifyInternal()  0x00007ffff2321c2c	
	28 <symbol is not available> 0x00007ffff2c95317	
	27 <symbol is not available> 0x00007ffff2c984f6	
	26 QWidget::repaint()  0x00007ffff2b19f1b	
	25 QwtPlotCanvas::replot()  0x00007ffff75adea0	
	24 QwtPlot::replot()  0x00007ffff7594d44	
	23 MantidCurve::dataReset() /home/janik/Code/Mantid/Code/qtiplot/qtiplot/src/Mantid/MantidCurve.cpp:275 0x000000000096bae4	
	22 MantidCurve::qt_metacall() /home/janik/Code/Mantid/Code/qtiplot/tmp/qtiplot/debug/moc_MantidCurve.cpp:75 0x0000000000a82401	
	21 QMetaObject::activate()  0x00007ffff2336ddc	
	20 MantidCurve::resetData() /home/janik/Code/Mantid/Code/qtiplot/tmp/qtiplot/debug/moc_MantidCurve.cpp:88 0x0000000000a82483	
	19 MantidCurve::afterReplaceHandle() /home/janik/Code/Mantid/Code/qtiplot/qtiplot/src/Mantid/MantidCurve.cpp:281 0x000000000096bbb3	
	18 ObserverCallback::handleAfterReplace() /home/janik/Code/Mantid/Code/qtiplot/qtiplot/src/Mantid/WorkspaceObserver.cpp:16 0x000000000096cdac	
	17 ObserverCallback::qt_metacall() /home/janik/Code/Mantid/Code/qtiplot/tmp/qtiplot/debug/moc_WorkspaceObserver.cpp:83 0x0000000000a82af2	
	16 QObject::event()  0x00007ffff23310f9	
	15 QApplicationPrivate::notify_helper()  0x00007ffff2acfefc	
	14 QApplication::notify()  0x00007ffff2ad71ce	
	13 MantidApplication::notify() /home/janik/Code/Mantid/Code/qtiplot/qtiplot/src/Mantid/MantidApplication.cpp:23 0x00000000008f3af7	
	12 QCoreApplication::notifyInternal()  0x00007ffff2321c2c	
	11 QCoreApplicationPrivate::sendPostedEvents()  0x00007ffff232280a	
	10 <symbol is not available> 0x00007ffff234a533	
	9 g_main_context_dispatch()  0x00007fffec5febce	
	8 <symbol is not available> 0x00007fffec602598	
	7 g_main_context_iteration()  0x00007fffec6026c0	
	6 QEventDispatcherGlib::processEvents()  0x00007ffff234a1a6	
	5 <symbol is not available> 0x00007ffff2b644be	
	4 QEventLoop::processEvents()  0x00007ffff2320532	
	3 QEventLoop::exec()  0x00007ffff2320904	
	2 QCoreApplication::exec()  0x00007ffff2322ab9	
	1 main() /home/janik/Code/Mantid/Code/qtiplot/qtiplot/src/main.cpp:175 0x000000000081d343	

comment:23 Changed 10 years ago by Janik Zikovsky

  • Status changed from accepted to verify

comment:24 Changed 10 years ago by Nick Draper

  • Resolution set to fixed

fill in missing resolution

comment:25 Changed 10 years ago by Michael Reuter

  • Status changed from verify to verifying
  • Tester set to Michael Reuter

comment:26 Changed 10 years ago by Michael Reuter

  • Status changed from verifying to closed

I have verified that the algorithm specified does work as intended. I can also reproduce the crash. My recommendation is to close this ticket as is and Janik will open a new one detailing the crash itself. The ticket for the crash is #1524.

comment:27 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 2160

Note: See TracTickets for help on using tickets.