From a30d58a195f1fb25a579ae0bfd0184a20a77d9e1 Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Mon, 9 Dec 2024 09:27:07 +0100 Subject: [PATCH 1/6] rm not discoverer modules #117 --- .../benchmarking/reframe/config/machineConfigs/discoverer.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.py b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.py index 34ccaa18..5f4b1cbe 100644 --- a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.py +++ b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.py @@ -14,8 +14,6 @@ 'access': ['--partition=cn --account=ehpc-dev-2024d05-047 --qos=ehpc-dev-2024d05-047'], 'environs': ['default'], 'prepare_cmds': [ - 'source /etc/profile.d/modules.sh', - 'export MODULEPATH=/opt/software/modulefiles', 'export OMP_NUM_THREADS=1' # Just in case ], 'processor': { From 6d1c8665868561b1fb0873fe98a3a2eebdd8f26c Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Mon, 9 Dec 2024 11:25:09 +0100 Subject: [PATCH 2/6] rm prepare_cmds #117 --- .../benchmarking/reframe/config/machineConfigs/discoverer.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.py b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.py index 5f4b1cbe..ea308cf2 100644 --- a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.py +++ b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.py @@ -13,9 +13,6 @@ 'max_jobs': 8, 'access': ['--partition=cn --account=ehpc-dev-2024d05-047 --qos=ehpc-dev-2024d05-047'], 'environs': ['default'], - 'prepare_cmds': [ - 'export OMP_NUM_THREADS=1' # Just in case - ], 'processor': { 'num_cpus': 128 }, From dcda346d3321ec775b91967fcff9af5bcd6a7733 Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Mon, 9 Dec 2024 11:28:08 +0100 Subject: [PATCH 3/6] add optional env_variables to schema #117 --- src/feelpp/benchmarking/reframe/config/configSchemas.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/feelpp/benchmarking/reframe/config/configSchemas.py b/src/feelpp/benchmarking/reframe/config/configSchemas.py index b425ef08..70348998 100644 --- a/src/feelpp/benchmarking/reframe/config/configSchemas.py +++ b/src/feelpp/benchmarking/reframe/config/configSchemas.py @@ -74,6 +74,7 @@ class Platform(BaseModel): input_dir:Optional[str] = None options:Optional[List[str]]= [] append_app_options:Optional[List[str]]= [] + env_variables:Optional[Dict] = {} class AdditionalFiles(BaseModel): description_filepath: Optional[str] = None @@ -86,6 +87,7 @@ class ConfigFile(BaseModel): output_directory:str use_case_name: str options: List[str] + env_variables:Optional[Dict] = {} outputs: List[AppOutput] scalability: Scalability sanity: Sanity From e7d5e3171876ad6c0907b9ba9df4e0250f9a8f61 Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Mon, 9 Dec 2024 11:28:18 +0100 Subject: [PATCH 4/6] add example of env_variables #117 --- config/toolbox_heat/thermal_bridges_case_3.json | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/config/toolbox_heat/thermal_bridges_case_3.json b/config/toolbox_heat/thermal_bridges_case_3.json index 6b2aa4c6..3c3d44ce 100644 --- a/config/toolbox_heat/thermal_bridges_case_3.json +++ b/config/toolbox_heat/thermal_bridges_case_3.json @@ -14,11 +14,13 @@ "--bind {{machine.input_dataset_base_dir}}/{{use_case_name}}/:{{platforms.apptainer.input_dir}}", "--env OMP_NUM_THREADS=1" ], - "append_app_option":[] + "append_app_option":[], + "env_variables":{} }, "builtin":{ "input_dir":"{{machine.input_dataset_base_dir}}/{{use_case_name}}/", - "append_app_option":[] + "append_app_option":[], + "env_variables":{} } }, "options": [ @@ -30,6 +32,9 @@ "--case.discretization {{parameters.discretization.value}}", "--heat.json.patch='{\"op\": \"replace\",\"path\": \"/Meshes/heat/Import/filename\",\"value\": \"{{platforms.{{machine.platform}}.input_dir}}/partitioning/case3/{{parameters.meshes.value}}/case3_p{{parameters.nb_tasks.tasks.value}}.json\" }'" ], + "env_variables":{ + "OMP_NUM_THREADS":1 + }, "outputs": [ { "filepath": "{{output_directory}}/{{instance}}/{{use_case_name}}/heat.measures/values.csv", From c2a594cd1dfefc52762186e01c73af93e057cebf Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Mon, 9 Dec 2024 11:35:49 +0100 Subject: [PATCH 5/6] rm platform env variables They should be passed under options (--env) --- config/toolbox_heat/thermal_bridges_case_3.json | 6 ++---- src/feelpp/benchmarking/reframe/config/configSchemas.py | 1 - 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/config/toolbox_heat/thermal_bridges_case_3.json b/config/toolbox_heat/thermal_bridges_case_3.json index 3c3d44ce..40992688 100644 --- a/config/toolbox_heat/thermal_bridges_case_3.json +++ b/config/toolbox_heat/thermal_bridges_case_3.json @@ -14,13 +14,11 @@ "--bind {{machine.input_dataset_base_dir}}/{{use_case_name}}/:{{platforms.apptainer.input_dir}}", "--env OMP_NUM_THREADS=1" ], - "append_app_option":[], - "env_variables":{} + "append_app_option":[] }, "builtin":{ "input_dir":"{{machine.input_dataset_base_dir}}/{{use_case_name}}/", - "append_app_option":[], - "env_variables":{} + "append_app_option":[] } }, "options": [ diff --git a/src/feelpp/benchmarking/reframe/config/configSchemas.py b/src/feelpp/benchmarking/reframe/config/configSchemas.py index 70348998..5f8fb79c 100644 --- a/src/feelpp/benchmarking/reframe/config/configSchemas.py +++ b/src/feelpp/benchmarking/reframe/config/configSchemas.py @@ -74,7 +74,6 @@ class Platform(BaseModel): input_dir:Optional[str] = None options:Optional[List[str]]= [] append_app_options:Optional[List[str]]= [] - env_variables:Optional[Dict] = {} class AdditionalFiles(BaseModel): description_filepath: Optional[str] = None From 45274b4f268be4b67b544ed0c3b31c0b0a572424 Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Mon, 9 Dec 2024 11:36:29 +0100 Subject: [PATCH 6/6] set env variables --- src/feelpp/benchmarking/reframe/setup.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/feelpp/benchmarking/reframe/setup.py b/src/feelpp/benchmarking/reframe/setup.py index 771fdcd3..84f251e4 100644 --- a/src/feelpp/benchmarking/reframe/setup.py +++ b/src/feelpp/benchmarking/reframe/setup.py @@ -133,7 +133,11 @@ def setupBeforeRun(self,rfm_test,machine_config): self.setExecutable(rfm_test,machine_config) def setupAfterInit(self, rfm_test): - pass + self.setEnvVariables() + + def setEnvVariables(self): + for env_var_name,env_var_value in self.reader.config.env_variables.items(): + os.environ[env_var_name] = env_var_value def cleanupDirectories(self): if os.path.exists(self.reader.config.scalability.directory):