From fca883be7b83e284c0559e9e53df763888c6d316 Mon Sep 17 00:00:00 2001 From: Jean-Philippe ARGAUD Date: Wed, 6 May 2020 18:47:14 +0200 Subject: [PATCH] Adding potential management of YACS execution in separate containers --- bin/AdaoCatalogGenerator.py | 2 + doc/en/ref_assimilation_keywords.rst | 2 + doc/en/ref_checking_keywords.rst | 2 + doc/en/snippets/ExecuteInContainer.rst | 16 +++ doc/fr/ref_assimilation_keywords.rst | 2 + doc/fr/ref_checking_keywords.rst | 2 + doc/fr/snippets/ExecuteInContainer.rst | 17 +++ src/daEficas/generator_adao.py | 7 ++ .../daYacsSchemaCreator/help_methods.py | 4 + .../daYacsSchemaCreator/infos_daComposant.py | 6 +- src/daSalome/daYacsSchemaCreator/methods.py | 108 +++++++++++++++--- 11 files changed, 150 insertions(+), 18 deletions(-) create mode 100644 doc/en/snippets/ExecuteInContainer.rst create mode 100644 doc/fr/snippets/ExecuteInContainer.rst diff --git a/bin/AdaoCatalogGenerator.py b/bin/AdaoCatalogGenerator.py index 25fae6a..ec0a494 100644 --- a/bin/AdaoCatalogGenerator.py +++ b/bin/AdaoCatalogGenerator.py @@ -297,6 +297,7 @@ ASSIMILATION_STUDY = PROC(nom="ASSIMILATION_STUDY", StudyName = SIMP(statut="o", typ = "TXM", defaut="ADAO Calculation Case"), StudyRepertory = SIMP(statut="f", typ = "Repertoire", validators=FunctionVal(ChDir), min=1, max=1), Debug = SIMP(statut="f", typ = "I", into=(0, 1), defaut=0), + ExecuteInContainer = SIMP(statut="f", typ = "TXM", min=1, max=1, defaut = "No", into=("No", "Mono", "Multi")), AlgorithmParameters = F_AlgorithmParameters("o",({algos_names}), AlgorithmParametersInNS), Background = F_Background("o", BackgroundInNS), BackgroundError = F_BackgroundError("o", BackgroundErrorInNS), @@ -319,6 +320,7 @@ CHECKING_STUDY = PROC(nom="CHECKING_STUDY", StudyName = SIMP(statut="o", typ = "TXM", defaut="ADAO Checking Case"), StudyRepertory = SIMP(statut="f", typ = "Repertoire", validators=FunctionVal(ChDir), min=1, max=1), Debug = SIMP(statut="f", typ = "I", into=(0, 1), defaut=0), + ExecuteInContainer = SIMP(statut="f", typ = "TXM", min=1, max=1, defaut = "No", into=("No", "Mono", "Multi")), AlgorithmParameters = F_AlgorithmParameters("o", ({check_names}), AlgorithmParametersInNS), CheckingPoint = F_CheckingPoint("o", CheckingPointInNS), Background = F_Background("f", BackgroundInNS), diff --git a/doc/en/ref_assimilation_keywords.rst b/doc/en/ref_assimilation_keywords.rst index c18f3e6..f23ca7e 100644 --- a/doc/en/ref_assimilation_keywords.rst +++ b/doc/en/ref_assimilation_keywords.rst @@ -50,6 +50,8 @@ The different commands are the following: .. include:: snippets/EvolutionModel.rst +.. include:: snippets/ExecuteInContainer.rst + .. include:: snippets/InputVariables.rst .. include:: snippets/Observation.rst diff --git a/doc/en/ref_checking_keywords.rst b/doc/en/ref_checking_keywords.rst index 897caa8..f527fa3 100644 --- a/doc/en/ref_checking_keywords.rst +++ b/doc/en/ref_checking_keywords.rst @@ -44,6 +44,8 @@ The different commands are the following: .. include:: snippets/Debug.rst +.. include:: snippets/ExecuteInContainer.rst + .. include:: snippets/Observation.rst .. include:: snippets/ObservationError.rst diff --git a/doc/en/snippets/ExecuteInContainer.rst b/doc/en/snippets/ExecuteInContainer.rst new file mode 100644 index 0000000..06a2f67 --- /dev/null +++ b/doc/en/snippets/ExecuteInContainer.rst @@ -0,0 +1,16 @@ +.. index:: single: ExecuteInContainer + +ExecuteInContainer + *Optional command*. This variable allows to choose the execution mode in YACS + in a specific container. In its absence or if its value is "No", no separate + container is used for execution and it runs in the main YACS process. If its + value is "Mono", a specific YACS container is created and it is used to host + the execution of all nodes in the same process. If its value is "Multi", a + specific YACS container is created and it is used to host the execution of + each node in a specific process. The default value is "No", and the possible + choices are "No", "Mono" and "Multi". + + .. warning:: + + in its present version, this command is experimental, and therefore remains + subject to changes in future versions. diff --git a/doc/fr/ref_assimilation_keywords.rst b/doc/fr/ref_assimilation_keywords.rst index 5fec9ae..43e9ed8 100644 --- a/doc/fr/ref_assimilation_keywords.rst +++ b/doc/fr/ref_assimilation_keywords.rst @@ -50,6 +50,8 @@ Les différentes commandes sont les suivantes: .. include:: snippets/EvolutionModel.rst +.. include:: snippets/ExecuteInContainer.rst + .. include:: snippets/InputVariables.rst .. include:: snippets/Observation.rst diff --git a/doc/fr/ref_checking_keywords.rst b/doc/fr/ref_checking_keywords.rst index 966cd7b..ea6c270 100644 --- a/doc/fr/ref_checking_keywords.rst +++ b/doc/fr/ref_checking_keywords.rst @@ -44,6 +44,8 @@ Les différentes commandes sont les suivantes: .. include:: snippets/Debug.rst +.. include:: snippets/ExecuteInContainer.rst + .. include:: snippets/Observation.rst .. include:: snippets/ObservationError.rst diff --git a/doc/fr/snippets/ExecuteInContainer.rst b/doc/fr/snippets/ExecuteInContainer.rst new file mode 100644 index 0000000..89f9f21 --- /dev/null +++ b/doc/fr/snippets/ExecuteInContainer.rst @@ -0,0 +1,17 @@ +.. index:: single: ExecuteInContainer + +ExecuteInContainer + *Commande optionnelle*. Cette variable permet de choisir le mode d'exécution + dans YACS en container spécifique. En son absence ou si sa valeur est "No", + il n'est pas utilisé de container séparé pour l'exécution et elle se déroule + dans le processus principal de YACS. Si sa valeur est "Mono", un container + YACS spécifique est crée et il est utilisé pour héberger l'exécution de tous + les noeuds dans un même processus. Si sa valeur est "Multi", un container + YACS spécifique est crée et il est utilisé pour héberger l'exécution de + chaque noeud dans un processus spécifique. La valeur par défaut est "No", et + les choix possibles sont "No", "Mono" et "Multi". + + .. warning:: + + dans sa présente version, cet commande est expérimentale, et reste donc + susceptible de changements dans les prochaines versions. diff --git a/src/daEficas/generator_adao.py b/src/daEficas/generator_adao.py index 897c51f..9dae78c 100644 --- a/src/daEficas/generator_adao.py +++ b/src/daEficas/generator_adao.py @@ -145,6 +145,13 @@ class AdaoGenerator(PythonGenerator): # Extraction du StudyRepertory if "__"+self.type_of_study+"__StudyRepertory" in self.dictMCVal.keys(): self.text_da += "study_config['Repertory'] = '" + self.dictMCVal["__"+self.type_of_study+"__StudyRepertory"] + "'\n" + + # Extraction du ExecuteInContainer + if "__"+self.type_of_study+"__ExecuteInContainer" in self.dictMCVal.keys(): + self.text_da += "study_config['ExecuteInContainer'] = '" + str(self.dictMCVal["__"+self.type_of_study+"__ExecuteInContainer"]) + "'\n" + else: + self.text_da += "study_config['ExecuteInContainer'] = 'No'\n" + # Extraction de UserPostAnalysis if "__"+self.type_of_study+"__UserPostAnalysis__FROM" in self.dictMCVal.keys(): self.add_UserPostAnalysis() diff --git a/src/daSalome/daYacsSchemaCreator/help_methods.py b/src/daSalome/daYacsSchemaCreator/help_methods.py index 23f91a0..b8ea312 100644 --- a/src/daSalome/daYacsSchemaCreator/help_methods.py +++ b/src/daSalome/daYacsSchemaCreator/help_methods.py @@ -69,6 +69,10 @@ def check_study(study_config): raise ValueError("\n\n Study repertory should be an absolute path\n"+ " Repertory provided is %s\n" % repertory) + # ExecuteInContainer + if "ExecuteInContainer" not in study_config: + study_config["ExecuteInContainer"] = "No" + # Check if all the data is provided for key in AlgoDataRequirements[study_config["Algorithm"]]: if key not in study_config.keys(): diff --git a/src/daSalome/daYacsSchemaCreator/infos_daComposant.py b/src/daSalome/daYacsSchemaCreator/infos_daComposant.py index 54a62cb..7a05abc 100644 --- a/src/daSalome/daYacsSchemaCreator/infos_daComposant.py +++ b/src/daSalome/daYacsSchemaCreator/infos_daComposant.py @@ -329,5 +329,7 @@ ObserversList = [ "Residu", ] -# Regulation : # of containers, 0 for no container -UseYACSContainer = 1 +# Global regulation of separate container execution with priority on user: +# 0 for no separate execution container possibility +# 1 for separate execution container possibility +UseSeparateContainer = 1 diff --git a/src/daSalome/daYacsSchemaCreator/methods.py b/src/daSalome/daYacsSchemaCreator/methods.py index 580483b..81d38c8 100644 --- a/src/daSalome/daYacsSchemaCreator/methods.py +++ b/src/daSalome/daYacsSchemaCreator/methods.py @@ -77,8 +77,25 @@ def create_yacs_proc(study_config): else: base_repertory = "" repertory = False - if UseYACSContainer: + if "ExecuteInContainer" in list(study_config.keys()): + if study_config["ExecuteInContainer"] == "Mono": + ExecuteInContainer = True + ExecuteInModeMulti = False + elif study_config["ExecuteInContainer"] == "Multi": + ExecuteInContainer = True + ExecuteInModeMulti = True + else: # cas "No" + ExecuteInContainer = False + ExecuteInModeMulti = False + else: + ExecuteInContainer = False + ExecuteInModeMulti = False + if ExecuteInContainer and bool(UseSeparateContainer): mycontainer = proc.createContainer("AdaoContainer") + if ExecuteInModeMulti: + # type : multi pour creer un nouveau container pour chaque noeud + # type : mono pour réutiliser le même container (defaut) + mycontainer.setProperty("type","multi") # Create ADAO case bloc ADAO_Case = runtime.createBloc("ADAO_Case_Bloc") @@ -111,6 +128,9 @@ def create_yacs_proc(study_config): CAS_node.getInputPort("OutputVariablesSizes").edInitPy(OutputVariablesSizes) ADAO_Case.edAddChild(CAS_node) + if ExecuteInContainer and bool(UseSeparateContainer): + CAS_node.setExecutionMode(SALOMERuntime.PythonNode.REMOTE_STR) + CAS_node.setContainer(mycontainer) # Adding an observer init node if an user defines some factory_init_observers_node = catalogAd.getNodeFromNodeMap("SetObserversNode") @@ -131,6 +151,9 @@ def create_yacs_proc(study_config): ADAO_Case.edAddChild(init_observers_node) ADAO_Case.edAddDFLink(init_observers_node.getOutputPort("has_observers"), CAS_node.getInputPort("has_observers")) ADAO_Case.edAddDFLink(init_observers_node.getOutputPort("observers"), CAS_node.getInputPort("observers")) + if ExecuteInContainer and bool(UseSeparateContainer): + init_observers_node.setExecutionMode(SALOMERuntime.PythonNode.REMOTE_STR) + init_observers_node.setContainer(mycontainer) # Step 0.5: Find if there is a user init node init_config = {} @@ -145,6 +168,9 @@ def create_yacs_proc(study_config): init_node_script += "init_data = user_script_module.init_data\n" init_node.setScript(init_node_script) ADAO_Case.edAddChild(init_node) + if ExecuteInContainer and bool(UseSeparateContainer): + init_node.setExecutionMode(SALOMERuntime.PythonNode.REMOTE_STR) + init_node.setContainer(mycontainer) # Step 1: get input data from user configuration @@ -164,6 +190,9 @@ def create_yacs_proc(study_config): _Internal_Add_dir_script_ports( back_node, data_config["Data"], repertory, base_repertory, t_string) back_node.edAddOutputPort(key, t_pyobj) ADAO_Case.edAddChild(back_node) + if ExecuteInContainer and bool(UseSeparateContainer): + back_node.setExecutionMode(SALOMERuntime.PythonNode.REMOTE_STR) + back_node.setContainer(mycontainer) # Set content of the node back_node_script = back_node.getScript() if key in init_config["Target"]: @@ -192,6 +221,9 @@ def create_yacs_proc(study_config): back_node.getInputPort("dict_in_string").edInitPy(data_config["Data"]) back_node.edAddOutputPort(key, t_pyobj) ADAO_Case.edAddChild(back_node) + if ExecuteInContainer and bool(UseSeparateContainer): + back_node.setExecutionMode(SALOMERuntime.PythonNode.REMOTE_STR) + back_node.setContainer(mycontainer) # Set content of the node back_node_script = back_node.getScript() if key in init_config["Target"]: @@ -212,6 +244,9 @@ def create_yacs_proc(study_config): back_node = factory_back_node.cloneNode("Get" + key) back_node.getInputPort("vector_in_string").edInitPy(data_config["Data"]) ADAO_Case.edAddChild(back_node) + if ExecuteInContainer and bool(UseSeparateContainer): + back_node.setExecutionMode(SALOMERuntime.PythonNode.REMOTE_STR) + back_node.setContainer(mycontainer) # Set content of the node back_node_script = back_node.getScript() if "Stored" in data_config: @@ -239,6 +274,9 @@ def create_yacs_proc(study_config): _Internal_Add_dir_script_ports( back_node, data_config["Data"], repertory, base_repertory, t_string) back_node.edAddOutputPort(key, t_pyobj) ADAO_Case.edAddChild(back_node) + if ExecuteInContainer and bool(UseSeparateContainer): + back_node.setExecutionMode(SALOMERuntime.PythonNode.REMOTE_STR) + back_node.setContainer(mycontainer) # Set content of the node back_node_script = back_node.getScript() if key in init_config["Target"]: @@ -273,6 +311,9 @@ def create_yacs_proc(study_config): colmajor = False back_node.getInputPort("colmajor").edInitPy(colmajor) # On impose le concept, et le schéma YACS est ammendable ADAO_Case.edAddChild(back_node) + if ExecuteInContainer and bool(UseSeparateContainer): + back_node.setExecutionMode(SALOMERuntime.PythonNode.REMOTE_STR) + back_node.setContainer(mycontainer) # Set content of the node back_node_script = back_node.getScript() if "Stored" in data_config: @@ -299,6 +340,9 @@ def create_yacs_proc(study_config): back_node = factory_back_node.cloneNode("Get" + key) back_node.getInputPort("vector_in_string").edInitPy(data_config["Data"]) ADAO_Case.edAddChild(back_node) + if ExecuteInContainer and bool(UseSeparateContainer): + back_node.setExecutionMode(SALOMERuntime.PythonNode.REMOTE_STR) + back_node.setContainer(mycontainer) # Set content of the node back_node_script = back_node.getScript() if "Stored" in data_config: @@ -326,6 +370,9 @@ def create_yacs_proc(study_config): _Internal_Add_dir_script_ports( back_node, data_config["Data"], repertory, base_repertory, t_string) back_node.edAddOutputPort(key, t_pyobj) ADAO_Case.edAddChild(back_node) + if ExecuteInContainer and bool(UseSeparateContainer): + back_node.setExecutionMode(SALOMERuntime.PythonNode.REMOTE_STR) + back_node.setContainer(mycontainer) # Set content of the node back_node_script = back_node.getScript() if key in init_config["Target"]: @@ -360,6 +407,9 @@ def create_yacs_proc(study_config): colmajor = False back_node.getInputPort("colmajor").edInitPy(colmajor) # On impose le concept, et le schéma YACS est ammendable ADAO_Case.edAddChild(back_node) + if ExecuteInContainer and bool(UseSeparateContainer): + back_node.setExecutionMode(SALOMERuntime.PythonNode.REMOTE_STR) + back_node.setContainer(mycontainer) # Set content of the node back_node_script = back_node.getScript() if "Stored" in data_config: @@ -386,6 +436,9 @@ def create_yacs_proc(study_config): back_node = factory_back_node.cloneNode("Get" + key) back_node.getInputPort("matrix_in_string").edInitPy(data_config["Data"]) ADAO_Case.edAddChild(back_node) + if ExecuteInContainer and bool(UseSeparateContainer): + back_node.setExecutionMode(SALOMERuntime.PythonNode.REMOTE_STR) + back_node.setContainer(mycontainer) # Set content of the node back_node_script = back_node.getScript() if "Stored" in data_config: @@ -413,6 +466,9 @@ def create_yacs_proc(study_config): _Internal_Add_dir_script_ports( back_node, data_config["Data"], repertory, base_repertory, t_string) back_node.edAddOutputPort(key, t_pyobj) ADAO_Case.edAddChild(back_node) + if ExecuteInContainer and bool(UseSeparateContainer): + back_node.setExecutionMode(SALOMERuntime.PythonNode.REMOTE_STR) + back_node.setContainer(mycontainer) # Set content of the node back_node_script = back_node.getScript() if "Stored" in data_config: @@ -478,9 +534,6 @@ def create_yacs_proc(study_config): break # We create a new pyscript node opt_script_nodeOO = runtime.createScriptNode("", "FunctionNodeOO") - if UseYACSContainer: - opt_script_nodeOO.setExecutionMode(SALOMERuntime.PythonNode.REMOTE_STR) - opt_script_nodeOO.setContainer(mycontainer) if repertory and os.path.exists(os.path.join(base_repertory, os.path.basename(script_filename))): script_filename = os.path.join(base_repertory, os.path.basename(script_filename)) try: @@ -509,9 +562,6 @@ def create_yacs_proc(study_config): # We create a new pyscript node opt_script_nodeOO = runtime.createScriptNode("", "FunctionNodeOO") - if UseYACSContainer: - opt_script_nodeOO.setExecutionMode(SALOMERuntime.PythonNode.REMOTE_STR) - opt_script_nodeOO.setContainer(mycontainer) if repertory and os.path.exists(os.path.join(base_repertory, os.path.basename(script_filename))): script_filename = os.path.join(base_repertory, os.path.basename(script_filename)) try: @@ -594,9 +644,6 @@ def create_yacs_proc(study_config): # We create a new pyscript node opt_script_nodeOO = runtime.createScriptNode("", "FunctionNodeOO") - if UseYACSContainer: - opt_script_nodeOO.setExecutionMode(SALOMERuntime.PythonNode.REMOTE_STR) - opt_script_nodeOO.setContainer(mycontainer) if repertory and os.path.exists(os.path.join(base_repertory, os.path.basename(script_filename))): script_filename = os.path.join(base_repertory, os.path.basename(script_filename)) try: @@ -626,10 +673,10 @@ def create_yacs_proc(study_config): node_script += """except NameError:\n""" node_script += """ raise ValueError("ComputationFunctionNode: DirectOperator not found in the imported user script file")\n""" if sys.version_info.major < 3: - node_script += """from daNumerics import ApproximatedDerivatives\n""" + node_script += """from daCore import NumericObjects\n""" else: - node_script += """from adao.daNumerics import ApproximatedDerivatives\n""" - node_script += """FDA = ApproximatedDerivatives.FDApproximation(\n""" + node_script += """from adao.daCore import NumericObjects\n""" + node_script += """FDA = NumericObjects.FDApproximation(\n""" node_script += """ Function = DirectOperator,\n""" node_script += """ increment = %s,\n"""%str(ScriptWithOneFunction['DifferentialIncrement']) node_script += """ centeredDF = %s,\n"""%str(ScriptWithOneFunction['CenteredFiniteDifference']) @@ -676,6 +723,10 @@ def create_yacs_proc(study_config): else: factory_opt_script_node = catalogAd.getNodeFromNodeMap("FakeOptimizerLoopNode") opt_script_nodeOO = factory_opt_script_node.cloneNode("FakeFunctionNode") + # + if ExecuteInContainer and bool(UseSeparateContainer): + opt_script_nodeOO.setExecutionMode(SALOMERuntime.PythonNode.REMOTE_STR) + opt_script_nodeOO.setContainer(mycontainer) # Check if we have a python script for OptimizerLoopNode if "EvolutionModel" in list(study_config.keys()): @@ -830,10 +881,10 @@ def create_yacs_proc(study_config): node_script += """except NameError:\n""" node_script += """ raise ValueError("ComputationFunctionNode: DirectOperator not found in the imported user script file")\n""" if sys.version_info.major < 3: - node_script += """from daNumerics import ApproximatedDerivatives\n""" + node_script += """from daCore import NumericObjects\n""" else: - node_script += """from adao.daNumerics import ApproximatedDerivatives\n""" - node_script += """FDA = ApproximatedDerivatives.FDApproximation(\n""" + node_script += """from adao.daCore import NumericObjects\n""" + node_script += """FDA = NumericObjects.FDApproximation(\n""" node_script += """ Function = DirectOperator,\n""" node_script += """ increment = %s,\n"""%str(ScriptWithOneFunction['DifferentialIncrement']) node_script += """ centeredDF = %s,\n"""%str(ScriptWithOneFunction['CenteredFiniteDifference']) @@ -882,6 +933,10 @@ def create_yacs_proc(study_config): else: factory_opt_script_node = catalogAd.getNodeFromNodeMap("FakeOptimizerLoopNode") opt_script_nodeEM = factory_opt_script_node.cloneNode("FakeFunctionNode") + # + if ExecuteInContainer and bool(UseSeparateContainer): + opt_script_nodeEM.setExecutionMode(SALOMERuntime.PythonNode.REMOTE_STR) + opt_script_nodeEM.setContainer(mycontainer) # Add computation bloc if "Observers" in list(study_config.keys()): @@ -891,6 +946,9 @@ def create_yacs_proc(study_config): # Add a node that permits to configure the switch factory_read_for_switch_node = catalogAd.getNodeFromNodeMap("ReadForSwitchNode") read_for_switch_node = factory_read_for_switch_node.cloneNode("ReadForSwitch") + if ExecuteInContainer and bool(UseSeparateContainer): + read_for_switch_node.setExecutionMode(SALOMERuntime.PythonNode.REMOTE_STR) + read_for_switch_node.setContainer(mycontainer) execution_bloc.edAddChild(read_for_switch_node) ADAO_Case.edAddDFLink(optimizer_node.edGetSamplePort(), read_for_switch_node.getInputPort("data")) @@ -928,6 +986,9 @@ def create_yacs_proc(study_config): factory_extract_data_node = catalogAd.getNodeFromNodeMap("ExtractDataNode") extract_data_node = factory_extract_data_node.cloneNode("ExtractData") + if ExecuteInContainer and bool(UseSeparateContainer): + extract_data_node.setExecutionMode(SALOMERuntime.PythonNode.REMOTE_STR) + extract_data_node.setContainer(mycontainer) observer_bloc.edAddChild(extract_data_node) ADAO_Case.edAddDFLink(read_for_switch_node.getOutputPort("data"), extract_data_node.getInputPort("data")) @@ -942,12 +1003,18 @@ def create_yacs_proc(study_config): factory_observation_node = catalogAd.getNodeFromNodeMap("ObservationNodeFile") observation_node = factory_observation_node.cloneNode("Observation") _Internal_Add_dir_script_ports( observation_node, observer_cfg["Script"], repertory, base_repertory, t_string) + if ExecuteInContainer and bool(UseSeparateContainer): + observation_node.setExecutionMode(SALOMERuntime.PythonNode.REMOTE_STR) + observation_node.setContainer(mycontainer) observer_bloc.edAddChild(observation_node) ADAO_Case.edAddDFLink(extract_data_node.getOutputPort("var"), observation_node.getInputPort("var")) ADAO_Case.edAddDFLink(extract_data_node.getOutputPort("info"), observation_node.getInputPort("info")) factory_end_observation_node = catalogAd.getNodeFromNodeMap("EndObservationNode") end_observation_node = factory_end_observation_node.cloneNode("EndObservation") + if ExecuteInContainer and bool(UseSeparateContainer): + end_observation_node.setExecutionMode(SALOMERuntime.PythonNode.REMOTE_STR) + end_observation_node.setContainer(mycontainer) observer_bloc.edAddChild(end_observation_node) ADAO_Case.edAddCFLink(observation_node, end_observation_node) ADAO_Case.edAddDFLink(end_observation_node.getOutputPort("output"), optimizer_node.edGetPortForOutPool()) @@ -959,6 +1026,9 @@ def create_yacs_proc(study_config): # Add a node that permits to configure the switch factory_read_for_switch_node = catalogAd.getNodeFromNodeMap("ReadForSwitchNode") read_for_switch_node = factory_read_for_switch_node.cloneNode("ReadForSwitch") + if ExecuteInContainer and bool(UseSeparateContainer): + read_for_switch_node.setExecutionMode(SALOMERuntime.PythonNode.REMOTE_STR) + read_for_switch_node.setContainer(mycontainer) execution_bloc.edAddChild(read_for_switch_node) ADAO_Case.edAddDFLink(optimizer_node.edGetSamplePort(), read_for_switch_node.getInputPort("data")) @@ -1009,6 +1079,9 @@ def create_yacs_proc(study_config): if analysis_config["From"] == "String": factory_analysis_node = catalogAd.getNodeFromNodeMap("SimpleUserAnalysis") analysis_node = factory_analysis_node.cloneNode("UsePostAnalysis") + if ExecuteInContainer and bool(UseSeparateContainer): + analysis_node.setExecutionMode(SALOMERuntime.PythonNode.REMOTE_STR) + analysis_node.setContainer(mycontainer) default_script = analysis_node.getScript() final_script = default_script + analysis_config["Data"] analysis_node.setScript(final_script) @@ -1030,6 +1103,9 @@ def create_yacs_proc(study_config): elif analysis_config["From"] == "Script": factory_analysis_node = catalogAd.getNodeFromNodeMap("SimpleUserAnalysis") analysis_node = factory_analysis_node.cloneNode("UserPostAnalysis") + if ExecuteInContainer and bool(UseSeparateContainer): + analysis_node.setExecutionMode(SALOMERuntime.PythonNode.REMOTE_STR) + analysis_node.setContainer(mycontainer) default_script = analysis_node.getScript() analysis_file_name = analysis_config["Data"] if repertory and os.path.exists(os.path.join(base_repertory, os.path.basename(analysis_file_name))): -- 2.39.2