1 # bug revealed by otgui on 8/2/16. Several lock/unlock session. test1.xml is Cogeneration.xml.
3 def buildScheme(fname):
6 SALOMERuntime.RuntimeSALOME.setRuntime()
7 r=SALOMERuntime.getSALOMERuntime()
9 cont=p.createContainer("MyWonderfulContainer","Salome")
10 td=p.createType("double","double")
11 n0=r.createScriptNode("Salome","PyScript0")
13 q=n0.edAddInputPort("q",td)
14 e=n0.edAddInputPort("e",td)
15 c=n0.edAddInputPort("c",td)
16 ep=n0.edAddOutputPort("ep",td)
17 n0.setScript("ep=1-(q/((e/((1-0.05)*0.54))+(c/0.8)))")
18 n0.setExecutionMode("remote")
25 session=evalyfx.YACSEvalSession()
27 efx=evalyfx.YACSEvalYFX.BuildFromFile(fname)
28 efx.setParallelizeStatus(False)
29 inps=efx.getFreeInputPorts()
30 outps=efx.getFreeOutputPorts()
32 inp.setSequenceOfValuesToEval([0.2,0.3])
33 efx.lockPortsForEvaluation(inps,outps)
34 rss=efx.giveResources()
35 rss[0][0].setWantedMachine("localhost")
36 a,b=efx.run(session) ; assert(a)
38 for ii,inp in enumerate(inps):
39 inp.setSequenceOfValuesToEval([0.5,0.6,0.7])
40 efx.lockPortsForEvaluation(inps,outps)
41 a,b=efx.run(session) ; assert(a)
43 for ii,inp in enumerate(inps):
44 inp.setSequenceOfValuesToEval([0.5,0.6,0.7])
45 efx.lockPortsForEvaluation(inps,outps)
46 a,b=efx.run(session) ; assert(a)