@@ -77,7 +77,7 @@ def translate(self, output_folder: pathlib.Path) -> None:
7777 in_count = 0
7878 self .output_folder = output_folder
7979 self .cpu_benchmark = output_folder .joinpath ("./bin/cpu-benchmark" ).absolute ()
80- self .script = f"string fs = sprintf(flowcept_start, \" { self .workflow .workflow_id } \" , \" { self . workflow . name } \" );\n string fss = python_persist(fs);\n \n " if self .workflow .workflow_id else ""
80+ self .script = f"string fs = sprintf(flowcept_start, \" { self .workflow .workflow_id } \" );\n string fss = python_persist(fs);\n \n " if self .workflow .workflow_id else ""
8181 self .script += "string root_in_files[];\n "
8282
8383 for task_name in self .root_task_names :
@@ -103,9 +103,8 @@ def translate(self, output_folder: pathlib.Path) -> None:
103103
104104 # flowcept end
105105 if self .workflow .workflow_id :
106- self .script += f"int dep_{ self .cmd_counter } = { self .last_file } ;\n " \
107- f"string fc_stop = sprintf(flowcept_stop, dep_{ self .cmd_counter } );\n " \
108- "python_persist(fc_stop);"
106+ self .script += f"string fc = sprintf(flowcept, \" { self .workflow .workflow_id } \" , \" { self .workflow .name } \" , \" { self .last_file } \" );\n " \
107+ "python_persist(fc);\n "
109108
110109 run_workflow_code = self ._merge_codelines ("templates/swift_t_templates/workflow.swift" , self .script )
111110
@@ -169,7 +168,6 @@ def _add_tasks(self, category: str) -> None:
169168 prefix = ""
170169
171170 for file in task .output_files :
172- out_file = file .file_id
173171 file_size = file .size
174172
175173 for file in task .input_files :
@@ -225,15 +223,14 @@ def _add_tasks(self, category: str) -> None:
225223 f" string of_{ self .cmd_counter } = sprintf(\" 0%s\" , co_{ self .cmd_counter } );\n " \
226224 f" { category } __out[i] = string2int(of_{ self .cmd_counter } );\n " \
227225 "}\n \n "
228- self .last_file = f"{ category } __out[{ num_tasks - 1 } ]"
229-
226+ self .last_file = f"{ self .output_folder .absolute ()} /data/{ category } _{ num_tasks - 1 } _output.txt"
230227 else :
228+ self .last_file = f"{ self .output_folder .absolute ()} /data/{ category } _0_output.txt"
231229 args = args .replace (
232- ", of" , f", \" { self .output_folder . absolute () } /data/ { category } _0_output.txt \" " ).replace ("[i]" , "[0]" )
230+ ", of" , f", \" { self .last_file } \" " ).replace ("[i]" , "[0]" )
233231 self .script += f"string cmd_{ self .cmd_counter } = sprintf(command, \" { self .cpu_benchmark } \" , \" { category } \" , { args } );\n " \
234232 f"string co_{ self .cmd_counter } = python_persist(cmd_{ self .cmd_counter } );\n " \
235233 f"string of_{ self .cmd_counter } = sprintf(\" 0%s\" , co_{ self .cmd_counter } );\n " \
236234 f"{ category } __out[0] = string2int(of_{ self .cmd_counter } );\n \n "
237- self .last_file = f"{ category } __out[0]"
238235
239236 self .cmd_counter += 1
0 commit comments