Ticket #4752 (closed: fixed)

Opened 9 years ago

Last modified 5 years ago

System test is hanging due to read/write locking

Reported by: Janik Zikovsky Owned by: Janik Zikovsky
Priority: blocker Milestone: Release 2.1
Component: Mantid Keywords:
Cc: martyn.gigg@… Blocked By:
Blocking: Tester: Martyn Gigg

Description

Here is the smallest code to reproduce the problem:

LoadEventNexus(OutputWorkspace="EQSANS_4061_event", Filename="EQSANS_4061_event.nxs")
EQSANSNormalise(InputWorkspace="EQSANS_4061_event", NormaliseToBeam='0')

The issue is that there is a parent python algorithm (EQSANSNormalise) that calls child algorithms (Scale) but these are not marked as such.

The way read/write locking works for C++ algorithms with children is:

  • The parent algorithm locks the input/output workspaces
  • The child algorithms do NOT do any locking.

With the EQSANSNormalise, it has its InputWorkspace erroneously set as "Input" (not InOut which is what it really is).

  • EQSANSNormalise read-locks the workspace
  • Then Scale tries to write-lock, so it hangs.

If EQSANSNormalise has its InputWorkspace set as InOut, it throws an exception when trying to double-write-lock.

So Martyn, what I need to do is to have the algorithms called in a Python algorithm to be set as "child". Do you know how to do that?

Change History

comment:1 Changed 9 years ago by Janik Zikovsky

Refs #4554 debugging output for locking

Changeset: dc5a5b22ded47a49b80cb6ffd7d990d697b74eb4

comment:2 Changed 9 years ago by Janik Zikovsky

Refs #2636, #4752: make python algo's child algorithms set as children

Changeset: 2685a3810c9032b3a82319362f73d6d9c47bbe2c

comment:3 Changed 9 years ago by Janik Zikovsky

Refs #2636, #4752: method for children of python algorithms

Changeset: cb95b77c2142d57d65ce2834ac31a481ce5cc9f4

comment:4 Changed 9 years ago by Janik Zikovsky

Refs #2636, #4752: enabling use of the method for

python algorithm child algos

Changeset: 377a143c163aabdedf25c8cd16da428751b33220

comment:5 Changed 9 years ago by Janik Zikovsky

  • Status changed from new to accepted

comment:6 Changed 9 years ago by Janik Zikovsky

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

Looks like system tests / python algorithms with children no longer hang.

comment:7 Changed 9 years ago by Janik Zikovsky

  • Status changed from verify to reopened
  • Resolution fixed deleted

I made a mistake and left the locking disabled when I last checked in. Some system tests are indeed failing.

comment:8 Changed 9 years ago by Janik Zikovsky

For example:

from MantidFramework import *
mtd.initialise(False)
from mantidsimple import *
from reduction.instruments.sans.hfir_command_interface import *

mtd.settings['default.facility'] = 'HFIR'
HFIRSANS()
    
DirectBeamCenter("BioSANS_empty_cell.xml")
AppendDataFile("BioSANS_test_data.xml")
SetTransmission(0.51944, 0.011078)
SensitivityCorrection("BioSANS_flood_data.xml", dark_current="BioSANS_dark_current.xml")
AzimuthalAverage(binning="0.01,0.001,0.11", error_weighting=True)
Reduce1D()

it gets stuck trying to double-write lock on SANSSensitivityCorrection calling Load calling HFIRLoad.

My guess is that Load does NOT transmit the "child" parameter.

comment:9 Changed 9 years ago by Janik Zikovsky

  • Status changed from reopened to accepted

comment:10 Changed 9 years ago by Janik Zikovsky

Refs #4752: make AlgorithmProxy pass-through 'child' setting

To fix SANS system tests

Changeset: 85724e66af676c36ea94e681040cdc37bc117758

comment:11 Changed 9 years ago by Janik Zikovsky

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

comment:12 Changed 8 years ago by Martyn Gigg

  • Status changed from verify to verifying
  • Tester set to Martyn Gigg

comment:13 Changed 8 years ago by Martyn Gigg

  • Status changed from verifying to closed

The system tests are no longer hanging. I can also confirm that this works as when I removed the child status of child algorithms in python things did hang.

comment:14 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 5599

Note: See TracTickets for help on using tickets.