Skip to content

Commit

Permalink
Adding pause on complete to start bfs script
Browse files Browse the repository at this point in the history
  • Loading branch information
grf14003 committed Mar 11, 2020
1 parent ea4c6ee commit 1c27399
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 11 deletions.
68 changes: 68 additions & 0 deletions bfs/scripts/log.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,71 @@ Could not acquire mutex to add new client thread
Listening for clients...
Hello new client!
Listening for clients...
Could not acquire mutex to add new client thread
Listening for clients...
Hello new client!
Listening for clients...
Could not acquire mutex to add new client thread
Listening for clients...
Hello new client!
Listening for clients...
Could not acquire mutex to add new client thread
Listening for clients...
Hello new client!
Listening for clients...
Could not acquire mutex to add new client thread
Listening for clients...
Hello new client!
Listening for clients...
Could not acquire mutex to add new client thread
Listening for clients...
Hello new client!
Listening for clients...
Could not acquire mutex to add new client thread
Listening for clients...
Hello new client!
Listening for clients...
Could not acquire mutex to add new client thread
Listening for clients...
Hello new client!
Listening for clients...
Could not acquire mutex to add new client thread
Listening for clients...
Hello new client!
Listening for clients...
Could not acquire mutex to add new client thread
Listening for clients...
Hello new client!
Listening for clients...
Could not acquire mutex to add new client thread
Listening for clients...
Hello new client!
Listening for clients...
Could not acquire mutex to add new client thread
Listening for clients...
Hello new client!
Listening for clients...
Could not acquire mutex to add new client thread
Listening for clients...
Hello new client!
Listening for clients...
Could not acquire mutex to add new client thread
Listening for clients...
Hello new client!
Listening for clients...
Could not acquire mutex to add new client thread
Listening for clients...
Hello new client!
Listening for clients...
Could not acquire mutex to add new client thread
Listening for clients...
Hello new client!
Listening for clients...
Could not acquire mutex to add new client thread
Listening for clients...
Hello new client!
Listening for clients...
Could not acquire mutex to add new client thread
Listening for clients...
Hello new client!
Listening for clients...
14 changes: 3 additions & 11 deletions bfs/scripts/startbfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
def start_program(program):
if not isinstance(program, str):
raise ValueError("Argument passed to start_program_sync() should be a string")
return os.system("START /wait \""+ program +"\" CMD /c " + program)
command = "START /wait \"\" CMD /c \"" + program + "&pause\""
print("> " + command)
return os.system(command)


def start_program_async(program):
Expand Down Expand Up @@ -74,16 +76,6 @@ def main():
exe_ending = ".exe"
exe_names = get_exe_names(args.algorithm, args.io_processor, args.config)
procs = [start_program_async(os.path.join(binary_path, x) + exe_ending) for x in exe_names]

try:
while True:
user_in = input()
if user_in == "q":
print("Quitting prompt")
[proc.terminate() for proc in procs]
break
except Exception as e:
print("Python exception: [%s]" % str(e))

[proc.join() for proc in procs]

Expand Down

0 comments on commit 1c27399

Please sign in to comment.