From: Renaud Barate Date: Thu, 25 Apr 2013 15:44:42 +0000 (+0200) Subject: Fix distribution of computations in batch jobs X-Git-Tag: V7_2_0~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c25619ae58b301ac8b65f54dcb027ac769debb19;p=modules%2Fparametric.git Fix distribution of computations in batch jobs --- 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)