diff --git a/config/toolbox_heat/thermal_bridges_case_3.json b/config/toolbox_heat/thermal_bridges_case_3.json index 40992688..62bd4f12 100644 --- a/config/toolbox_heat/thermal_bridges_case_3.json +++ b/config/toolbox_heat/thermal_bridges_case_3.json @@ -3,6 +3,7 @@ "output_directory": "{{machine.output_app_dir}}/toolboxes/heat/ThermalBridgesENISO10211/Case3", "use_case_name": "ThermalBridgesENISO10211", "timeout":"0-00:10:00", + "memory":"250G", "platforms": { "apptainer":{ "image": { @@ -31,7 +32,7 @@ "--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 + "OMP_NUM_THREADS":"1" }, "outputs": [ { diff --git a/src/feelpp/benchmarking/reframe/__main__.py b/src/feelpp/benchmarking/reframe/__main__.py index 5620c0e4..b7f32efb 100644 --- a/src/feelpp/benchmarking/reframe/__main__.py +++ b/src/feelpp/benchmarking/reframe/__main__.py @@ -42,7 +42,17 @@ def buildExecutionMode(self): else: return "-r" - def buildCommand(self,timeout): + def buildJobOptions(self,timeout,memory): + #TODO: Generalize (only workf for slurm ?) + options = [] + if timeout: + options.append(f"-J time={timeout}") + if memory: + options.append(f"-J mem={memory}") + return " ".join(options) + + + def buildCommand(self,timeout,memory): assert self.report_folder_path is not None, "Report folder path not set" cmd = [ 'reframe', @@ -53,7 +63,7 @@ def buildCommand(self,timeout): f'--exec-policy={self.machine_config.execution_policy}', f'--prefix={self.machine_config.reframe_base_dir}', f'--report-file={str(os.path.join(self.report_folder_path,"reframe_report.json"))}', - f"-J '#SBATCH --time={timeout}'", + f"{self.buildJobOptions(timeout,memory)}", f'--perflogdir={os.path.join(self.machine_config.reframe_base_dir,"logs")}', f'{"-"+"v"*self.parser.args.verbose if self.parser.args.verbose else ""}', f'{self.buildExecutionMode()}' @@ -97,7 +107,7 @@ def main_cli(): app_reader.updateConfig(machine_reader.processor.flattenDict(machine_reader.config,"machine")) app_reader.updateConfig() #Update with own field - reframe_cmd = cmd_builder.buildCommand( app_reader.config.timeout ) + reframe_cmd = cmd_builder.buildCommand( app_reader.config.timeout, app_reader.config.memory) exit_code = subprocess.run(reframe_cmd, shell=True) diff --git a/src/feelpp/benchmarking/reframe/config/configSchemas.py b/src/feelpp/benchmarking/reframe/config/configSchemas.py index bc7a8dbd..a318478f 100644 --- a/src/feelpp/benchmarking/reframe/config/configSchemas.py +++ b/src/feelpp/benchmarking/reframe/config/configSchemas.py @@ -82,6 +82,7 @@ class AdditionalFiles(BaseModel): class ConfigFile(BaseModel): executable: str timeout: str + memory: Optional[str] = None platforms:Optional[Dict[str,Platform]] = {"builtin":Platform()} output_directory:Optional[str] = "" use_case_name: str