add mpi_run version (not working yet)

This commit is contained in:
Erwin Coumans
2019-02-01 17:57:31 -08:00
parent 6c42cd3e1b
commit 176edeff1e
4 changed files with 118 additions and 34 deletions

View File

@@ -0,0 +1,52 @@
import numpy as np
import sys
import os
import inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(os.path.dirname(currentdir))
os.sys.path.insert(0,parentdir)
print("parentdir=",parentdir)
from pybullet_envs.deep_mimic.env.pybullet_deep_mimic_env import PyBulletDeepMimicEnv
from pybullet_envs.deep_mimic.learning.rl_world import RLWorld
from pybullet_utils.logger import Logger
from testrl import update_world, update_timestep, build_world
import pybullet_utils.mpi_util as MPIUtil
args = []
world = None
def run():
global update_timestep
global world
done = False
while not (done):
update_world(world, update_timestep)
return
def shutdown():
global world
Logger.print2('Shutting down...')
world.shutdown()
return
def main():
global args
global world
# Command line arguments
args = sys.argv[1:]
world = build_world(args, enable_draw=False)
run()
shutdown()
return
if __name__ == '__main__':
main()