1 def buildScheme(fname):
4 SALOMERuntime.RuntimeSALOME.setRuntime()
5 r=SALOMERuntime.getSALOMERuntime()
7 td=p.createType("double","double")
9 cont=p.createContainer("zeCont","Salome")
11 n0=r.createFuncNode("Salome","node0")
15 n0.setScript("""def func0(a,b):
18 n0.setExecutionMode("remote")
19 a=n0.edAddInputPort("a",td)
20 b=n0.edAddInputPort("b",td) ; b.edInitPy(1.3)
21 c=n0.edAddOutputPort("c",td)
23 n1=r.createFuncNode("Salome","node1")
27 n1.setScript("""def func1(a,b):
30 n1.setExecutionMode("remote")
31 d=n1.edAddInputPort("d",td)
32 e=n1.edAddInputPort("e",td) ; e.edInitPy(2.5) # agy : useless but for test
33 f=n1.edAddOutputPort("f",td)
34 g=n1.edAddOutputPort("g",td)
43 session=evalyfx.YACSEvalSession()
46 efx=evalyfx.YACSEvalYFX.BuildFromFile(fileName)
47 inps=efx.getFreeInputPorts()
49 inps[0].setDefaultValue(3.4)
51 inps[0].setDefaultValue(None)
52 inps[2].setDefaultValue(2.7)
53 inps[2].setDefaultValue(None)
55 outps=efx.getFreeOutputPorts()
56 # prepare for execution
57 inps[0].setDefaultValue(1.1)
58 inps[1].setSequenceOfValuesToEval([10.1,10.2,10.3])
59 a=inps[2].hasSequenceOfValuesToEval()
60 inps[2].setSequenceOfValuesToEval([20.1,20.2,30.3,40.4])
61 a=inps[2].hasSequenceOfValuesToEval()
62 inps[2].setSequenceOfValuesToEval([20.1,20.2,30.3])
63 efx.lockPortsForEvaluation([inps[1],inps[2]],[outps[0],outps[2]])
66 g=efx.getUndergroundGeneratedGraph()
67 g.saveSchema("toto.xml")
68 rss=efx.giveResources()
69 rss[0][0].setWantedMachine("localhost")
73 assert(efx.getResults()==[[11.110000000000001, 11.22, 11.330000000000002], [93.63, 94.26, 124.89000000000001]])
77 #l=loader.YACSLoader()
78 #p=l.load("/home/H87074/aaaaaaa.xml")
79 #ex=pilot.ExecutorSwig()
80 #ex.RunW(efx.getUndergroundGeneratedGraph())
87 zePath=os.path.join(os.environ["KERNEL_ROOT_DIR"],"bin","salome","appliskel")
88 sys.path.append(zePath)
89 import salome_test_session
90 port=salome_test_session.startSession(shutdownAtExit=False)
91 omniorb_cfg=os.environ["OMNIORB_CONFIG"]
92 SALOMERuntime.RuntimeSALOME.setRuntime()
93 r=SALOMERuntime.getSALOMERuntime()
95 p=l.load("/home/H87074/aaaaaaa.xml")
96 ex=pilot.ExecutorSwig()
98 salome_test_session.terminateSession(port)