-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_commands.py
20 lines (17 loc) · 1.08 KB
/
run_commands.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import subprocess
import concurrent.futures
commands = [
"python run.py meta.add_to_runname=\"8envs_10Msteps_norand_nogcrl\" environment.gcrl=False meta.randomize_after_steps=11000000",
"python run.py meta.add_to_runname=\"8envs_10Msteps_onlyrand_nogcrl\" environment.gcrl=False meta.randomize_after_steps=0",
"python run.py meta.add_to_runname=\"8envs_10Msteps_7_5Mrand_nogcrl\" environment.gcrl=False",
"python run.py meta.add_to_runname=\"8envs_10Msteps_7_5Mrand_gcrl\" environment.gcrl=True",
"python run.py meta.add_to_runname=\"8envs_10Msteps_onlyrand_gcrl\" environment.gcrl=True meta.randomize_after_steps=0",
"python run.py meta.add_to_runname=\"8envs_10Msteps_norand_gcrl\" environment.gcrl=True meta.randomize_after_steps=11000000"
]
def run_command(command):
print(f"Running command: {command}")
terminal_command = f'gnome-terminal -- bash -c "{command}; exec bash"'
subprocess.run(terminal_command, shell=True)
print("Command finished")
with concurrent.futures.ThreadPoolExecutor(max_workers=3) as executor:
executor.map(run_command, commands)