-
-
Save chongzhou96/2b2020d647639b693e8a4f5f2db7e8fd to your computer and use it in GitHub Desktop.
Launching script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
import os | |
import numpy as np | |
import time | |
# number of procs | |
file = 'download.py' | |
sleep_time = 5 | |
proc_N = 8 | |
# gpu_id = np.array([0,1,2,3,0,1,2,3,0,1,2,3]) | |
# assert proc_N == len(gpu_id) | |
# launch processes | |
for proc in range(0, proc_N): | |
my_env = os.environ.copy() | |
# my_env["CUDA_VISIBLE_DEVICES"] = '%g' % gpu_id[proc] | |
subprocess.Popen(['python', '%s' % file, '%d' % proc_N, '%d' % proc], env=my_env) | |
print('%g/%g process launched' % (proc, proc_N)) | |
time.sleep(sleep_time) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment