From c25619ae58b301ac8b65f54dcb027ac769debb19 Mon Sep 17 00:00:00 2001 From: Renaud Barate Date: Thu, 25 Apr 2013 17:44:42 +0200 Subject: [PATCH] Fix distribution of computations in batch jobs --- idl/PARAMETRIC_Gen.idl | 3 ++- src/PARAMETRIC/PARAMETRIC.py | 5 +++-- src/PARAMETRICGUI/PARAMETRICGUI.py | 2 +- src/salome/parametric/genjob.py | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/idl/PARAMETRIC_Gen.idl b/idl/PARAMETRIC_Gen.idl index 7531ac2..6d24fbd 100644 --- a/idl/PARAMETRIC_Gen.idl +++ b/idl/PARAMETRIC_Gen.idl @@ -40,7 +40,8 @@ interface PARAMETRIC_Gen : Engines::EngineComponent, SALOMEDS::Driver raises (SALOME::SALOME_Exception); void RunStudy(in long salomeStudyID, - in SALOMEDS::ID entry) + in SALOMEDS::ID entry, + in boolean localOnly) raises (SALOME::SALOME_Exception); void ExportToCSV(in long salomeStudyID, diff --git a/src/PARAMETRIC/PARAMETRIC.py b/src/PARAMETRIC/PARAMETRIC.py index 39f18df..f5ea47f 100644 --- a/src/PARAMETRIC/PARAMETRIC.py +++ b/src/PARAMETRIC/PARAMETRIC.py @@ -171,7 +171,7 @@ class PARAMETRIC(PARAMETRIC_ORB__POA.PARAMETRIC_Gen, SALOME_ComponentPy_i, SALOM self.salome_runtime.addCatalog(self.session_catalog) return self.salome_runtime - def RunStudy(self, salomeStudyID, entry): + def RunStudy(self, salomeStudyID, entry, localOnly): try: self.beginService("PARAMETRIC.RunStudy") @@ -196,7 +196,8 @@ class PARAMETRIC(PARAMETRIC_ORB__POA.PARAMETRIC_Gen, SALOME_ComponentPy_i, SALOM proc.edAddChild(foreach) distrib_container = proc.createContainer("DistribContainer") - distrib_container.setProperty("hostname", "localhost") + if localOnly: + distrib_container.setProperty("hostname", "localhost") if param_study.solver_code_type == ParametricStudy.SALOME_COMPONENT: solver_code = param_study.salome_component_name diff --git a/src/PARAMETRICGUI/PARAMETRICGUI.py b/src/PARAMETRICGUI/PARAMETRICGUI.py index c7cbcc2..a0ddcf4 100644 --- a/src/PARAMETRICGUI/PARAMETRICGUI.py +++ b/src/PARAMETRICGUI/PARAMETRICGUI.py @@ -202,7 +202,7 @@ def run_study(): ed = ParametricStudyEditor() entry = salome.sg.getSelected(0) engine = ed.find_or_create_engine() - engine.RunStudy(ed.study_id, entry) + engine.RunStudy(ed.study_id, entry, True) qapp.restoreOverrideCursor() except SALOME.SALOME_Exception, exc: qapp.restoreOverrideCursor() diff --git a/src/salome/parametric/genjob.py b/src/salome/parametric/genjob.py index 04c0aa0..63a8111 100644 --- a/src/salome/parametric/genjob.py +++ b/src/salome/parametric/genjob.py @@ -43,7 +43,7 @@ ed.loadComponentEngine(scomp, "ParametricContainer") comp = scomp.GetObject() # run parametric study -comp.RunStudy(study._get_StudyId(), "%(param_entry)s") +comp.RunStudy(study._get_StudyId(), "%(param_entry)s", False) # save study salome.myStudyManager.SaveAs("%(output_study)s", study, False) -- 2.39.2