# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
import pydefx
+import salome
+salome.salome_init()
myParams = None
self.myScript.loadString(pyScript)
self.mySample = self.myScript.CreateEmptySample()
#
- #print(fArgs)
- #print(iterable)
- #
if not hasattr(iterable[0],"__iter__"):
iterable = [[elt] for elt in iterable]
#
- #print(pyScript)
- #print({k:v for k,*v in zip(fArgs,*iterable)})
- #
self.mySample.setInputValues( {k:v for k,*v in zip(fArgs,*iterable)} )
#
self.myStudy.createNewJob(self.myScript, self.mySample, myParams)
#
self.myStudy.launch()
self.myStudy.wait()
+ self.myStudy.getResult()
#
- return self.myStudy.getResult()
+ ret = [elt for elt in zip(*[self.myStudy.sample._output[n] for n in self.myStudy.sample.getOutputNames()])]
+ if len(self.myStudy.sample.getOutputNames()) == 1:
+ ret = [elt[0] for elt in ret]
+ return ret
def __enter__(self):
self.myStudy = pydefx.PyStudy()
pass
pass
+def getResourcesAbleToLaunchJobs():
+ """
+ Regarding list of Resources in the CatalogResources.xml this method returns those able to launch jobs.
+ Ydefx engine delegate to a job encapsulating itself an execution of YACS graph with driver application.
+ Consequently, the resource to evaluate in parallel the function should one of those returned by this method.
+ """
+ import LifeCycleCORBA
+ params = LifeCycleCORBA.ResourceParameters(can_launch_batch_jobs=True)
+ # ask to resource manager to filter among all resources listed in CatalogResources those able to launch job.
+ return salome.rm.GetFittingResources(params)
+
+
def init(resultDirectory = "/tmp"):
"""
:param resourceName: Name of the resource matching one of the ${KERNEL_ROOT_DIR}/share/salome/resources/kernel/CatalogResources.xml
"""
global myParams
myParams = pydefx.Parameters()
+
+ # pour cluster avec 10 noeuds de 28 coeurs chacuns
+ #
+
+ # On positionne la resource qui va lancer le job qui inclu drive
+ # rmyParams.nb_branches = 4
myParams.configureResource("localhost")
myParams.createResultDirectory(resultDirectory)
+ myParams.nb_branches = 280
+ myParams.salome_parameters.
+ # myParams.salome_parameters.work_directory = wd
pass