ip fix
This commit is contained in:
@@ -53,37 +53,27 @@ def main():
|
|||||||
|
|
||||||
def run_sim(args):
|
def run_sim(args):
|
||||||
|
|
||||||
|
method = prep_ray(args)
|
||||||
|
sim = new_simulations(args.config, args.id, Method=method)
|
||||||
|
sim.run()
|
||||||
|
|
||||||
|
|
||||||
|
def prep_ray(args):
|
||||||
if args.start_ray:
|
if args.start_ray:
|
||||||
init_str = ray.init()
|
init_str = ray.init()
|
||||||
elif not args.no_ray:
|
elif not args.no_ray:
|
||||||
init_str = ray.init(
|
init_str = ray.init(
|
||||||
address="auto",
|
address="auto",
|
||||||
_node_ip_address=os.environ.get("ip_head", "127.0.0.1").split(":")[0],
|
# _node_ip_address=os.environ.get("ip_head", "127.0.0.1").split(":")[0],
|
||||||
_redis_password=os.environ.get("redis_password", "caco1234"),
|
_redis_password=os.environ.get("redis_password", "caco1234"),
|
||||||
)
|
)
|
||||||
|
|
||||||
print(init_str)
|
print(init_str)
|
||||||
if args.no_ray:
|
return SequencialSimulations if args.no_ray else None
|
||||||
sim = new_simulations(args.config, args.id, Method=SequencialSimulations)
|
|
||||||
else:
|
|
||||||
sim = new_simulations(args.config, args.id)
|
|
||||||
|
|
||||||
sim.run()
|
|
||||||
|
|
||||||
|
|
||||||
def resume_sim(args):
|
def resume_sim(args):
|
||||||
if args.start_ray:
|
method = prep_ray(args)
|
||||||
init_str = ray.init()
|
sim = resume_simulations(args.data_dir, args.id, Method=method)
|
||||||
else:
|
|
||||||
init_str = ray.init(
|
|
||||||
address="auto",
|
|
||||||
_node_ip_address=os.environ.get("ip_head", "127.0.0.1").split(":")[0],
|
|
||||||
_redis_password=os.environ.get("redis_password", "caco1234"),
|
|
||||||
)
|
|
||||||
|
|
||||||
print(init_str)
|
|
||||||
sim = resume_simulations(args.data_dir, args.id)
|
|
||||||
|
|
||||||
sim.run()
|
sim.run()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ echo $ip > ~/ip_head
|
|||||||
port=6379
|
port=6379
|
||||||
ip_head=$ip:$port
|
ip_head=$ip:$port
|
||||||
export ip_head
|
export ip_head
|
||||||
|
export RAY_ADDRESS=$ip_head
|
||||||
echo "IP Head: $ip_head"
|
echo "IP Head: $ip_head"
|
||||||
|
|
||||||
ip_submit=$(hostname --ip-address)
|
ip_submit=$(hostname --ip-address)
|
||||||
|
|||||||
Reference in New Issue
Block a user