forked from xbpeng/DeepMimic
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmpi_run.py
More file actions
27 lines (23 loc) · 721 Bytes
/
mpi_run.py
File metadata and controls
27 lines (23 loc) · 721 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import sys
import subprocess
from util.arg_parser import ArgParser
from util.logger import Logger
import DeepMimic_Optimizer
def main():
# Command line arguments
args = sys.argv[1:]
arg_parser = ArgParser()
arg_parser.load_args(args)
num_workers = arg_parser.parse_int('num_workers', 1)
assert(num_workers > 0)
if (num_workers > 1):
Logger.print('Running with {:d} workers'.format(num_workers))
cmd = 'mpiexec -n {:d} python3 DeepMimic_Optimizer.py '.format(num_workers)
cmd += ' '.join(args)
Logger.print('cmd: ' + cmd)
subprocess.call(cmd, shell=True)
else:
DeepMimic_Optimizer.main()
return
if __name__ == '__main__':
main()