提交 781a0b14 编写于 作者: Q qjing666

make examples more easy to follow

上级 f6a9c7c7
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
task_name=test_fl_job_submit_jingqinghe task_name=test_fl_job_submit_jingqinghe
hdfs_output=/user/feed/mlarch/sequence_generator/dongdaxiang/job_44 hdfs_output=/user/feed/mlarch/sequence_generator/dongdaxiang/job_44
train_cmd=python dist_trainer.py train_cmd=python dist_trainer.py
monitor_cmd=python system_monitor_app.py 10 100 #monitor_cmd=python system_monitor_app.py 10 100
#train_cmd=python test_hadoop.py #train_cmd=python test_hadoop.py
hdfs_path=afs://xingtian.afs.baidu.com:9902 hdfs_path=afs://xingtian.afs.baidu.com:9902
......
...@@ -120,10 +120,10 @@ print(ip_list) ...@@ -120,10 +120,10 @@ print(ip_list)
#allocate the role of each endpoint and their ids #allocate the role of each endpoint and their ids
ip_role = {} ip_role = {}
for i in range(len(ip_list)): for i in range(len(ip_list)):
if i < int(default_dict["server_nodes"]): if i < int(default_dict["server_nodes"]):
ip_role[ip_list[i]] = 'server%d' % i ip_role[ip_list[i]] = 'server%d' % i
else: else:
ip_role[ip_list[i]] = 'trainer%d' % (i-int(default_dict["server_nodes"])) ip_role[ip_list[i]] = 'trainer%d' % (i-int(default_dict["server_nodes"]))
print(ip_role) print(ip_role)
def job_generate(): def job_generate():
...@@ -179,7 +179,7 @@ while not all_job_sent: ...@@ -179,7 +179,7 @@ while not all_job_sent:
message = zmq_socket.recv() message = zmq_socket.recv()
group = message.split("\t") group = message.split("\t")
if group[0] == "GET_FL_JOB": if group[0] == "GET_FL_JOB":
download_job.append(group[1]) download_job.append(group[1])
zmq_socket.send(ip_role[group[1]]) zmq_socket.send(ip_role[group[1]])
else: else:
zmq_socket.send("WAIT\t0") zmq_socket.send("WAIT\t0")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册