@@ -76,7 +76,8 @@ def translate(self, output_folder: pathlib.Path) -> None:
7676 in_count = 0
7777 self .output_folder = output_folder
7878 self .cpu_benchmark = output_folder .joinpath ("./bin/cpu-benchmark" ).absolute ()
79- self .script = f"string root_in_files[];\n "
79+ self .script = f"string fs = sprintf(flowcept_start, \" { self .workflow .workflow_id } \" );\n python_persist(fs);\n \n " if self .workflow .workflow_id else ""
80+ self .script += "string root_in_files[];\n "
8081
8182 for task_name in self .root_task_names :
8283 task = self .tasks [task_name ]
@@ -99,6 +100,10 @@ def translate(self, output_folder: pathlib.Path) -> None:
99100 for category in self .categories_list :
100101 self ._add_tasks (category )
101102
103+ # flowcept stop
104+ if self .workflow .workflow_id :
105+ self .script += "string fss = sprintf(flowcept_stop);\n python_persist(fss);"
106+
102107 run_workflow_code = self ._merge_codelines ("templates/swift_t_templates/workflow.swift" , self .script )
103108
104109 # write benchmark files
@@ -213,7 +218,7 @@ def _add_tasks(self, category: str) -> None:
213218 self .script += f"foreach i in [0:{ num_tasks - 1 } ] {{\n " \
214219 f" string of = sprintf(\" { self .output_folder .absolute ()} /data/{ category } _%i_output.txt\" , i);\n " \
215220 f" string cmd_{ self .cmd_counter } = sprintf(command, \" { self .cpu_benchmark } \" , \" { category } \" , { args } );\n " \
216- f" string co_{ self .cmd_counter } = python_persist (cmd_{ self .cmd_counter } );\n " \
221+ f" string co_{ self .cmd_counter } = python (cmd_{ self .cmd_counter } );\n " \
217222 f" string of_{ self .cmd_counter } = sprintf(\" 0%s\" , co_{ self .cmd_counter } );\n " \
218223 f" { category } __out[i] = string2int(of_{ self .cmd_counter } );\n " \
219224 "}\n \n "
@@ -222,7 +227,7 @@ def _add_tasks(self, category: str) -> None:
222227 args = args .replace (
223228 ", of" , f", \" { self .output_folder .absolute ()} /data/{ category } _0_output.txt\" " ).replace ("[i]" , "[0]" )
224229 self .script += f"string cmd_{ self .cmd_counter } = sprintf(command, \" { self .cpu_benchmark } \" , \" { category } \" , { args } );\n " \
225- f"string co_{ self .cmd_counter } = python_persist (cmd_{ self .cmd_counter } );\n " \
230+ f"string co_{ self .cmd_counter } = python (cmd_{ self .cmd_counter } );\n " \
226231 f"string of_{ self .cmd_counter } = sprintf(\" 0%s\" , co_{ self .cmd_counter } );\n " \
227232 f"{ category } __out[0] = string2int(of_{ self .cmd_counter } );\n \n "
228233
0 commit comments