From cef6d88853331ce5414bafb11f8bfa55ac575983 Mon Sep 17 00:00:00 2001 From: Rafael Ferreira da Silva Date: Fri, 30 May 2025 18:16:12 -0400 Subject: [PATCH 1/6] swift/t with flowcept --- wfcommons/wfbench/translator/swift_t.py | 3 ++- .../translator/templates/swift_t_templates/workflow.swift | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wfcommons/wfbench/translator/swift_t.py b/wfcommons/wfbench/translator/swift_t.py index 070a1314..56d2edba 100644 --- a/wfcommons/wfbench/translator/swift_t.py +++ b/wfcommons/wfbench/translator/swift_t.py @@ -217,7 +217,8 @@ def _add_tasks(self, category: str) -> None: if num_tasks > 1: self.script += f"foreach i in [0:{num_tasks - 1}] {{\n" \ f" string of = sprintf(\"{self.output_folder.absolute()}/data/{category}_%i_output.txt\", i);\n" \ - f" string cmd_{self.cmd_counter} = sprintf(command, \"{self.cpu_benchmark}\", \"{category}\", {args});\n" \ + f" string task_id = \"{category}_\" + i;\n" \ + f" string cmd_{self.cmd_counter} = sprintf(command, \"{self.cpu_benchmark}\", task_id, {args});\n" \ f" string co_{self.cmd_counter} = python_persist(cmd_{self.cmd_counter});\n" \ f" string of_{self.cmd_counter} = sprintf(\"0%s\", co_{self.cmd_counter});\n" \ f" {category}__out[i] = string2int(of_{self.cmd_counter});\n" \ diff --git a/wfcommons/wfbench/translator/templates/swift_t_templates/workflow.swift b/wfcommons/wfbench/translator/templates/swift_t_templates/workflow.swift index 063394c0..e4804176 100644 --- a/wfcommons/wfbench/translator/templates/swift_t_templates/workflow.swift +++ b/wfcommons/wfbench/translator/templates/swift_t_templates/workflow.swift @@ -98,7 +98,7 @@ if 'workflow_id': bundle_exec_id=workflow_id, start_persistence=False, save_workflow=False) fc.start() - fc_task = FlowceptTask(workflow_id=workflow_id, used={ + fc_task = FlowceptTask(workflow_id=workflow_id, task_id=task_name, used={ 'workflow_id': workflow_id, 'name': task_name, 'percent-cpu': percent_cpu, From 4b23e3bb402e884c896e6594990937fd80d44959 Mon Sep 17 00:00:00 2001 From: Rafael Ferreira da Silva Date: Fri, 30 May 2025 20:19:42 -0400 Subject: [PATCH 2/6] swift/t with flowcept --- wfcommons/wfbench/translator/swift_t.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wfcommons/wfbench/translator/swift_t.py b/wfcommons/wfbench/translator/swift_t.py index 56d2edba..bed69b1d 100644 --- a/wfcommons/wfbench/translator/swift_t.py +++ b/wfcommons/wfbench/translator/swift_t.py @@ -232,7 +232,7 @@ def _add_tasks(self, category: str) -> None: self.out_files.add(out_file) args = args.replace( ", of", f", \"{out_file}\"").replace("[i]", "[0]") - self.script += f"string cmd_{self.cmd_counter} = sprintf(command, \"{self.cpu_benchmark}\", \"{category}\", {args});\n" \ + self.script += f"string cmd_{self.cmd_counter} = sprintf(command, \"{self.cpu_benchmark}\", \"{category}_{self.cmd_counter}\", {args});\n" \ f"string co_{self.cmd_counter} = python_persist(cmd_{self.cmd_counter});\n" \ f"string of_{self.cmd_counter} = sprintf(\"0%s\", co_{self.cmd_counter});\n" \ f"{category}__out[0] = string2int(of_{self.cmd_counter});\n\n" From 861e47f196a714454f4217161d357e4fd892c26d Mon Sep 17 00:00:00 2001 From: Rafael Ferreira da Silva Date: Thu, 5 Jun 2025 10:53:12 -0400 Subject: [PATCH 3/6] swift/t with flowcept --- .../translator/templates/swift_t_templates/workflow.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wfcommons/wfbench/translator/templates/swift_t_templates/workflow.swift b/wfcommons/wfbench/translator/templates/swift_t_templates/workflow.swift index e4804176..5ecb4883 100644 --- a/wfcommons/wfbench/translator/templates/swift_t_templates/workflow.swift +++ b/wfcommons/wfbench/translator/templates/swift_t_templates/workflow.swift @@ -31,7 +31,7 @@ workflow_name = "%s" out_files = [%s] logging.info("Flowcept Starting") -flowcept_agent = Flowcept(workflow_id=workflow_id, workflow_name=workflow_name, bundle_exec_id=workflow_id) +flowcept_agent = Flowcept(workflow_id=workflow_id, workflow_name=workflow_name, bundle_exec_id=workflow_id, start_persistence=False, save_workflow=False) try: flowcept_agent.start() From 8a3bb3dfc623b52e36e69d5548d173c93013baa9 Mon Sep 17 00:00:00 2001 From: Rafael Ferreira da Silva Date: Thu, 5 Jun 2025 11:14:45 -0400 Subject: [PATCH 4/6] swift/t with flowcept --- .../translator/templates/swift_t_templates/workflow.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wfcommons/wfbench/translator/templates/swift_t_templates/workflow.swift b/wfcommons/wfbench/translator/templates/swift_t_templates/workflow.swift index 5ecb4883..0ba1e89d 100644 --- a/wfcommons/wfbench/translator/templates/swift_t_templates/workflow.swift +++ b/wfcommons/wfbench/translator/templates/swift_t_templates/workflow.swift @@ -90,6 +90,7 @@ cpu_threads = int(10 * percent_cpu) output_data = {"%s": int(%i)} dep = %i workflow_id = "%s" +task_id = f"{workflow_id}_{task_name}" if 'workflow_id': logging.info("Running with Flowcept.") @@ -98,7 +99,7 @@ if 'workflow_id': bundle_exec_id=workflow_id, start_persistence=False, save_workflow=False) fc.start() - fc_task = FlowceptTask(workflow_id=workflow_id, task_id=task_name, used={ + fc_task = FlowceptTask(workflow_id=workflow_id, task_id=task_id, used={ 'workflow_id': workflow_id, 'name': task_name, 'percent-cpu': percent_cpu, From 9027ae1ded3802e62db538db51ce418844c76274 Mon Sep 17 00:00:00 2001 From: Rafael Ferreira da Silva Date: Thu, 5 Jun 2025 12:00:34 -0400 Subject: [PATCH 5/6] swift/t with flowcept --- .../translator/templates/swift_t_templates/workflow.swift | 2 -- 1 file changed, 2 deletions(-) diff --git a/wfcommons/wfbench/translator/templates/swift_t_templates/workflow.swift b/wfcommons/wfbench/translator/templates/swift_t_templates/workflow.swift index 0ba1e89d..58d4063f 100644 --- a/wfcommons/wfbench/translator/templates/swift_t_templates/workflow.swift +++ b/wfcommons/wfbench/translator/templates/swift_t_templates/workflow.swift @@ -51,10 +51,8 @@ while remaining_files: break time.sleep(1) -time.sleep(180) try: flowcept_agent.stop() - time.sleep(120) except Exception: import traceback traceback.print_exc() From 706f60abc047c6c98402e1395ac7b7f22d964f6b Mon Sep 17 00:00:00 2001 From: Rafael Ferreira da Silva Date: Thu, 5 Jun 2025 12:51:18 -0400 Subject: [PATCH 6/6] swift/t with flowcept --- .../translator/templates/swift_t_templates/workflow.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wfcommons/wfbench/translator/templates/swift_t_templates/workflow.swift b/wfcommons/wfbench/translator/templates/swift_t_templates/workflow.swift index 58d4063f..b035c728 100644 --- a/wfcommons/wfbench/translator/templates/swift_t_templates/workflow.swift +++ b/wfcommons/wfbench/translator/templates/swift_t_templates/workflow.swift @@ -31,7 +31,7 @@ workflow_name = "%s" out_files = [%s] logging.info("Flowcept Starting") -flowcept_agent = Flowcept(workflow_id=workflow_id, workflow_name=workflow_name, bundle_exec_id=workflow_id, start_persistence=False, save_workflow=False) +flowcept_agent = Flowcept(workflow_id=workflow_id, workflow_name=workflow_name, bundle_exec_id=workflow_id, start_persistence=False, save_workflow=True) try: flowcept_agent.start()