1 # first test using cluster
5 CatalogResources="""<?xml version="1.0"?>
7 <machine name="localhost" hostname="dsp0698184" type="single_machine" appliPath="" batchQueue="" userCommands="" protocol="ssh" iprotocol="ssh" workingDirectory="" canLaunchBatchJobs="false" canRunContainers="true" batch="none" mpi="no mpi" userName="" OS="" memInMB="0" CPUFreqMHz="0" nbOfNodes="1" nbOfProcPerNode="4"/>
8 <machine name="athos" hostname="athos" type="cluster" appliPath="/home/H87074/ATHOS_V771/appli_V7_7_1" batchQueue="" userCommands="" protocol="ssh" iprotocol="ssh" workingDirectory="" canLaunchBatchJobs="true" canRunContainers="false" batch="slurm" mpi="no mpi" userName="" OS="" memInMB="0" CPUFreqMHz="0" nbOfNodes="250" nbOfProcPerNode="28"/>
11 def buildScheme(fname):
14 SALOMERuntime.RuntimeSALOME.setRuntime()
15 r=SALOMERuntime.getSALOMERuntime()
16 p0=r.createProc("run")
18 p=r.createBloc("toto")
21 cont=p0.createContainer("MyWonderfulContainer","Salome")
22 td=p0.createType("double","double")
23 n0=r.createScriptNode("Salome","PyScript0")
25 q=n0.edAddInputPort("q",td)
26 ep=n0.edAddOutputPort("ep",td)
27 n0.setScript("ep=1./(4.-q)") # <- force division by 0
28 n0.setExecutionMode("remote")
35 session=evalyfx.YACSEvalSession()
38 efx=evalyfx.YACSEvalYFX.BuildFromFile(fname)
39 efx.getParams().setStopASAPAfterErrorStatus(False)
40 inps=efx.getFreeInputPorts()
42 outps=efx.getFreeOutputPorts()
43 inps[0].setSequenceOfValuesToEval([-7.,2.,3.,5.,6.])
44 efx.lockPortsForEvaluation(inps,outps)
46 rss=efx.giveResources()
47 rss[0][0].setWantedMachine("athos")
48 cp=rss.getAddParamsForCluster() ; cp.setRemoteWorkingDir(os.path.join("/scratch",getpass.getuser(),"TMP3")) ; cp.setLocalWorkingDir(os.path.join(os.path.expanduser("~"),"TMP52"))
49 cp.setWCKey("P11U50:CARBONES") ; cp.setNbProcs(5) ; cp.setMaxDuration("00:05")
50 assert(not rss.isInteractive())
52 print("************",a,b)
53 print efx.getResults()