From e5bf5f2ff7281be555893f806430085977816380 Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Wed, 13 Nov 2024 15:21:34 +0100 Subject: [PATCH 01/55] start discoverer reframe config #117 --- .../config/machineConfigs/discoverer.py | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.py diff --git a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.py b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.py new file mode 100644 index 00000000..a8d4bcb8 --- /dev/null +++ b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.py @@ -0,0 +1,50 @@ +site_configuration = { + 'systems':[ + { + 'name': 'discoverer', + 'descr': 'Discoverer', + 'hostnames': ['login\d+.discoverer.sofiatech.bg','cn*'], + 'modules_system': 'tmod4', + 'partitions': [ + { + 'name': 'cn', + 'scheduler': 'slurm', + 'launcher': 'srun', + 'max_jobs': 8, + 'access': ['--partition=cn'], #ENV VAR? TODO: add --account and --qos + 'environs': ['apptainer'], + 'prepare_cmds': [ + 'source /etc/profile.d/modules.sh', + 'export MODULEPATH=/opt/software/modulefiles', + 'export PATH=/opt/apptainer/v1.3.3/apptainer/bin/:$PATH' #NEEDED ? + ], + 'processor': { + 'num_cpus': 128 #VALIDATE + }, + 'devices': [ + { + 'type': 'cpu', + 'num_devices': 1320 #VALIDATE + } + ], + 'container_platforms':[ + { + 'type': 'Apptainer' # DOES IT WORK ? OR NEED 'Singularity'? + } + ], + 'sched_options': { 'use_nodes_option': True }, + } + ], + 'env_vars':[ + ["OMP_NUM_THREADS",1] + ] + } + ], + 'environments': [ + { + 'name':'apptainer', + 'modules': ['python/3/3.9/latest','openmpi/4/gcc/latest'], + 'target_systems':['discoverer:cn'] + } + ] +} \ No newline at end of file From c59132f18124aab1b67ce05442d3397094370bef Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Wed, 13 Nov 2024 15:22:04 +0100 Subject: [PATCH 02/55] start discoverer machine config #117 --- config/machines/discoverer.json | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 config/machines/discoverer.json diff --git a/config/machines/discoverer.json b/config/machines/discoverer.json new file mode 100644 index 00000000..2add11cc --- /dev/null +++ b/config/machines/discoverer.json @@ -0,0 +1,18 @@ +{ + "machine": "discoverer", + "execution_policy": "async", + "partitions":["cn"], + "prog_environment":"apptainer", + "launch_options":["-bind-to core"], + "reframe_base_dir":"$PWD/build/reframe", + "reports_base_dir":"$PWD/reports/", + "input_dataset_base_dir":"", + "output_app_dir":"", + "containers":{ + "apptainer":{ + "cachedir": "", + "tmpdir": "", + "image_base_dir":"" + } + } +} \ No newline at end of file From 742457ab386c687a6eecb80332877843f346c67f Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Tue, 26 Nov 2024 09:27:53 +0100 Subject: [PATCH 03/55] rm tmp and cache dirs from discoverer #117 --- config/machines/discoverer.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/config/machines/discoverer.json b/config/machines/discoverer.json index 2add11cc..782ac18c 100644 --- a/config/machines/discoverer.json +++ b/config/machines/discoverer.json @@ -10,8 +10,6 @@ "output_app_dir":"", "containers":{ "apptainer":{ - "cachedir": "", - "tmpdir": "", "image_base_dir":"" } } From 162fcba9fd3a7f6261f1607683b09d0ab8966760 Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Tue, 3 Dec 2024 16:50:58 +0100 Subject: [PATCH 04/55] up discoverer config #117 --- .../reframe/config/machineConfigs/discoverer.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.py b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.py index a8d4bcb8..7c173e46 100644 --- a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.py +++ b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.py @@ -11,7 +11,7 @@ 'scheduler': 'slurm', 'launcher': 'srun', 'max_jobs': 8, - 'access': ['--partition=cn'], #ENV VAR? TODO: add --account and --qos + 'access': ['--partition=cn --account=ehpc-dev-2024d05-047 --qos=ehpc-dev-2024d05-047'], 'environs': ['apptainer'], 'prepare_cmds': [ 'source /etc/profile.d/modules.sh', @@ -19,8 +19,14 @@ 'export PATH=/opt/apptainer/v1.3.3/apptainer/bin/:$PATH' #NEEDED ? ], 'processor': { - 'num_cpus': 128 #VALIDATE + 'num_cpus': 128 }, + 'resources': [ + { + 'name':'launcher_options', + 'options':['-bind-to','core'] + } + ], 'devices': [ { 'type': 'cpu', From 21f51d3f60c0e812d3c136985b364cadd9ad6fdb Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Tue, 3 Dec 2024 17:04:04 +0100 Subject: [PATCH 05/55] rm discoverer (will use girder to store for safety) #117 --- config/machines/discoverer.json | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 config/machines/discoverer.json diff --git a/config/machines/discoverer.json b/config/machines/discoverer.json deleted file mode 100644 index 782ac18c..00000000 --- a/config/machines/discoverer.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "machine": "discoverer", - "execution_policy": "async", - "partitions":["cn"], - "prog_environment":"apptainer", - "launch_options":["-bind-to core"], - "reframe_base_dir":"$PWD/build/reframe", - "reports_base_dir":"$PWD/reports/", - "input_dataset_base_dir":"", - "output_app_dir":"", - "containers":{ - "apptainer":{ - "image_base_dir":"" - } - } -} \ No newline at end of file From 72cfa033ea115e315cadd084b2c8ace70f7634be Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Tue, 3 Dec 2024 17:27:36 +0100 Subject: [PATCH 06/55] rename environ #117 --- .../benchmarking/reframe/config/machineConfigs/discoverer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.py b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.py index 7c173e46..9a5b5b81 100644 --- a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.py +++ b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.py @@ -12,7 +12,7 @@ 'launcher': 'srun', 'max_jobs': 8, 'access': ['--partition=cn --account=ehpc-dev-2024d05-047 --qos=ehpc-dev-2024d05-047'], - 'environs': ['apptainer'], + 'environs': ['default'], 'prepare_cmds': [ 'source /etc/profile.d/modules.sh', 'export MODULEPATH=/opt/software/modulefiles', @@ -48,7 +48,7 @@ ], 'environments': [ { - 'name':'apptainer', + 'name':'default', 'modules': ['python/3/3.9/latest','openmpi/4/gcc/latest'], 'target_systems':['discoverer:cn'] } From 21b991c74571b4f07eaa24d336072be26abd7195 Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Wed, 4 Dec 2024 09:29:26 +0100 Subject: [PATCH 07/55] up heat thermal bridges config --- .../toolbox_heat/thermal_bridges_case_3.json | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/config/toolbox_heat/thermal_bridges_case_3.json b/config/toolbox_heat/thermal_bridges_case_3.json index b2e0da5e..6c8cdb1f 100644 --- a/config/toolbox_heat/thermal_bridges_case_3.json +++ b/config/toolbox_heat/thermal_bridges_case_3.json @@ -1,17 +1,18 @@ { "executable": "feelpp_toolbox_heat", - "output_directory": "{{machine.output_app_dir}}/toolboxes/heat/thermal_bridges_case_3", - "use_case_name": "thermal_bridges_case_3", + "output_directory": "{{machine.output_app_dir}}/toolboxes/heat/ThermalBridgesENISO10211/Case3", + "use_case_name": "ThermalBridgesENISO10211", "timeout":"0-01:00:00", "platforms": { "apptainer":{ "image": { - "name":"{{machine.containers.apptainer.image_base_dir}}/feelpp.sif" + "name":"{{machine.containers.apptainer.image_base_dir}}/feelpp-noble.sif" }, "input_dir":"/input_data/", "options": [ "--home {{machine.output_app_dir}}", - "--bind {{machine.input_dataset_base_dir}}/{{use_case_name}}/:{{platforms.apptainer.input_dir}}" + "--bind {{machine.input_dataset_base_dir}}/{{use_case_name}}/:{{platforms.apptainer.input_dir}}", + "--env OMP_NUM_THREADS=1" ], "append_app_option":[] }, @@ -21,14 +22,13 @@ } }, "options": [ - "--config-files {{platforms.{{machine.platform}}.input_dir}}/case3.cfg", + "--config-files /usr/share/feelpp/data/testcases/toolboxes/heat/cases/Building/ThermalBridgesENISO10211/case3.cfg {{platforms.{{machine.platform}}.input_dir}}/{{parameters.solver.value}}.cfg", "--directory {{output_directory}}/{{instance}}", "--repository.case {{use_case_name}}", - "--fail-on-unknown-option 1", "--heat.scalability-save=1", "--repository.append.np 0", "--case.discretization {{parameters.discretization.value}}", - "--heat.json.patch='{\"op\": \"replace\",\"path\": \"/Meshes/heat/Import/filename\",\"value\": \"$cfgdir/{{parameters.meshes.value}}/case3_p{{parameters.nb_tasks.tasks.value}}.json\" }'" + "--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\" }'" ], "outputs": [ { @@ -67,7 +67,7 @@ { "name": "nb_tasks", "sequence": [ - {"tasks":128,"nodes":1,"exclusive_access":true} + {"tasks":128,"tasks_per_node":128,"exclusive_access":true} ] }, { @@ -77,6 +77,10 @@ { "name": "discretization", "sequence": ["P1"] + }, + { + "name": "solver", + "sequence": ["gamg"] } ] } \ No newline at end of file From 004378c13662872eaaf3b5468e1bed111564f78d Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Wed, 4 Dec 2024 09:46:21 +0100 Subject: [PATCH 08/55] start dry-run mode #175 --- src/feelpp/benchmarking/reframe/__main__.py | 11 ++++++++++- src/feelpp/benchmarking/reframe/parser.py | 1 + src/feelpp/benchmarking/reframe/regression.py | 5 +++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/feelpp/benchmarking/reframe/__main__.py b/src/feelpp/benchmarking/reframe/__main__.py index 0440f5b0..461ca5d3 100644 --- a/src/feelpp/benchmarking/reframe/__main__.py +++ b/src/feelpp/benchmarking/reframe/__main__.py @@ -33,6 +33,15 @@ def createReportFolder(self,executable,use_case): return str(self.report_folder_path) + def buildExecutionMode(self): + """Write the ReFrame execution flag depending on the parser arguments. + Examples are --dry-run or -r + """ + if self.parser.args.dry_run: + return "--dry-run" + else: + return "-r" + def buildCommand(self,timeout): assert self.report_folder_path is not None, "Report folder path not set" cmd = [ @@ -47,7 +56,7 @@ def buildCommand(self,timeout): f"-J '#SBATCH --time={timeout}'", f'--perflogdir={os.path.join(self.machine_config.reframe_base_dir,"logs")}', f'{"-"+"v"*self.parser.args.verbose if self.parser.args.verbose else ""}', - '-r', + f'{self.buildExecutionMode()}' ] return ' '.join(cmd) diff --git a/src/feelpp/benchmarking/reframe/parser.py b/src/feelpp/benchmarking/reframe/parser.py index 99168715..af02ff51 100644 --- a/src/feelpp/benchmarking/reframe/parser.py +++ b/src/feelpp/benchmarking/reframe/parser.py @@ -83,6 +83,7 @@ def addArgs(self): options.add_argument('--verbose', '-v', action='count', default=0, help='Select Reframe\'s verbose level by specifying multiple v\'s. ') options.add_argument('--help', '-h', action='help', help='Display help and quit program') options.add_argument('--website', '-w', action='store_true', help='Render reports, compile them and create the website.') + options.add_argument('--dry-run', action='store_true', help='Execute ReFrame in dry-run mode. No tests will run, but the script to execute it will be generated in the stage directory. Config validation will be skipped, although warnings will be raised if bad.') def convertPathsToAbsolute(self): diff --git a/src/feelpp/benchmarking/reframe/regression.py b/src/feelpp/benchmarking/reframe/regression.py index fb0ad105..1a3a939c 100644 --- a/src/feelpp/benchmarking/reframe/regression.py +++ b/src/feelpp/benchmarking/reframe/regression.py @@ -18,6 +18,11 @@ def initHandlers(self): self.scalability_handler = ScalabilityHandler(self.app_setup.reader.config.scalability) self.outputs_handler = OutputsHandler(self.app_setup.reader.config.outputs,self.app_setup.reader.config.additional_files) + @run_after('run') + def executionGuard(self): + if self.is_dry_run(): + self.skip("ReFrame is in dry-run mode, perormance and sanity are not going to be evaluated.") + @run_before('performance') def setPerfVars(self): self.perf_variables = {} From 990cdb94a53ff1ff5a7daf08d0fa64ebe62a3c59 Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Wed, 4 Dec 2024 12:06:35 +0100 Subject: [PATCH 09/55] Add initial support for dry runs #175 (module loading is not working tho) --- src/feelpp/benchmarking/reframe/__main__.py | 4 ++-- .../reframe/config/configMachines.py | 8 ++++--- .../reframe/config/configReader.py | 9 ++++--- .../reframe/config/configSchemas.py | 24 ++++++++++++++----- src/feelpp/benchmarking/reframe/setup.py | 12 ++++------ 5 files changed, 35 insertions(+), 22 deletions(-) diff --git a/src/feelpp/benchmarking/reframe/__main__.py b/src/feelpp/benchmarking/reframe/__main__.py index 461ca5d3..fb691959 100644 --- a/src/feelpp/benchmarking/reframe/__main__.py +++ b/src/feelpp/benchmarking/reframe/__main__.py @@ -65,7 +65,7 @@ def main_cli(): parser = Parser() parser.printArgs() - machine_reader = ConfigReader(parser.args.machine_config,MachineConfig) + machine_reader = ConfigReader(parser.args.machine_config,MachineConfig,dry_run=parser.args.dry_run) machine_reader.updateConfig() #Sets the cachedir and tmpdir directories for containers @@ -91,7 +91,7 @@ def main_cli(): configs = [config_filepath] if parser.args.plots_config: configs += [parser.args.plots_config] - app_reader = ConfigReader(configs,ConfigFile) + app_reader = ConfigReader(configs,ConfigFile,dry_run=parser.args.dry_run) executable_name = os.path.basename(app_reader.config.executable).split(".")[0] report_folder_path = cmd_builder.createReportFolder(executable_name,app_reader.config.use_case_name) app_reader.updateConfig(machine_reader.processor.flattenDict(machine_reader.config,"machine")) diff --git a/src/feelpp/benchmarking/reframe/config/configMachines.py b/src/feelpp/benchmarking/reframe/config/configMachines.py index dda5b8df..450e3c5f 100644 --- a/src/feelpp/benchmarking/reframe/config/configMachines.py +++ b/src/feelpp/benchmarking/reframe/config/configMachines.py @@ -10,10 +10,13 @@ class Container(BaseModel): @field_validator("cachedir","tmpdir","image_base_dir",mode="before") @classmethod - def checkDirectories(cls,v): + def checkDirectories(cls,v, info): """Checks that the directories exists""" if v and not os.path.exists(v): - raise FileNotFoundError(f"Cannot find {v}") + if info.context.get("dry_run", False): + print(f"Dry Run: Skipping directory check for {v}") + else: + raise FileNotFoundError(f"Cannot find {v}") return v @@ -36,7 +39,6 @@ class MachineConfig(BaseModel): #TODO: maybe skipJsonSchema or something like that. environment_map: Optional[Dict[str,List[str]]] = {} - @model_validator(mode="after") def parseTargets(self): if not self.targets: diff --git a/src/feelpp/benchmarking/reframe/config/configReader.py b/src/feelpp/benchmarking/reframe/config/configReader.py index b7b159ad..0d17e41f 100644 --- a/src/feelpp/benchmarking/reframe/config/configReader.py +++ b/src/feelpp/benchmarking/reframe/config/configReader.py @@ -70,12 +70,15 @@ def decode(self, s: str): class ConfigReader: """ Class to load config files""" - def __init__(self, config_paths, schema): + def __init__(self, config_paths, schema, dry_run=False): """ Args: config_paths (str | list[str]) : Path to the config JSON file. If a list is provided, files will be merged. """ self.schema = schema + self.context = { + "dry_run":dry_run + } self.config = self.load( config_paths if type(config_paths) == list else [config_paths], schema @@ -97,7 +100,7 @@ def load(self,config_paths, schema): with open(config, "r") as cfg: self.config.update(json.load(cfg, cls=JSONWithCommentsDecoder)) - self.config = schema(**self.config) + self.config = schema.model_validate(self.config, context=self.context) return self.config @@ -109,7 +112,7 @@ def updateConfig(self, flattened_replace = None): """ if not flattened_replace: flattened_replace = self.processor.flattenDict(self.config.model_dump()) - self.config = self.schema(**self.processor.recursiveReplace(self.config.model_dump(),flattened_replace)) + self.config = self.schema.model_validate(self.processor.recursiveReplace(self.config.model_dump(),flattened_replace), context=self.context) def __repr__(self): return json.dumps(self.config.dict(), indent=4) \ No newline at end of file diff --git a/src/feelpp/benchmarking/reframe/config/configSchemas.py b/src/feelpp/benchmarking/reframe/config/configSchemas.py index c5fa2977..b425ef08 100644 --- a/src/feelpp/benchmarking/reframe/config/configSchemas.py +++ b/src/feelpp/benchmarking/reframe/config/configSchemas.py @@ -44,17 +44,29 @@ class Image(BaseModel): protocol:Optional[Literal["oras","docker","library","local"]] = None name:str - @model_validator(mode="after") - def extractProtocol(self): + @field_validator("protocol",mode="before") + @classmethod + def extractProtocol(cls, v, info): """ Extracts the image protocol (oras, docker, etc..) or if a local image is provided. If local, checks if the image exists """ - if "://" in self.name: - self.protocol = self.name.split("://")[0] + name = info.data.get("name","") + if "://" in name: + return name.split("://")[0] else: - self.protocol = "local" + return "local" - return self + @field_validator("name", mode="before") + @classmethod + def checkImage(cls,v,info): + if info.data["protocol"] == "local": + if not os.path.exists(v): + if info.context.get("dry_run", False): + print(f"Dry Run: Skipping image check for {v}") + else: + raise FileExistsError(f"Cannot find image {v}") + + return v class Platform(BaseModel): diff --git a/src/feelpp/benchmarking/reframe/setup.py b/src/feelpp/benchmarking/reframe/setup.py index 595264be..771fdcd3 100644 --- a/src/feelpp/benchmarking/reframe/setup.py +++ b/src/feelpp/benchmarking/reframe/setup.py @@ -6,7 +6,7 @@ from feelpp.benchmarking.reframe.outputs import OutputsHandler import reframe as rfm -import os, re, shutil +import os, re, shutil, sys import numpy as np ##### TODO: This is very messy :( Rethink the design @@ -48,7 +48,7 @@ def __init__(self,config_filepath): config_filepath (str): Path of the machine configuration json file """ super().__init__() - self.reader = ConfigReader(config_filepath,MachineConfig) + self.reader = ConfigReader(config_filepath,MachineConfig, dry_run = "--dry-run" in sys.argv) self.updateConfig() def setupAfterInit(self,rfm_test,app_config): @@ -85,8 +85,6 @@ def setValidEnvironments(self, rfm_test): #Consider adding this to the docs rfm_test.valid_systems = [f"{self.reader.config.machine}:{part}" for part in self.reader.config.partitions] rfm_test.valid_prog_environs = self.reader.config.prog_environments - print("Valid Systems after init ", rfm_test.valid_systems) - print("Valid envs after init ", rfm_test.valid_prog_environs) def setPlatform(self, rfm_test,app_config): """ Sets the container_platform attributes @@ -95,8 +93,6 @@ def setPlatform(self, rfm_test,app_config): """ platform = app_config.platforms[self.reader.config.platform] if self.reader.config.platform != "builtin": - if not os.path.exists(platform.image.name): - raise FileExistsError(f"Cannot find image {platform.image.name}") rfm_test.container_platform.image = platform.image.name rfm_test.container_platform.options = platform.options + self.reader.config.containers[self.reader.config.platform].options rfm_test.container_platform.workdir = None @@ -119,7 +115,7 @@ def __init__(self,config_filepath,machine_config): """ super().__init__() self.config_filepath = config_filepath - self.reader = ConfigReader(config_filepath,ConfigFile) + self.reader = ConfigReader(config_filepath,ConfigFile, dry_run = "--dry-run" in sys.argv) self.updateConfig(self.reader.processor.flattenDict(machine_config,"machine")) self.updateConfig() @@ -256,4 +252,4 @@ def setupBeforeRun(self): self.job.launcher.options += self.current_partition.get_resource('launcher_options') self.machine_setup.setupBeforeRun(self) - self.app_setup.setupBeforeRun(self,self.machine_setup.reader.config) + self.app_setup.setupBeforeRun(self,self.machine_setup.reader.config) \ No newline at end of file From 7f64972cc9cbd3705961468944a4f5d41ef78ed9 Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Wed, 4 Dec 2024 13:42:04 +0100 Subject: [PATCH 10/55] add omp_num_threads just in case #117 --- .../benchmarking/reframe/config/machineConfigs/discoverer.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.py b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.py index 9a5b5b81..ae37d490 100644 --- a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.py +++ b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.py @@ -16,7 +16,8 @@ 'prepare_cmds': [ 'source /etc/profile.d/modules.sh', 'export MODULEPATH=/opt/software/modulefiles', - 'export PATH=/opt/apptainer/v1.3.3/apptainer/bin/:$PATH' #NEEDED ? + 'export PATH=/opt/apptainer/v1.3.3/apptainer/bin/:$PATH', #NEEDED ? + 'export OMP_NUM_THREADS=1' # Just in case ], 'processor': { 'num_cpus': 128 From de18c39f5d1044bed12ef0f581eb4348b844511f Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Wed, 4 Dec 2024 13:49:58 +0100 Subject: [PATCH 11/55] up timeout #117 --- config/toolbox_heat/thermal_bridges_case_3.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/toolbox_heat/thermal_bridges_case_3.json b/config/toolbox_heat/thermal_bridges_case_3.json index 6c8cdb1f..6b2aa4c6 100644 --- a/config/toolbox_heat/thermal_bridges_case_3.json +++ b/config/toolbox_heat/thermal_bridges_case_3.json @@ -2,7 +2,7 @@ "executable": "feelpp_toolbox_heat", "output_directory": "{{machine.output_app_dir}}/toolboxes/heat/ThermalBridgesENISO10211/Case3", "use_case_name": "ThermalBridgesENISO10211", - "timeout":"0-01:00:00", + "timeout":"0-00:10:00", "platforms": { "apptainer":{ "image": { From f951e0aa5714cf4bd65300e2f06b4572fc84b45a Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Wed, 4 Dec 2024 14:02:35 +0100 Subject: [PATCH 12/55] add plots config + add checkout in HPC res + up script options #117 --- .github/workflows/benchmark.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 345260b7..2afbaa3c 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -12,6 +12,9 @@ on: benchmark_config: description: 'Applcation related configuration' required: True + plots_config: + description: 'Plots related configuration' + required: True girder_folder_id: description: 'ID of the folder to upload to' required: True @@ -81,10 +84,13 @@ jobs: if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then bench_cfg_id=${{ github.event.inputs.benchmark_config }}; + plot_cfg_id=${{ github.event.inputs.plots_config }}; elif [[ "${{ github.event_name}}" == "repository_dispatch" ]]; then bench_cfg_id=${{ github.event.client_payload.benchmark_config }}; + plots_cfg_id=${{ github.event.client_payload.plots_config }}; fi girder-download -gid $bench_cfg_id -o ./tmp/ -fn "benchmark_config.json" + girder-download -gid $plots_cfg_id -o ./tmp/ -fn "plots.json" env: GIRDER_API_KEY: ${{secrets.GIRDER}} - name: pull_images @@ -102,6 +108,7 @@ jobs: name: config-artifacts path: | ./tmp/benchmark_config.json + ./tmp/plots.json ./tmp/machines/ benchmark: @@ -113,6 +120,7 @@ jobs: timeout-minutes: 7200 name: ${{matrix.machine}} steps: + - uses: actions/checkout@v4 - name: Download wheel uses: actions/download-artifact@v4 with: @@ -131,7 +139,7 @@ jobs: - name: Execute benchmarks run: | source .venv/bin/activate - execute-benchmark -ec ./${{matrix.machine_cfg}} --config ./tmp/benchmark_config.json --move-results ./tmp/results/ -v + execute-benchmark -mc ./${{matrix.machine_cfg}} -bc ./tmp/benchmark_config.json -pc ./tmp/plots.json --move-results ./tmp/results/ -v - name: Upload reframe report uses: actions/upload-artifact@v4 with: From 448554697bc2df3e990a706df3db36f4946890ed Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Wed, 4 Dec 2024 14:08:18 +0100 Subject: [PATCH 13/55] typo... [ci skip] --- .github/workflows/benchmark.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 2afbaa3c..b2c08e41 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -84,7 +84,7 @@ jobs: if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then bench_cfg_id=${{ github.event.inputs.benchmark_config }}; - plot_cfg_id=${{ github.event.inputs.plots_config }}; + plots_cfg_id=${{ github.event.inputs.plots_config }}; elif [[ "${{ github.event_name}}" == "repository_dispatch" ]]; then bench_cfg_id=${{ github.event.client_payload.benchmark_config }}; plots_cfg_id=${{ github.event.client_payload.plots_config }}; From f58d291cd31214c9b3c22c2e61c0231c57d6ac42 Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Wed, 4 Dec 2024 14:20:56 +0100 Subject: [PATCH 14/55] add python version #117 --- .github/workflows/benchmark.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index b2c08e41..08c17644 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -133,9 +133,9 @@ jobs: path: ./tmp/ - name: Create Virtual Environment run: | - python3 -m venv .venv + python${{matrix.python_version}} -m venv .venv source .venv/bin/activate - pip3 install -r requirements.txt + python${{matrix.python_version}} -m pip install -r requirements.txt - name: Execute benchmarks run: | source .venv/bin/activate From a43ab8d19b6974cc49ed7b5e3777f203e3a34b7a Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Wed, 4 Dec 2024 14:30:45 +0100 Subject: [PATCH 15/55] upgrade pip [ci skip] --- .github/workflows/benchmark.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 08c17644..a3530739 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -135,6 +135,7 @@ jobs: run: | python${{matrix.python_version}} -m venv .venv source .venv/bin/activate + python${{matrix.python_version}} -m pip install --upgrade pip python${{matrix.python_version}} -m pip install -r requirements.txt - name: Execute benchmarks run: | From a21259d26fba92bda2707fad66b409b652448d7a Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Wed, 4 Dec 2024 17:05:17 +0100 Subject: [PATCH 16/55] use factory pattern on hpcDispatch --- pyproject.toml | 2 +- src/feelpp/benchmarking/scripts/hpcSystems.py | 175 ++++++++++-------- 2 files changed, 103 insertions(+), 74 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 1e8b5066..4b7bad5e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,7 +45,7 @@ render-benchmarks = "feelpp.benchmarking.report.__main__:main_cli" execute-benchmark = "feelpp.benchmarking.reframe.__main__:main_cli" girder-download = "feelpp.benchmarking.scripts.girder:download_cli" girder-upload = "feelpp.benchmarking.scripts.girder:upload_cli" -hpc-dispatch = "feelpp.benchmarking.scripts.hpcSystems:parseHpcSystems_cli" +hpc-dispatch = "feelpp.benchmarking.scripts.hpcSystems:hpcSystemDispatcher_cli" [tool.pytest.ini_options] minversion = "6.0" diff --git a/src/feelpp/benchmarking/scripts/hpcSystems.py b/src/feelpp/benchmarking/scripts/hpcSystems.py index 2df34c99..02a7ffc3 100644 --- a/src/feelpp/benchmarking/scripts/hpcSystems.py +++ b/src/feelpp/benchmarking/scripts/hpcSystems.py @@ -1,74 +1,105 @@ from argparse import ArgumentParser import os,json from feelpp.benchmarking.reframe.config.configReader import JSONWithCommentsDecoder +from pathlib import Path -def parseHpcSystems_cli(): - - runners = { - "meluxina": { - "runner": "self-meluxina", - "machine": "meluxina", - "partition": "truePartition", - "python_version": "3.6", - "api_version": "v0.0.38", - "user_name": "u101096", - "account": "p200229", - "url": "http://slurmrestd.meluxina.lxp.lu:6820", - "submit": "rest" - }, - "gaya":{ - "runner": "self-gaya", - "machine": "gaya", - "partition": "truePartition", - "python_version": "3.10", - "api_version": "", - "user_name": "prudhomm", - "account": "", - "url": "", - "submit": "cli" - }, - "lumi":{ - "runner": "self-lumi", - "machine": "lumi", - "partition": "truePartition", - "python_version": "3.6", - "api_version": "", - "user_name": "prudhomm", - "account": "", - "url": "", - "submit": "sbatch" - }, - "discoverer":{ - "runner": "self-discoverer", - "machine": "discoverer", - "partition": "truePartition", - "python_version": "3.6", - "api_version": "", - "user_name": "vchabannes", - "account": "", - "url": "", - "submit": "cli" - }, - "karolina":{ - "runner": "self-karolina", - "machine": "karolina", - "partition": "truePartition", - "python_version": "3.6", - "api_version": "", - "user_name": "vchabannes", - "account": "", - "url": "", - "submit": "cli" - } - } +class HpcSystem: + def __init__(self): + self.runner = "" + self.machine = "" + self.python_version = "" + self.user_name = "" + self.api_version = "" + self.user_name = "" + self.account = "" + self.url = "" + self.submit = "" + def toJson(self): + return json.dumps(self.__dict__) + + def writeConfig(self,output_dir,machine_data): + self.machine_cfg = os.path.join(output_dir,f"{self.machine}.json") + with open(self.machine_cfg,"w") as f: + json.dump(machine_data,f) + + def createSumbitCommand(self, benchmark_config_path, plots_config_path, move_results): + assert hasattr(self,"machine_cfg") and self.machine_cfg, "machine config path has not been set" + + self.submit_command = SubmissionCommandFactory.create(self.submit,self.machine,[ + f"--matrix-config {self.machine_cfg} ", + f"--benchmark-config {benchmark_config_path} ", + f"--plots-config {plots_config_path} ", + f"--move-results {move_results}" + ]) + +class Gaya(HpcSystem): + def __init__(self): + super().__init__() + self.runner = "self-gaya" + self.machine = "gaya" + self.python_version = "3.10" + self.user_name = "prudhomm" + self.submit = "cli" + +class Discoverer(HpcSystem): + def __init__(self): + super().__init__() + self.runner = "self-discoverer" + self.machine = "discoverer" + self.partition = "truePartition" + self.python_version = "3.6" + self.user_name = "vchabannes" + self.submit = "cli" + + +class HpcSystemFactory: + @staticmethod + def dispatch(machine_name): + if machine_name == "gaya": + return Gaya() + elif machine_name == "discoverer": + return Discoverer() + else: + raise ValueError(f"HPC resource {machine_name} not found...") + + + +class JobSubmission: + def __init__(self,machine): + self.executable = None + self.script = f"./src/feelpp/benchmarking/reframe/config/machineConfigs/{machine}.sh" + + def buildCommand(self, options): + pass + +class Cli(JobSubmission): + def __init__(self,machine): + super().__init__(machine) + self.executable = "bash" + + def buildCommand(self, options): + return " ".join([self.executable, self.script] + options) + +class SubmissionCommandFactory: + @staticmethod + def create(submit,machine,options): + if submit == "cli": + return Cli(machine).buildCommand(options) + else: + raise ValueError(f"{submit} is not supported") + +def hpcSystemDispatcher_cli(): parser = ArgumentParser() - parser.add_argument("--machine_config_path", "-mp", required=True, type=str, help="path to the machines config json") - parser.add_argument("--output_dir", "-o", required=True, type=str, help="path to folder where individual machine configs should be stored") + parser.add_argument("--machine_config_path", "-mcp", required=True, type=str, help="path to the machines config json") + parser.add_argument("--benchmark_config_path", "-bcp", required=True, type=str, help="path to the benchmark config json") + parser.add_argument("--plots_config_path", "-pcp", required=True, type=str, help="path to the plots config json") + parser.add_argument("--machine_output_dir", "-mod", required=True, type=str, help="path to folder where individual machine configs should be stored") + parser.add_argument("--move_results", "-mv", required=True, type=str, help="path to move the results to") args = parser.parse_args() - if not os.path.exists(args.output_dir): - os.makedirs(args.output_dir) + if not os.path.exists(args.machine_output_dir): + os.makedirs(args.machine_output_dir) with open(args.machine_config_path,"r") as f: machines = json.load(f,cls=JSONWithCommentsDecoder) @@ -76,16 +107,14 @@ def parseHpcSystems_cli(): matrix = [] for machine_data in machines: - if machine_data["machine"] not in runners: - raise ValueError(f"{machine_data['machine']} not found in runner mapping") - - machine_config_path = os.path.join(args.output_dir,f"{machine_data['machine']}.json") - with open(machine_config_path,"w") as f: - json.dump(machine_data,f) - - runner_info = runners[machine_data["machine"]] - runner_info["machine_cfg"] = machine_config_path - matrix.append(runner_info) + hpc_system = HpcSystemFactory().dispatch(machine_data["machine"]) + hpc_system.writeConfig(args.machine_output_dir,machine_data) + hpc_system.createSumbitCommand( + args.benchmark_config_path, + args.plots_config_path, + args.move_results + ) + matrix.append(hpc_system.toJson()) print(matrix) From 624c9de75abab648dcd341a5a5e3122c5eac7d15 Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Wed, 4 Dec 2024 17:05:29 +0100 Subject: [PATCH 17/55] add machine shell scripts --- .../config/machineConfigs/discoverer.sh | 40 +++++++++++++++++++ .../reframe/config/machineConfigs/gaya.sh | 33 +++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh create mode 100644 src/feelpp/benchmarking/reframe/config/machineConfigs/gaya.sh diff --git a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh new file mode 100644 index 00000000..19e7f3c6 --- /dev/null +++ b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh @@ -0,0 +1,40 @@ +#!/bin/bash -l +#SBATCH --nodes=1 # number of nodes +#SBATCH --ntasks=1 # number of tasks +#SBATCH --qos=default # SLURM qos +#SBATCH --ntasks-per-node=8 # number of tasks per node +#SBATCH --cpus-per-task=1 # number of cores per task +#SBATCH --time=02:00:00 # time (HH:MM:SS) +#SBATCH --partition=cn # partition +#SBATCH --account=ehpc-dev-2024d05-047 --qos=ehpc-dev-2024d05-047 # project account + + +source /etc/profile.d/modules.sh +export MODULEPATH=/opt/software/modulefiles +module load python/3/3.10/3.10.12 +module load openmpi/4/gcc/latest + +matrix_config="" +benchmark_config="" +plots_config="" +move_results="" + +while true; do + case "$1" in + --matrix-config ) matrix_config="$2"; shift 2 ;; + --benchmark-config ) benchmark_config="$2"; shift 2 ;; + --plots-config ) plots_config="$2"; shift 2 ;; + --move-results ) move_results="$2"; shift 2 ;; + -- ) shift; break ;; + * ) break ;; + esac +done + + +source .venv/bin/activate +execute-benchmark \ + -mc $matrix_config \ + -bc $benchmark_config \ + -pc $plots_config \ + --move-results $move_results \ + -v \ No newline at end of file diff --git a/src/feelpp/benchmarking/reframe/config/machineConfigs/gaya.sh b/src/feelpp/benchmarking/reframe/config/machineConfigs/gaya.sh new file mode 100644 index 00000000..12b67704 --- /dev/null +++ b/src/feelpp/benchmarking/reframe/config/machineConfigs/gaya.sh @@ -0,0 +1,33 @@ +#!/bin/bash -l +#SBATCH --nodes=1 # number of nodes +#SBATCH --ntasks=1 # number of tasks +##SBATCH --qos=default # SLURM qos +#SBATCH --ntasks-per-node=8 # number of tasks per node +#SBATCH --cpus-per-task=1 # number of cores per task +#SBATCH --time=02:00:00 # time (HH:MM:SS) +#SBATCH --partition=public + +matrix_config="" +benchmark_config="" +plots_config="" +move_results="" + +while true; do + case "$1" in + --matrix-config ) matrix_config="$2"; shift 2 ;; + --benchmark-config ) benchmark_config="$2"; shift 2 ;; + --plots-config ) plots_config="$2"; shift 2 ;; + --move-results ) move_results="$2"; shift 2 ;; + -- ) shift; break ;; + * ) break ;; + esac +done + + +source .venv/bin/activate +execute-benchmark \ + -mc $matrix_config \ + -bc $benchmark_config \ + -pc $plots_config \ + --move-results $move_results \ + -v \ No newline at end of file From 4bef946afde2b1cdd8c4e7644d15c7dee6693bd3 Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Wed, 4 Dec 2024 17:06:05 +0100 Subject: [PATCH 18/55] up benchmark workflow to submit jobs differently #117 [ci skip] --- .github/workflows/benchmark.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index a3530739..b481509a 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -71,13 +71,6 @@ jobs: girder-download -gid $machine_cfg_id -o ./tmp/ -fn "machines_config.json" env: GIRDER_API_KEY: ${{secrets.GIRDER}} - - id: hpc-systems - name: Set HPC systems matrix - run: | - source .venv/bin/activate - matrix=$(hpc-dispatch -mp ./tmp/machines_config.json -o ./tmp/machines/) - echo $matrix - echo "matrix={ include : $matrix }" >> $GITHUB_OUTPUT - name: Donwload benchmark configuration run: | source .venv/bin/activate @@ -93,6 +86,13 @@ jobs: girder-download -gid $plots_cfg_id -o ./tmp/ -fn "plots.json" env: GIRDER_API_KEY: ${{secrets.GIRDER}} + - id: hpc-systems + name: Set HPC systems matrix + run: | + source .venv/bin/activate + matrix=$(hpc-dispatch -mcp ./tmp/machines_config.json -mod ./tmp/machines/ -bcp ./tmp/benchmark_config.json -pcp ./tmp/plots.json -mv ./tmp/results) + echo $matrix + echo "matrix={ include : $matrix }" >> $GITHUB_OUTPUT - name: pull_images run: | source .venv/bin/activate @@ -137,10 +137,12 @@ jobs: source .venv/bin/activate python${{matrix.python_version}} -m pip install --upgrade pip python${{matrix.python_version}} -m pip install -r requirements.txt - - name: Execute benchmarks + + - name: Execute benchmarks (cli) run: | source .venv/bin/activate - execute-benchmark -mc ./${{matrix.machine_cfg}} -bc ./tmp/benchmark_config.json -pc ./tmp/plots.json --move-results ./tmp/results/ -v + $${{matrix.submit_command}} + - name: Upload reframe report uses: actions/upload-artifact@v4 with: From 36813df775e868f6e41f89b71eeb169b50155236 Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Wed, 4 Dec 2024 17:14:06 +0100 Subject: [PATCH 19/55] rm rendering and report resetting (new strat needed) [ci skip] --- .github/workflows/benchmark.yml | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index b481509a..7f82e01b 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -179,28 +179,4 @@ jobs: girder-upload --directory $new_foldername --girder_id $girder_upload_id rm -r $new_foldername env: - GIRDER_API_KEY: ${{ secrets.GIRDER }} - - name: Reset reports - run: | - rm -r ./docs/modules/ROOT/pages/applications/ - rm -r ./docs/modules/ROOT/pages/machines/ - rm -r ./docs/modules/ROOT/pages/reports/ - rm -r ./docs/modules/ROOT/pages/use_cases/ - rm -r ./reports/ - - name: Render reports - run: | - source .venv/bin/activate - render-benchmarks - env: - GIRDER_API_KEY: ${{ secrets.GIRDER }} - - - name: Create Pull Request - uses: peter-evans/create-pull-request@v7 - with: - title: "Add benchmark for ${{ needs.factory.outputs.executable_name }} - ${{ needs.factory.outputs.use_case }}" - body: | - Auto-generated by [create-pull-request][1] - [1]: https://github.com/peter-evans/create-pull-request - reviewers: JavierCladellas - env: - GITHUB_TOKEN: ${{ secrets.CR_PAT }} \ No newline at end of file + GIRDER_API_KEY: ${{ secrets.GIRDER }} \ No newline at end of file From 60bbaf68ab9bf5e1047e09aac8e94c5086cd7571 Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Wed, 4 Dec 2024 17:22:01 +0100 Subject: [PATCH 20/55] to json -> to dict --- src/feelpp/benchmarking/scripts/hpcSystems.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/feelpp/benchmarking/scripts/hpcSystems.py b/src/feelpp/benchmarking/scripts/hpcSystems.py index 02a7ffc3..09a4ff74 100644 --- a/src/feelpp/benchmarking/scripts/hpcSystems.py +++ b/src/feelpp/benchmarking/scripts/hpcSystems.py @@ -15,8 +15,8 @@ def __init__(self): self.url = "" self.submit = "" - def toJson(self): - return json.dumps(self.__dict__) + def toDict(self): + return self.__dict__ def writeConfig(self,output_dir,machine_data): self.machine_cfg = os.path.join(output_dir,f"{self.machine}.json") @@ -114,7 +114,7 @@ def hpcSystemDispatcher_cli(): args.plots_config_path, args.move_results ) - matrix.append(hpc_system.toJson()) + matrix.append(hpc_system.toDict()) print(matrix) From b186a9935b4f22f50529b8dcdb8a674883e95be0 Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Thu, 5 Dec 2024 09:26:16 +0100 Subject: [PATCH 21/55] add executable permissions #117 --- .../benchmarking/reframe/config/machineConfigs/discoverer.sh | 0 src/feelpp/benchmarking/reframe/config/machineConfigs/gaya.sh | 0 2 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh mode change 100644 => 100755 src/feelpp/benchmarking/reframe/config/machineConfigs/gaya.sh diff --git a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh old mode 100644 new mode 100755 diff --git a/src/feelpp/benchmarking/reframe/config/machineConfigs/gaya.sh b/src/feelpp/benchmarking/reframe/config/machineConfigs/gaya.sh old mode 100644 new mode 100755 From a3f388966db1a8079a832992f1b418e09e1efd7f Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Thu, 5 Dec 2024 09:26:25 +0100 Subject: [PATCH 22/55] change name [skip ci] --- .github/workflows/benchmark.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 7f82e01b..b74d1c2e 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -138,10 +138,10 @@ jobs: python${{matrix.python_version}} -m pip install --upgrade pip python${{matrix.python_version}} -m pip install -r requirements.txt - - name: Execute benchmarks (cli) + - name: Execute benchmarks run: | source .venv/bin/activate - $${{matrix.submit_command}} + ${{matrix.submit_command}} - name: Upload reframe report uses: actions/upload-artifact@v4 From fb6934b7d415916223ceb2871c3cb999389cd03a Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Thu, 5 Dec 2024 09:35:04 +0100 Subject: [PATCH 23/55] remove concrete hpc system classes [ci skip] --- src/feelpp/benchmarking/scripts/hpcSystems.py | 52 ++++++++----------- 1 file changed, 21 insertions(+), 31 deletions(-) diff --git a/src/feelpp/benchmarking/scripts/hpcSystems.py b/src/feelpp/benchmarking/scripts/hpcSystems.py index 09a4ff74..a1492967 100644 --- a/src/feelpp/benchmarking/scripts/hpcSystems.py +++ b/src/feelpp/benchmarking/scripts/hpcSystems.py @@ -4,16 +4,25 @@ from pathlib import Path class HpcSystem: - def __init__(self): - self.runner = "" - self.machine = "" - self.python_version = "" - self.user_name = "" - self.api_version = "" - self.user_name = "" - self.account = "" - self.url = "" - self.submit = "" + def __init__( + self, + runner, + machine, + python_version = "", + user_name = "", + api_version = "", + account = "", + url = "", + submit = "" + ): + self.runner = runner + self.machine = machine + self.python_version = python_version + self.user_name = user_name + self.api_version = api_version + self.account = account + self.url = url + self.submit = submit def toDict(self): return self.__dict__ @@ -33,33 +42,14 @@ def createSumbitCommand(self, benchmark_config_path, plots_config_path, move_res f"--move-results {move_results}" ]) -class Gaya(HpcSystem): - def __init__(self): - super().__init__() - self.runner = "self-gaya" - self.machine = "gaya" - self.python_version = "3.10" - self.user_name = "prudhomm" - self.submit = "cli" - -class Discoverer(HpcSystem): - def __init__(self): - super().__init__() - self.runner = "self-discoverer" - self.machine = "discoverer" - self.partition = "truePartition" - self.python_version = "3.6" - self.user_name = "vchabannes" - self.submit = "cli" - class HpcSystemFactory: @staticmethod def dispatch(machine_name): if machine_name == "gaya": - return Gaya() + return HpcSystem( runner = "self-gaya", machine = "gaya", python_version = "3.10", user_name = "prudhomm", submit = "cli" ) elif machine_name == "discoverer": - return Discoverer() + return HpcSystem( runner = "self-discoverer", machine = "discoverer", partition = "truePartition", python_version = "3.6", user_name = "vchabannes", submit = "cli" ) else: raise ValueError(f"HPC resource {machine_name} not found...") From 4a664bdbd4f7c6481e4ccccf969d25effbf10e2d Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Thu, 5 Dec 2024 09:43:20 +0100 Subject: [PATCH 24/55] add partition parameter to hpc system interface [ci skip] --- src/feelpp/benchmarking/scripts/hpcSystems.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/feelpp/benchmarking/scripts/hpcSystems.py b/src/feelpp/benchmarking/scripts/hpcSystems.py index a1492967..f62ff16e 100644 --- a/src/feelpp/benchmarking/scripts/hpcSystems.py +++ b/src/feelpp/benchmarking/scripts/hpcSystems.py @@ -8,6 +8,7 @@ def __init__( self, runner, machine, + partition = "", python_version = "", user_name = "", api_version = "", @@ -17,6 +18,7 @@ def __init__( ): self.runner = runner self.machine = machine + self.partition = partition self.python_version = python_version self.user_name = user_name self.api_version = api_version From 95c02af0988c205472e9cd74cc066bf696ba4ace Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Thu, 5 Dec 2024 09:51:11 +0100 Subject: [PATCH 25/55] try with python 3.9 #117 [ci skip] --- .../benchmarking/reframe/config/machineConfigs/discoverer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh index 19e7f3c6..34eda95f 100755 --- a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh +++ b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh @@ -11,7 +11,7 @@ source /etc/profile.d/modules.sh export MODULEPATH=/opt/software/modulefiles -module load python/3/3.10/3.10.12 +module load python/3/3.9/latest module load openmpi/4/gcc/latest matrix_config="" From 67b5b4f2a5d715cff73267c9334ee6c4bebf77d9 Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Thu, 5 Dec 2024 10:03:23 +0100 Subject: [PATCH 26/55] try accept python 3.6 #117 --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 4b7bad5e..9aadfff4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,11 +14,12 @@ authors = [ { name = "Christophe Prud'homme", email = "christophe.prudhomme@cemosis.fr" }, { name = "Vincent Chabannes", email = "vincent.chabannes@cemosis.fr" }, ] -requires-python = ">=3.7" +requires-python = ">=3.6" classifiers = [ "Development Status :: 4 - Beta", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", From 700f2f151ac73e8cb2d0d2519caf1b7ea775cca2 Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Thu, 5 Dec 2024 11:11:32 +0100 Subject: [PATCH 27/55] install . in discoverer shell script #117 --- .../benchmarking/reframe/config/machineConfigs/discoverer.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh index 34eda95f..297fefc9 100755 --- a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh +++ b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh @@ -32,6 +32,7 @@ done source .venv/bin/activate +python3.9 -m pip install . execute-benchmark \ -mc $matrix_config \ -bc $benchmark_config \ From 0aeeca80cd864b05f49f97cf9d60fe5c68d2aa97 Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Thu, 5 Dec 2024 11:11:48 +0100 Subject: [PATCH 28/55] rm 3.6 [ci skip] --- pyproject.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 9aadfff4..4b7bad5e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,12 +14,11 @@ authors = [ { name = "Christophe Prud'homme", email = "christophe.prudhomme@cemosis.fr" }, { name = "Vincent Chabannes", email = "vincent.chabannes@cemosis.fr" }, ] -requires-python = ">=3.6" +requires-python = ">=3.7" classifiers = [ "Development Status :: 4 - Beta", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", From e78192d6927203d42c8fe907593ed2516bdb10a9 Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Thu, 5 Dec 2024 11:14:53 +0100 Subject: [PATCH 29/55] change . to dist/*.whl [ci skip] --- .../benchmarking/reframe/config/machineConfigs/discoverer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh index 297fefc9..820c4a68 100755 --- a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh +++ b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh @@ -32,7 +32,7 @@ done source .venv/bin/activate -python3.9 -m pip install . +python3.9 -m pip install dist/*.whl execute-benchmark \ -mc $matrix_config \ -bc $benchmark_config \ From cadbd4611366111562f4d5cbe48d7af590ddc94c Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Thu, 5 Dec 2024 11:51:15 +0100 Subject: [PATCH 30/55] create venv in script rather in ci [ci skip] --- .github/workflows/benchmark.yml | 11 +---------- .../reframe/config/machineConfigs/discoverer.sh | 6 +++++- .../reframe/config/machineConfigs/gaya.sh | 4 ++++ 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index b74d1c2e..7b775ee8 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -131,17 +131,8 @@ jobs: with: name: config-artifacts path: ./tmp/ - - name: Create Virtual Environment - run: | - python${{matrix.python_version}} -m venv .venv - source .venv/bin/activate - python${{matrix.python_version}} -m pip install --upgrade pip - python${{matrix.python_version}} -m pip install -r requirements.txt - - name: Execute benchmarks - run: | - source .venv/bin/activate - ${{matrix.submit_command}} + run: ${{matrix.submit_command}} - name: Upload reframe report uses: actions/upload-artifact@v4 diff --git a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh index 820c4a68..ef4a86ed 100755 --- a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh +++ b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh @@ -31,8 +31,12 @@ while true; do done + +python3.9 -m venv .venv source .venv/bin/activate -python3.9 -m pip install dist/*.whl +python3.9 -m pip install --upgrade pip +python3.9 -m pip install -r requirements.txt + execute-benchmark \ -mc $matrix_config \ -bc $benchmark_config \ diff --git a/src/feelpp/benchmarking/reframe/config/machineConfigs/gaya.sh b/src/feelpp/benchmarking/reframe/config/machineConfigs/gaya.sh index 12b67704..d4681eab 100755 --- a/src/feelpp/benchmarking/reframe/config/machineConfigs/gaya.sh +++ b/src/feelpp/benchmarking/reframe/config/machineConfigs/gaya.sh @@ -24,7 +24,11 @@ while true; do done +python3 -m venv .venv source .venv/bin/activate +python3 -m pip install --upgrade pip +python3 -m pip install -r requirements.txt + execute-benchmark \ -mc $matrix_config \ -bc $benchmark_config \ From 5a25ea75178bf1e2f065ffae3d2e97ff0dc19761 Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Thu, 5 Dec 2024 12:05:37 +0100 Subject: [PATCH 31/55] back to 3.8 syntax #117 --- src/feelpp/benchmarking/reframe/config/configMachines.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/feelpp/benchmarking/reframe/config/configMachines.py b/src/feelpp/benchmarking/reframe/config/configMachines.py index 450e3c5f..7cdc98b3 100644 --- a/src/feelpp/benchmarking/reframe/config/configMachines.py +++ b/src/feelpp/benchmarking/reframe/config/configMachines.py @@ -22,7 +22,7 @@ def checkDirectories(cls,v, info): class MachineConfig(BaseModel): machine:str - targets:Optional[str | List[str]] = None + targets:Optional[Union[str,List[str]]] = None active: Optional[bool] = True execution_policy:Literal["serial","async"] reframe_base_dir:str From a7c73ab519a2e12b459b3a8309de06ab6649f6f7 Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Thu, 5 Dec 2024 13:22:09 +0100 Subject: [PATCH 32/55] compat with 3.8 --- src/feelpp/benchmarking/reframe/config/configMachines.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/feelpp/benchmarking/reframe/config/configMachines.py b/src/feelpp/benchmarking/reframe/config/configMachines.py index 7cdc98b3..5b8e95df 100644 --- a/src/feelpp/benchmarking/reframe/config/configMachines.py +++ b/src/feelpp/benchmarking/reframe/config/configMachines.py @@ -6,7 +6,7 @@ class Container(BaseModel): cachedir:Optional[str] = None tmpdir:Optional[str] = None image_base_dir:str - options:Optional[list[str]] = [] + options:Optional[List[str]] = [] @field_validator("cachedir","tmpdir","image_base_dir",mode="before") @classmethod From 46f25f87b66f1557c6ac003a1b1d156442293de7 Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Thu, 5 Dec 2024 14:04:02 +0100 Subject: [PATCH 33/55] try add typing_extensions #117 --- requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements.txt b/requirements.txt index 1de900d8..0666c4c9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,4 +13,5 @@ pandas nbmake traitlets tabulate +typing_extensions>=4.12.2 . From dc4d8d18c1dc425b5914263fb563de9d65022924 Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Thu, 5 Dec 2024 14:12:25 +0100 Subject: [PATCH 34/55] add --ignore-installed and --upgrade to reqs [ci-skip] --- .github/workflows/benchmark.yml | 1 - .../benchmarking/reframe/config/machineConfigs/discoverer.sh | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 7b775ee8..feb1d7ae 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -133,7 +133,6 @@ jobs: path: ./tmp/ - name: Execute benchmarks run: ${{matrix.submit_command}} - - name: Upload reframe report uses: actions/upload-artifact@v4 with: diff --git a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh index ef4a86ed..7eeea82e 100755 --- a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh +++ b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh @@ -35,7 +35,7 @@ done python3.9 -m venv .venv source .venv/bin/activate python3.9 -m pip install --upgrade pip -python3.9 -m pip install -r requirements.txt +python3.9 -m pip install --ignore-installed --upgrade -r requirements.txt execute-benchmark \ -mc $matrix_config \ From be64b0172b36a980863751f108fee8c8d41c1acf Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Thu, 5 Dec 2024 14:23:00 +0100 Subject: [PATCH 35/55] use specific env version of python #117 --- .../reframe/config/machineConfigs/discoverer.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh index 7eeea82e..09a22d91 100755 --- a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh +++ b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh @@ -34,8 +34,13 @@ done python3.9 -m venv .venv source .venv/bin/activate -python3.9 -m pip install --upgrade pip -python3.9 -m pip install --ignore-installed --upgrade -r requirements.txt + + +echo "Python executable: $(which python3.9)" +echo "Pip executable: $(which pip)" + +.venv/bin/python3.9 -m pip install --upgrade pip +.venv/bin/python3.9 -m pip install --ignore-installed --upgrade -r requirements.txt execute-benchmark \ -mc $matrix_config \ From 623f1a0d44202b59908c4d712a2425474e080b37 Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Thu, 5 Dec 2024 14:29:58 +0100 Subject: [PATCH 36/55] ensurepip #117 [ci skip] --- .../reframe/config/machineConfigs/discoverer.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh index 09a22d91..5966886a 100755 --- a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh +++ b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh @@ -36,11 +36,13 @@ python3.9 -m venv .venv source .venv/bin/activate +python3.9 -m ensurepip --upgrade +python3.9 -m pip install --upgrade pip + echo "Python executable: $(which python3.9)" echo "Pip executable: $(which pip)" -.venv/bin/python3.9 -m pip install --upgrade pip -.venv/bin/python3.9 -m pip install --ignore-installed --upgrade -r requirements.txt +python3.9 -m pip install --upgrade -r requirements.txt execute-benchmark \ -mc $matrix_config \ From 00633ba375aa813e305dc5a1a2c381ee2c1bbfa7 Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Thu, 5 Dec 2024 14:41:12 +0100 Subject: [PATCH 37/55] add force-reinstall flag [ci skip] #117 --- .../reframe/config/machineConfigs/discoverer.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh index 5966886a..fadf8f20 100755 --- a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh +++ b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh @@ -36,13 +36,13 @@ python3.9 -m venv .venv source .venv/bin/activate -python3.9 -m ensurepip --upgrade -python3.9 -m pip install --upgrade pip +.venv/bin/python3.9 -m ensurepip --upgrade +.venv/bin/python3.9 -m pip install --upgrade pip echo "Python executable: $(which python3.9)" echo "Pip executable: $(which pip)" -python3.9 -m pip install --upgrade -r requirements.txt +.venv/bin/python3.9 -m pip install --ignore-installed --upgrade --force-reinstall -r requirements.txt execute-benchmark \ -mc $matrix_config \ From ca96061bfd465c42742c13ac0ff349b30b324946 Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Thu, 5 Dec 2024 14:48:53 +0100 Subject: [PATCH 38/55] rm flags #117 [ci skip] --- .../benchmarking/reframe/config/machineConfigs/discoverer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh index fadf8f20..614ea6ba 100755 --- a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh +++ b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh @@ -42,7 +42,7 @@ source .venv/bin/activate echo "Python executable: $(which python3.9)" echo "Pip executable: $(which pip)" -.venv/bin/python3.9 -m pip install --ignore-installed --upgrade --force-reinstall -r requirements.txt +.venv/bin/python3.9 -m pip install --upgrade -r requirements.txt execute-benchmark \ -mc $matrix_config \ From fa9cc7a6af64471a9425347a2f7b23f345c56796 Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Thu, 5 Dec 2024 14:56:58 +0100 Subject: [PATCH 39/55] rm ensure pip [ci skip] --- .../benchmarking/reframe/config/machineConfigs/discoverer.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh index 614ea6ba..04044fe4 100755 --- a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh +++ b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh @@ -36,7 +36,6 @@ python3.9 -m venv .venv source .venv/bin/activate -.venv/bin/python3.9 -m ensurepip --upgrade .venv/bin/python3.9 -m pip install --upgrade pip echo "Python executable: $(which python3.9)" From 4ba3faa89260ad834900a75119fb35d797aba98d Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Thu, 5 Dec 2024 15:00:15 +0100 Subject: [PATCH 40/55] add -I (ignore existing) #117 [ci skip] --- .../benchmarking/reframe/config/machineConfigs/discoverer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh index 04044fe4..cd1e3f26 100755 --- a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh +++ b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh @@ -41,7 +41,7 @@ source .venv/bin/activate echo "Python executable: $(which python3.9)" echo "Pip executable: $(which pip)" -.venv/bin/python3.9 -m pip install --upgrade -r requirements.txt +.venv/bin/python3.9 -m pip install --upgrade -I -r requirements.txt execute-benchmark \ -mc $matrix_config \ From bdb77e01cd4740c517e8366c9bd5e4e6e7d77124 Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Thu, 5 Dec 2024 15:35:42 +0100 Subject: [PATCH 41/55] up reqs #117 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 0666c4c9..50dbe61c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,5 +13,5 @@ pandas nbmake traitlets tabulate -typing_extensions>=4.12.2 +typing-extensions>=4.12.2 . From 6a80e46d1a3e38c7a321026f4cacf81181df3fd2 Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Thu, 5 Dec 2024 15:36:06 +0100 Subject: [PATCH 42/55] rm openmpi module load #117 --- .../benchmarking/reframe/config/machineConfigs/discoverer.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh index cd1e3f26..2f63223c 100755 --- a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh +++ b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh @@ -12,7 +12,6 @@ source /etc/profile.d/modules.sh export MODULEPATH=/opt/software/modulefiles module load python/3/3.9/latest -module load openmpi/4/gcc/latest matrix_config="" benchmark_config="" From 4b4c21a7e0418459c1cf30bc551fb7d09e1824a3 Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Thu, 5 Dec 2024 15:41:56 +0100 Subject: [PATCH 43/55] rm module, use direct path #117 [ci skip] --- .../benchmarking/reframe/config/machineConfigs/discoverer.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh index 2f63223c..6193a16d 100755 --- a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh +++ b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh @@ -11,7 +11,6 @@ source /etc/profile.d/modules.sh export MODULEPATH=/opt/software/modulefiles -module load python/3/3.9/latest matrix_config="" benchmark_config="" @@ -31,7 +30,7 @@ done -python3.9 -m venv .venv +/opt/software/python/3.9.7/bin/python3 -m venv .venv source .venv/bin/activate @@ -40,7 +39,7 @@ source .venv/bin/activate echo "Python executable: $(which python3.9)" echo "Pip executable: $(which pip)" -.venv/bin/python3.9 -m pip install --upgrade -I -r requirements.txt +.venv/bin/python3.9 -m pip install -I -r requirements.txt execute-benchmark \ -mc $matrix_config \ From 8b1c833eaa785c5e17171cd877a5245422ed54cc Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Thu, 5 Dec 2024 15:52:25 +0100 Subject: [PATCH 44/55] =?UTF-8?q?up=20discoverer=20reframe=20config=20#117?= =?UTF-8?q?=20=C2=A0[ci=20skip]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../reframe/config/machineConfigs/discoverer.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.py b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.py index ae37d490..0753dac4 100644 --- a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.py +++ b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.py @@ -22,12 +22,6 @@ 'processor': { 'num_cpus': 128 }, - 'resources': [ - { - 'name':'launcher_options', - 'options':['-bind-to','core'] - } - ], 'devices': [ { 'type': 'cpu', @@ -36,7 +30,7 @@ ], 'container_platforms':[ { - 'type': 'Apptainer' # DOES IT WORK ? OR NEED 'Singularity'? + 'type': 'Singularity' } ], 'sched_options': { 'use_nodes_option': True }, @@ -50,7 +44,7 @@ 'environments': [ { 'name':'default', - 'modules': ['python/3/3.9/latest','openmpi/4/gcc/latest'], + 'modules': [], 'target_systems':['discoverer:cn'] } ] From 13124bbeb713e269cc4db17e2ab560e37343c47c Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Thu, 5 Dec 2024 15:57:13 +0100 Subject: [PATCH 45/55] add default vals to workflow dispatch #117 [ci skip] --- .github/workflows/benchmark.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index feb1d7ae..e1e6d665 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -9,15 +9,19 @@ on: machines_config: description: 'Machine related configurations' required: True + default: 67504e9a4c9ccbdde21a46fe benchmark_config: description: 'Applcation related configuration' required: True + default: 67504e9a4c9ccbdde21a4701 plots_config: description: 'Plots related configuration' required: True + default: 675053424c9ccbdde21a470a girder_folder_id: description: 'ID of the folder to upload to' required: True + default: 67504ecd4c9ccbdde21a4704 jobs: From 48f2005edda8b3bf6b6dbeb55ce2326a266016b6 Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Thu, 5 Dec 2024 16:07:44 +0100 Subject: [PATCH 46/55] rm apptainer from prepare_cmds #117 [ci skip] --- .../benchmarking/reframe/config/machineConfigs/discoverer.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.py b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.py index 0753dac4..34ccaa18 100644 --- a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.py +++ b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.py @@ -16,7 +16,6 @@ 'prepare_cmds': [ 'source /etc/profile.d/modules.sh', 'export MODULEPATH=/opt/software/modulefiles', - 'export PATH=/opt/apptainer/v1.3.3/apptainer/bin/:$PATH', #NEEDED ? 'export OMP_NUM_THREADS=1' # Just in case ], 'processor': { From 4f13a49f7c26b00fb9d95ad93908067f3ac7d943 Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Thu, 5 Dec 2024 16:22:17 +0100 Subject: [PATCH 47/55] try fix artifact uploading #117 [ci skip] --- .github/workflows/benchmark.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index e1e6d665..9711e90d 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -140,7 +140,7 @@ jobs: - name: Upload reframe report uses: actions/upload-artifact@v4 with: - name: benchmark-results + name: benchmark-results-${{matrix.machine}} path: ./tmp/results/ results: @@ -153,8 +153,9 @@ jobs: - name: Download results uses: actions/download-artifact@v4 with: - name: benchmark-results + pattern: benchmark-results-* path: ./tmp/results/ + merge-multiple: false - name: Create Virtual Environment run: | python3 -m venv .venv From 659eb9986c122b9639c975f37f09b7d03a4dc8b9 Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Thu, 5 Dec 2024 17:03:53 +0100 Subject: [PATCH 48/55] stop using move_results #117 [ci-skip] --- .github/workflows/benchmark.yml | 4 ++-- .../reframe/config/machineConfigs/discoverer.sh | 7 ------- .../benchmarking/reframe/config/machineConfigs/gaya.sh | 3 --- src/feelpp/benchmarking/scripts/hpcSystems.py | 10 ++++------ 4 files changed, 6 insertions(+), 18 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 9711e90d..25810b98 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -94,7 +94,7 @@ jobs: name: Set HPC systems matrix run: | source .venv/bin/activate - matrix=$(hpc-dispatch -mcp ./tmp/machines_config.json -mod ./tmp/machines/ -bcp ./tmp/benchmark_config.json -pcp ./tmp/plots.json -mv ./tmp/results) + matrix=$(hpc-dispatch -mcp ./tmp/machines_config.json -mod ./tmp/machines/ -bcp ./tmp/benchmark_config.json -pcp ./tmp/plots.json) echo $matrix echo "matrix={ include : $matrix }" >> $GITHUB_OUTPUT - name: pull_images @@ -141,7 +141,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: benchmark-results-${{matrix.machine}} - path: ./tmp/results/ + path: ${{matrix.reports_path}} results: runs-on: self-ubuntu-22.04 diff --git a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh index 6193a16d..3cc47e8f 100755 --- a/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh +++ b/src/feelpp/benchmarking/reframe/config/machineConfigs/discoverer.sh @@ -15,14 +15,12 @@ export MODULEPATH=/opt/software/modulefiles matrix_config="" benchmark_config="" plots_config="" -move_results="" while true; do case "$1" in --matrix-config ) matrix_config="$2"; shift 2 ;; --benchmark-config ) benchmark_config="$2"; shift 2 ;; --plots-config ) plots_config="$2"; shift 2 ;; - --move-results ) move_results="$2"; shift 2 ;; -- ) shift; break ;; * ) break ;; esac @@ -35,15 +33,10 @@ source .venv/bin/activate .venv/bin/python3.9 -m pip install --upgrade pip - -echo "Python executable: $(which python3.9)" -echo "Pip executable: $(which pip)" - .venv/bin/python3.9 -m pip install -I -r requirements.txt execute-benchmark \ -mc $matrix_config \ -bc $benchmark_config \ -pc $plots_config \ - --move-results $move_results \ -v \ No newline at end of file diff --git a/src/feelpp/benchmarking/reframe/config/machineConfigs/gaya.sh b/src/feelpp/benchmarking/reframe/config/machineConfigs/gaya.sh index d4681eab..ed885fce 100755 --- a/src/feelpp/benchmarking/reframe/config/machineConfigs/gaya.sh +++ b/src/feelpp/benchmarking/reframe/config/machineConfigs/gaya.sh @@ -10,14 +10,12 @@ matrix_config="" benchmark_config="" plots_config="" -move_results="" while true; do case "$1" in --matrix-config ) matrix_config="$2"; shift 2 ;; --benchmark-config ) benchmark_config="$2"; shift 2 ;; --plots-config ) plots_config="$2"; shift 2 ;; - --move-results ) move_results="$2"; shift 2 ;; -- ) shift; break ;; * ) break ;; esac @@ -33,5 +31,4 @@ execute-benchmark \ -mc $matrix_config \ -bc $benchmark_config \ -pc $plots_config \ - --move-results $move_results \ -v \ No newline at end of file diff --git a/src/feelpp/benchmarking/scripts/hpcSystems.py b/src/feelpp/benchmarking/scripts/hpcSystems.py index f62ff16e..5e7275cf 100644 --- a/src/feelpp/benchmarking/scripts/hpcSystems.py +++ b/src/feelpp/benchmarking/scripts/hpcSystems.py @@ -31,17 +31,17 @@ def toDict(self): def writeConfig(self,output_dir,machine_data): self.machine_cfg = os.path.join(output_dir,f"{self.machine}.json") + self.reports_path = os.path.expandvars(machine_data["reports_base_dir"]) with open(self.machine_cfg,"w") as f: json.dump(machine_data,f) - def createSumbitCommand(self, benchmark_config_path, plots_config_path, move_results): + def createSumbitCommand(self, benchmark_config_path, plots_config_path): assert hasattr(self,"machine_cfg") and self.machine_cfg, "machine config path has not been set" self.submit_command = SubmissionCommandFactory.create(self.submit,self.machine,[ f"--matrix-config {self.machine_cfg} ", f"--benchmark-config {benchmark_config_path} ", - f"--plots-config {plots_config_path} ", - f"--move-results {move_results}" + f"--plots-config {plots_config_path} " ]) @@ -87,7 +87,6 @@ def hpcSystemDispatcher_cli(): parser.add_argument("--benchmark_config_path", "-bcp", required=True, type=str, help="path to the benchmark config json") parser.add_argument("--plots_config_path", "-pcp", required=True, type=str, help="path to the plots config json") parser.add_argument("--machine_output_dir", "-mod", required=True, type=str, help="path to folder where individual machine configs should be stored") - parser.add_argument("--move_results", "-mv", required=True, type=str, help="path to move the results to") args = parser.parse_args() if not os.path.exists(args.machine_output_dir): @@ -103,8 +102,7 @@ def hpcSystemDispatcher_cli(): hpc_system.writeConfig(args.machine_output_dir,machine_data) hpc_system.createSumbitCommand( args.benchmark_config_path, - args.plots_config_path, - args.move_results + args.plots_config_path ) matrix.append(hpc_system.toDict()) From fd65dbc172853a4185001d9b22f5f9c783a59edc Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Thu, 5 Dec 2024 17:45:37 +0100 Subject: [PATCH 49/55] remove expandvars #117 [ci skip] --- src/feelpp/benchmarking/scripts/hpcSystems.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/feelpp/benchmarking/scripts/hpcSystems.py b/src/feelpp/benchmarking/scripts/hpcSystems.py index 5e7275cf..2bfa859e 100644 --- a/src/feelpp/benchmarking/scripts/hpcSystems.py +++ b/src/feelpp/benchmarking/scripts/hpcSystems.py @@ -31,7 +31,7 @@ def toDict(self): def writeConfig(self,output_dir,machine_data): self.machine_cfg = os.path.join(output_dir,f"{self.machine}.json") - self.reports_path = os.path.expandvars(machine_data["reports_base_dir"]) + self.reports_path = machine_data["reports_base_dir"] with open(self.machine_cfg,"w") as f: json.dump(machine_data,f) From a30d58a195f1fb25a579ae0bfd0184a20a77d9e1 Mon Sep 17 00:00:00 2001 From: Javier Cladellas Date: Mon, 9 Dec 2024 09:27:07 +0100 Subject: [PATCH 50/55] 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 51/55] 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 52/55] 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 53/55] 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 54/55] 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 55/55] 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):