Ticket #1459 (closed: fixed)

Opened 10 years ago

Last modified 5 years ago

Mantid Algorithms inside PythonAlgorithms cause crash

Reported by: Michael Whitty Owned by: Martyn Gigg
Priority: major Milestone: Iteration 29
Component: Mantid Keywords:
Cc: Blocked By:
Blocking: Tester: Peter Peterson

Description

Running a python algorithm that contains main mantid algorithms causes a crash around ln 258 of algorithm.cpp example offending python algorithm attached

Attachments

fury_fftsplit_alg.py (1.4 KB) - added by Michael Whitty 10 years ago.

Change History

Changed 10 years ago by Michael Whitty

comment:1 Changed 10 years ago by Michael Whitty

Offending algortihms work when run from inside a Python script, but not when using the Algorithm dialog from algorithms pane. Calling the algorithm dialog function from a python script works, also.

Problem with how the algorithm pane calls the algorithms?

comment:2 Changed 10 years ago by Nick Draper

  • Milestone changed from Iteration 26 to Iteration 27

Bulk move of tickets to iteration 27, if your ticket is essential for Iteration 26 then move it back.

comment:3 Changed 10 years ago by Nick Draper

  • Milestone changed from Iteration 27 to Iteration 28

Bulk move of tickets at the end of iteration 27

comment:4 Changed 9 years ago by Nick Draper

  • Milestone changed from Iteration 28 to Iteration 29

Bulk move of tickets at the end of iteration 28

comment:5 Changed 9 years ago by Martyn Gigg

  • Status changed from new to accepted
  • Component set to Mantid

I think this is because the main original Python algorithm falls of the stack of managed algorithms when the internal ones are run as managed algorithms.

comment:6 Changed 9 years ago by Martyn Gigg

(In [11401]) Ensure that when algorithms are run using the simple API as part of a Python algorithm that they are unmanaged. If they are not then they can cause the main algorithm to be deleted before it is actaully finished./unmanaged_alg.py Refs #1459

comment:7 Changed 9 years ago by Martyn Gigg

Test case:

from MantidFramework import PythonAlgorithm, mtd, Direction
from mantidsimple import *

class SubAlgTest(PythonAlgorithm):
    
    def PyInit(self):
        self.declareProperty('Count', 1, Direction=Direction.Input)

    def PyExec(self):
        n_algs = self.getProperty('Count')
        print 'Number of algs',n_algs
        
        name = 'test_'
        dataX = [i for i in range(11)]
        dataY = [i for i in range(10)]
        dataE = [i for i in range(10)]

        for i in range(n_algs):
            CreateWorkspace(name + str(i), dataX, dataY, dataE, 1)            


mantid.registerPyAlgorithm(SubAlgTest())

Use a number that is higher than the algorithms.retained property.

comment:8 Changed 9 years ago by Martyn Gigg

(In [11404]) Fix the build and tests. Re #1459

comment:9 Changed 9 years ago by Martyn Gigg

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

I hope this is fixed now.

comment:10 Changed 9 years ago by Nick Draper

  • Status changed from verify to verifying
  • Tester set to Nick Draper

comment:11 Changed 9 years ago by Nick Draper

  • Status changed from verifying to verify
  • Tester Nick Draper deleted

comment:12 Changed 9 years ago by Peter Peterson

  • Status changed from verify to verifying
  • Tester set to Peter Peterson

comment:13 Changed 9 years ago by Peter Peterson

  • Status changed from verifying to closed

The tests run successfully.

comment:14 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 2306

Note: See TracTickets for help on using tickets.