diff --git a/example.py b/example.py index 41df229..b790a4b 100644 --- a/example.py +++ b/example.py @@ -20,10 +20,10 @@ import time # cluster specification -parameter_servers = ["pc-01:2222"] -workers = [ "pc-02:2222", - "pc-03:2222", - "pc-04:2222"] +parameter_servers = ["localhost:2222"] +workers = [ "localhost:2223", "localhost:2224","localhost:2225"] + + cluster = tf.train.ClusterSpec({"ps":parameter_servers, "worker":workers}) # input flags diff --git a/run_code.sh b/run_code.sh new file mode 100644 index 0000000..84dae4a --- /dev/null +++ b/run_code.sh @@ -0,0 +1,8 @@ +export CUDA_VISIBLE_DEVICES=-1 +python example.py --job_name "ps" --task_index 0 & +export CUDA_VISIBLE_DEVICES=0 +python example.py --job_name "worker" --task_index 0 & +export CUDA_VISIBLE_DEVICES=1 +python example.py --job_name "worker" --task_index 1 & +export CUDA_VISIBLE_DEVICES=2 +python example.py --job_name "worker" --task_index 2