Skip to content

Commit 9e9ee98

Browse files
committed
Code cleanup
API update
1 parent 580c6d7 commit 9e9ee98

File tree

2 files changed

+3
-26
lines changed

2 files changed

+3
-26
lines changed

examples/compound_job_simulator/simulator.py

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -81,41 +81,23 @@
8181
fwa = cj.add_file_write_action("FileWriteAction1", file1, ss1)
8282
print(f"Adding {fwa.get_name()} to {cj.get_name()}")
8383

84-
print(f"File Write Action get_file = {fwa.get_file()}")
85-
print(f"File Write Action get_file_location = {fwa.get_file_location()}")
86-
print(f"File Write Action uses_scratch = {fwa.uses_scratch}")
87-
8884
# Add a file read action to compound job
8985
fra = cj.add_file_read_action("FileReadAction1", file1, ss1)
9086
print(f"Adding {fra.get_name()} to {cj.get_name()}")
9187

92-
print(f"File Read Action get_file = {fra.get_file()}")
93-
print(f"File Read Action get_file_location = {fra.get_file_location()}")
94-
print(f"File Read Action get_num_bytes_to_read = {fra.get_file_location()}")
95-
print(f"File Read Action uses_scratch = {fra.uses_scratch}")
96-
9788
# Add a file copy action to compound job
9889
fca = cj.add_file_copy_action("FileCopyAction1", file1, ss1, ss2)
9990
print(f"Adding {fca.get_name()} to {cj.get_name()}")
10091

101-
print(f"File Copy Action getFile = {fca.get_file()}")
102-
print(f"File Copy Action getSourceFileLocation = {fca.get_source_file_location()}")
103-
print(f"File Copy Action getDestinationFileLocation = {fca.get_destination_file_location()}")
104-
print(f"File Copy Action usesScratch = {fca.uses_scratch}")
105-
10692
# Add a file delete action to compound job
10793
fda = cj.add_file_delete_action("FileDeleteAction1", file1, ss1)
10894
print(f"Adding {fda.get_name()} to {cj.get_name()}")
10995

110-
print(f"File Delete Action getFile = {fda.get_file()}")
111-
print(f"File Delete Action getFileLocation = {fda.get_file_location()}")
112-
print(f"File Delete Action usesScratch = {fda.uses_scratch}")
113-
11496
# Add a sleep action to compound job
11597
sa = cj.add_sleep_action("SleepAction1", 5.0)
11698
print(f"Adding {sa.get_name()} to {cj.get_name()}")
11799

118-
print(f"Sleep Action getSleepTime = {sa.get_sleep_time()}")
100+
# print(f"Sleep Action getSleepTime = {sa.get_sleep_time()}")
119101

120102
# # Add a parent compound job to another compound job
121103
cj2_0 = simulation.create_compound_job("")
@@ -152,11 +134,6 @@
152134
print(f"\t- Event: {event}")
153135
print(f"Time is {simulation.get_simulated_time()}")
154136

155-
# print("Synchronously waiting for the next simulation event...")
156-
# event = simulation.wait_for_next_event()
157-
# print(f" - Event: {event}")
158-
# print(f"Time is {simulation.get_simulated_time()}")
159-
160137
print("Terminating simulation")
161138
simulation.terminate()
162139

wrench/simulation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -532,10 +532,10 @@ def create_workflow_from_json(self, json_object: json, reference_flop_rate: str,
532532
task_max_num_cores = task_spec["max_num_cores"]
533533
task_memory = task_spec["memory"]
534534
input_file_list = []
535-
for file_name in task_spec["input_files"]:
535+
for file_name in task_spec["input_file_names"]:
536536
input_file_list.append(self.files[file_name])
537537
output_file_list = []
538-
for file_name in task_spec["output_files"]:
538+
for file_name in task_spec["output_file_names"]:
539539
output_file_list.append(self.files[file_name])
540540

541541
workflow.tasks[task_name] = Task(self, workflow, task_name, task_flops, task_min_num_cores, task_max_num_cores, task_memory, input_file_list, output_file_list)

0 commit comments

Comments
 (0)