def defaultWorkingDir(resource):
resManager = salome_proxy.getResourcesManager()
- resource_definition = resManager.GetResourceDefinition(resource)
+ resource_definition = resManager.GetResourceDefinitionJob(resource)
return resource_definition.working_directory
def defaultNbBranches(resource):
Return the number of cores available on a resource.
"""
resManager = salome_proxy.getResourcesManager()
- resource_definition = resManager.GetResourceDefinition(resource)
+ resource_definition = resManager.GetResourceDefinitionContainer(resource)
ret = resource_definition.nb_node * resource_definition.nb_proc_per_node
if ret < 1:
ret = 1
( "canRunContainers" attribute set to true in CatalogResources.xml )
"""
resManager = salome_proxy.getResourcesManager()
- params = salome_proxy.createSalomeParameters()
- params.resource_required.can_run_containers = True
- resources = resManager.GetFittingResources(params.resource_required)
+ resources = resManager.ListAllResourcesInCatalogContainer()
return sum([defaultNbBranches(res) for res in resources ])
def defaultBaseDirectory():
Ydefx can launch the evaluations in a job on one of these resources.
"""
resManager = salome_proxy.getResourcesManager()
- params = salome_proxy.createSalomeParameters()
- params.resource_required.can_launch_batch_jobs = True
- # GetFittingResources returns a tuple if in no salome session mode.
- # Force to list for uniformity between the two modes.
- return list(resManager.GetFittingResources(params.resource_required))
+ return resManager.ListAllResourcesInCatalogJob()
def exportConfig(dicconfig, directory = None):
""" Save the configuration to a directory.
#newobj.salome_parameters.specific_parameters = self.salome_parameters.specific_parameters
newobj.salome_parameters.resource_required.name = self.salome_parameters.resource_required.name
newobj.salome_parameters.resource_required.hostname = self.salome_parameters.resource_required.hostname
- newobj.salome_parameters.resource_required.can_launch_batch_jobs = self.salome_parameters.resource_required.can_launch_batch_jobs
- newobj.salome_parameters.resource_required.can_run_containers = self.salome_parameters.resource_required.can_run_containers
newobj.salome_parameters.resource_required.OS = self.salome_parameters.resource_required.OS
newobj.salome_parameters.resource_required.nb_proc = self.salome_parameters.resource_required.nb_proc
newobj.salome_parameters.resource_required.mem_mb = self.salome_parameters.resource_required.mem_mb
"resource_required" : {
"name" : self.salome_parameters.resource_required.name,
"hostname" : self.salome_parameters.resource_required.hostname,
- "can_launch_batch_jobs" : self.salome_parameters.resource_required.can_launch_batch_jobs,
- "can_run_containers" : self.salome_parameters.resource_required.can_run_containers,
"OS" : self.salome_parameters.resource_required.OS,
"nb_proc" : self.salome_parameters.resource_required.nb_proc,
"mem_mb" : self.salome_parameters.resource_required.mem_mb,
self.salome_parameters.extra_params = dico["salome_parameters"]["extra_params"]
self.salome_parameters.resource_required.name = dico["salome_parameters"]["resource_required"]["name"]
self.salome_parameters.resource_required.hostname = dico["salome_parameters"]["resource_required"]["hostname"]
- self.salome_parameters.resource_required.can_launch_batch_jobs = dico["salome_parameters"]["resource_required"]["can_launch_batch_jobs"]
- self.salome_parameters.resource_required.can_run_containers = dico["salome_parameters"]["resource_required"]["can_run_containers"]
self.salome_parameters.resource_required.OS = dico["salome_parameters"]["resource_required"]["OS"]
self.salome_parameters.resource_required.nb_proc = dico["salome_parameters"]["resource_required"]["nb_proc"]
self.salome_parameters.resource_required.mem_mb = dico["salome_parameters"]["resource_required"]["mem_mb"]
_default()
if _use_salome_servers:
result = salome.JobParameters()
- result.resource_required = salome.ResourceParameters()
+ result.resource_required = salome.ResourceParametersContainer()
else:
result = pylauncher.JobParameters_cpp()
return result