Skip to content
Snippets Groups Projects
Commit 06b2c018 authored by Hans-Jörg's avatar Hans-Jörg
Browse files

Hack to support creation of second schedules

parent 4930019d
No related branches found
No related tags found
No related merge requests found
......@@ -72,6 +72,12 @@ args_parser.add_argument(
help="Write full script instead of CSV file.",
action="store_true",
)
args_parser.add_argument(
"-z",
dest="seconds_out",
help="Write seconds not milliseconds.",
action="store_true",
)
args_parser.add_argument(
"-p",
"--threads",
......@@ -116,7 +122,7 @@ args_parser.add_argument(
)
def writeScript(outFile, logics, schedule):
def writeScript(outFile, logics, schedule, seconds=False):
message(f"Writing schedule to {outFile}.", logics)
with open(outFile, "w") as af:
if len(logics) == 1:
......@@ -128,7 +134,10 @@ def writeScript(outFile, logics, schedule):
)
for i in range(len(schedule) - 1):
(t, e) = schedule[i]
af.write(f" trywith {1000*t:.0f}\t{e}\n")
if seconds:
af.write(f" trywith {t:.0f}\t{e}\n")
else:
af.write(f" trywith {1000*t:.0f}\t{e}\n")
(t, e) = schedule[-1]
af.write(f" # Calculated runtime: {t}s\n")
af.write(f" finishwith\t{e}\n")
......@@ -304,7 +313,7 @@ if __name__ == "__main__":
else:
full_schedule = best_schedule
if args.result and args.full:
writeScript(args.result, logics, full_schedule)
writeScript(args.result, logics, full_schedule, args.seconds_out)
elif args.result:
writeCSV(args.result, logics, full_schedule)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment