@@ -43,7 +43,7 @@ def __init__(self,
4343 self .files_map = {}
4444 self .tasks_map = {}
4545 self .cmd_counter = 1
46- self .last_file = ""
46+ self .out_files = []
4747
4848 # find applications
4949 self .apps = []
@@ -103,7 +103,9 @@ def translate(self, output_folder: pathlib.Path) -> None:
103103
104104 # flowcept end
105105 if self .workflow .workflow_id :
106- self .script += f"string fc = sprintf(flowcept, \" { self .workflow .workflow_id } \" , \" { self .workflow .name } \" , \" { self .last_file } \" );\n " \
106+ out_files = ", " .join (f'"{ item } "' for item in self .out_files )
107+ self .script += f"string out_files[] = [{ out_files } ];\n "
108+ self .script += f"string fc = sprintf(flowcept, \" { self .workflow .workflow_id } \" , \" { self .workflow .name } \" , out_files);\n " \
107109 "python_persist(fc);\n "
108110
109111 run_workflow_code = self ._merge_codelines ("templates/swift_t_templates/workflow.swift" , self .script )
@@ -223,11 +225,12 @@ def _add_tasks(self, category: str) -> None:
223225 f" string of_{ self .cmd_counter } = sprintf(\" 0%s\" , co_{ self .cmd_counter } );\n " \
224226 f" { category } __out[i] = string2int(of_{ self .cmd_counter } );\n " \
225227 "}\n \n "
226- self .last_file = f"{ self .output_folder .absolute ()} /data/{ category } _{ num_tasks - 1 } _output.txt"
228+ self .out_files . append ( f"{ self .output_folder .absolute ()} /data/{ category } _{ num_tasks - 1 } _output.txt" )
227229 else :
228- self .last_file = f"{ self .output_folder .absolute ()} /data/{ category } _0_output.txt"
230+ out_file = f"{ self .output_folder .absolute ()} /data/{ category } _0_output.txt"
231+ self .out_files .append (out_file )
229232 args = args .replace (
230- ", of" , f", \" { self . last_file } \" " ).replace ("[i]" , "[0]" )
233+ ", of" , f", \" { out_file } \" " ).replace ("[i]" , "[0]" )
231234 self .script += f"string cmd_{ self .cmd_counter } = sprintf(command, \" { self .cpu_benchmark } \" , \" { category } \" , { args } );\n " \
232235 f"string co_{ self .cmd_counter } = python_persist(cmd_{ self .cmd_counter } );\n " \
233236 f"string of_{ self .cmd_counter } = sprintf(\" 0%s\" , co_{ self .cmd_counter } );\n " \
0 commit comments