Skip to content

Commit

Permalink
use only base of "executable" for naming. Also add the use_case level…
Browse files Browse the repository at this point in the history
… to the output hierrarchy #123
  • Loading branch information
JavierCladellas committed Nov 15, 2024
1 parent c08d722 commit a964dd9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions src/feelpp/benchmarking/reframe/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ def buildConfigFilePath(self):
def buildRegressionTestFilePath(self):
return f'{self.getScriptRootDir() / "regression.py"}'

def buildReportFilePath(self,executable):
return str(os.path.join(self.machine_config.reports_base_dir,executable,self.machine_config.machine,f"{self.current_date}.json"))
def buildReportFilePath(self,executable,use_case):
return str(os.path.join(self.machine_config.reports_base_dir,executable,use_case,self.machine_config.machine,f"{self.current_date}.json"))

def buildCommand(self,executable):
def buildCommand(self,executable,use_case):
cmd = [
'reframe',
f'-C {self.buildConfigFilePath()}',
Expand All @@ -36,7 +36,7 @@ def buildCommand(self,executable):
f'--exec-policy={self.machine_config.execution_policy}',
f'--prefix={self.machine_config.reframe_base_dir}',
f'--perflogdir={os.path.join(self.machine_config.reframe_base_dir,"logs")}',
f'--report-file={self.buildReportFilePath(executable)}',
f'--report-file={self.buildReportFilePath(executable,use_case)}',
f'{"-"+"v"*self.parser.args.verbose if self.parser.args.verbose else ""}',
'-r',
]
Expand Down Expand Up @@ -74,12 +74,13 @@ 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.executable)
executable_name = os.path.basename(app_reader.config.executable).split(".")[0]
reframe_cmd = cmd_builder.buildCommand(executable_name,app_reader.config.use_case_name)

exit_code = os.system(reframe_cmd)

#============ CREATING RESULT ITEM ================#
rfm_report_filepath = cmd_builder.buildReportFilePath(app_reader.config.executable)
rfm_report_filepath = cmd_builder.buildReportFilePath(executable_name,app_reader.config.use_case_name)
rfm_report_dir = rfm_report_filepath.replace(".json","")
os.mkdir(rfm_report_dir)
os.rename(rfm_report_filepath,os.path.join(rfm_report_dir,"reframe_report.json"))
Expand Down
2 changes: 1 addition & 1 deletion src/feelpp/benchmarking/reframe/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def setExecutable(self, rfm_test, machine_config):
rfm_test (reframe class) : The test to apply the setup
"""
if machine_config.prog_environment == "builtin":
rfm_test.executable = os.path.join(self.reader.config.executable_dir,self.reader.config.executable) if self.reader.config.executable_dir else self.reader.config.executable
rfm_test.executable = self.reader.config.executable
rfm_test.executable_opts = self.reader.config.options
else:
rfm_test.container_platform.command = f"{self.reader.config.executable} {' '.join(self.reader.config.options)}"
Expand Down

0 comments on commit a964dd9

Please sign in to comment.