diff --git a/breadcrumbs/scripts/startbfs.py b/breadcrumbs/scripts/startbfs.py index e9eab98..1909112 100644 --- a/breadcrumbs/scripts/startbfs.py +++ b/breadcrumbs/scripts/startbfs.py @@ -4,20 +4,24 @@ import subprocess -def start_program(command): - cmd_list = command.split(" ") - return subprocess.call(cmd_list) +def start_program(program): + if not isinstance(program, str): + raise ValueError("Argument passed to start_program_sync() should be a string") + return os.system("cmd /c " + program) -def start_program_no_hang(command): - print("Running %s from cwd %s" % (command, os.getcwd())) - proc = mp.Process(target=start_program, args=(command,)) - proc.start() - return proc +def start_program_async(program): + # TODO: This needs to account for the number of cores... + # Add another function called start_programs_async that takes a list + # of programs and starts them on the proper cores. + p = mp.Process(target=start_program, args=(program,)) + p.start() + return p def main(): - os.system("cmd /c ..\\bin\\Breadcrumbs.exe") + p = start_program_async("..\\bin\\Breadcrumbs.exe") + p.join() print("DONE")