Skip to content

Commit 5d3a56d

Browse files
committed
adding flowcept and IO for swift/t
1 parent ebce8cd commit 5d3a56d

1 file changed

Lines changed: 19 additions & 20 deletions

File tree

  • wfcommons/wfbench/translator/templates/swift_t_templates

wfcommons/wfbench/translator/templates/swift_t_templates/workflow.swift

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,22 @@ output_data = {"%s": int(%i)}
3232
dep = %i
3333
workflow_id = "%s"
3434
35-
logging.info("Running with Flowcept.")
36-
from flowcept import Flowcept, FlowceptTask
37-
flowcept_agent = Flowcept(workflow_id=workflow_id,
38-
bundle_exec_id=workflow_id,
39-
start_persistence=False, save_workflow=False)
40-
flowcept_agent.start()
41-
flowcept_task = FlowceptTask(workflow_id=workflow_id, used={
42-
"name": task_name,
43-
"inputs": files_list,
44-
"gpu_work": gpu_work,
45-
"cpu_work": cpu_work,
46-
"cpu_threads": cpu_threads,
47-
"outputs": output_data,
48-
"workflow_id": workflow_id
49-
})
35+
if workflow_id:
36+
logging.info("Running with Flowcept.")
37+
from flowcept import Flowcept, FlowceptTask
38+
flowcept_agent = Flowcept(workflow_id=workflow_id,
39+
bundle_exec_id=workflow_id,
40+
start_persistence=False, save_workflow=False)
41+
flowcept_agent.start()
42+
flowcept_task = FlowceptTask(workflow_id=workflow_id, used={
43+
"name": task_name,
44+
"inputs": files_list,
45+
"gpu_work": gpu_work,
46+
"cpu_work": cpu_work,
47+
"cpu_threads": cpu_threads,
48+
"outputs": output_data,
49+
"workflow_id": workflow_id
50+
})
5051
5152
logging.info(f"Starting {task_name} Benchmark on {socket.gethostname()}")
5253
@@ -162,13 +163,10 @@ if cpu_work > 0:
162163
procs.extend(cpu_procs)
163164
for proc in procs:
164165
if isinstance(proc, subprocess.Popen):
165-
logging.info("Waiting for CPU")
166166
proc.wait()
167167
if io_proc is not None and io_proc.is_alive():
168-
logging.info("Joining IO PROC")
169168
io_proc.join()
170169
171-
logging.info("Looking for mem procs")
172170
for mem_proc in mem_procs:
173171
try:
174172
os.kill(mem_proc.pid, signal.SIGKILL)
@@ -178,8 +176,9 @@ if cpu_work > 0:
178176
179177
logging.debug("Completed CPU and Memory Benchmarks!")
180178
181-
flowcept_task.end()
182-
flowcept_agent.stop()
179+
if workflow_id:
180+
flowcept_task.end()
181+
flowcept_agent.stop()
183182
184183
logging.info(f"Benchmark {task_name} completed!")
185184
""";

0 commit comments

Comments
 (0)