提交 ea2ad7f0 编写于 作者: W willzhang4a58

fix bug for ctrl server, not response for pushplan

上级 c259b77a
......@@ -7,6 +7,7 @@ default_data_type: kFloat
use_async_cpu_stream: false
global_fs_conf {
hdfs_conf {
namenode: "hdfs://192.168.1.11:9000"
}
}
train_conf {
......
machine {
addr: "192.168.1.11"
port: 9000
port: 6666
name: "192.168.1.11"
}
machine {
addr: "192.168.1.13"
port: 9000
port: 6666
name: "192.168.1.13"
}
......
......@@ -131,16 +131,18 @@ void CtrlServer::WaitUntilDoneHandler(
void CtrlServer::PushPlanHandler(
CtrlCall<PushPlanRequest, PushPlanResponse>* call) {
plan_.reset(new Plan(call->request().plan()));
for (auto call : pending_plan_calls_) {
*(call->mut_response()->mutable_plan()) = *plan_;
call->SendResponse();
for (auto pending_call : pending_plan_calls_) {
*(pending_call->mut_response()->mutable_plan()) = *plan_;
pending_call->SendResponse();
}
call->SendResponse();
ENQUEUE_REQUEST(PushPlan);
}
void CtrlServer::ClearPlanHandler(
CtrlCall<ClearPlanRequest, ClearPlanResponse>* call) {
plan_.reset();
call->SendResponse();
ENQUEUE_REQUEST(ClearPlan);
}
......@@ -158,16 +160,18 @@ void CtrlServer::PullPlanHandler(
void CtrlServer::PushPortHandler(
CtrlCall<PushPortRequest, PushPortResponse>* call) {
port_ = call->request().port();
for (auto call : pending_port_calls_) {
call->mut_response()->set_port(port_);
call->SendResponse();
for (auto pending_call : pending_port_calls_) {
pending_call->mut_response()->set_port(port_);
pending_call->SendResponse();
}
call->SendResponse();
ENQUEUE_REQUEST(PushPort);
}
void CtrlServer::ClearPortHandler(
CtrlCall<ClearPortRequest, ClearPortResponse>* call) {
port_ = -1;
call->SendResponse();
ENQUEUE_REQUEST(ClearPort);
}
......
......@@ -2,6 +2,7 @@
#include <errno.h>
#include "oneflow/core/common/str_util.h"
#include "oneflow/core/job/job_desc.h"
#include "oneflow/core/persistence/hadoop/hadoop_file_system.h"
#include "oneflow/core/persistence/posix/posix_file_system.h"
#include "oneflow/core/persistence/windows/windows_file_system.h"
......@@ -91,8 +92,7 @@ struct GlobalFSConstructor {
CHECK_EQ(JobDesc::Singleton()->resource().machine().size(), 1);
gfs = LocalFS();
} else if (gfs_conf.has_hdfs_conf()) {
// static fs::FileSystem* fs = new
// fs::HadoopFileSystem(gfs_conf.hdfs_conf()); return fs;
gfs = new HadoopFileSystem(gfs_conf.hdfs_conf());
} else {
UNEXPECTED_RUN();
}
......
......@@ -128,9 +128,9 @@ void LibHDFS::LoadAndBind() {
#else
const char* kLibHdfsDso = "libhdfs.so";
#endif
char* hdfs_home = getenv("HADOOP_HDFS_HOME");
char* hdfs_home = getenv("HADOOP_HOME");
if (hdfs_home == nullptr) {
PLOG(WARNING) << "Environment variable HADOOP_HDFS_HOME not set";
PLOG(WARNING) << "Environment variable HADOOP_HOME not set";
status_ = false;
return;
}
......
......@@ -8,13 +8,14 @@ SCHEDULER_CMD='GLOG_logtostderr=0 GLOG_log_dir=./log GLOG_v=0 GLOG_logbuflevel=-
set +e
for host in "${hosts[@]}"
do
ssh $USER@$host "/usr/sbin/fuser -k 9000/tcp"
ssh $USER@$host "/usr/sbin/fuser -k 6666/tcp"
ssh $USER@$host "mkdir ~/oneflow_temp"
done
set -e
for host in "${hosts[@]}"
do
ssh $USER@$host 'rm -rf ~/oneflow_temp && mkdir ~/oneflow_temp'
ssh $USER@$host 'rm -rf ~/oneflow_temp/*'
scp ./compiler ./runtime ./scheduler ./*.prototxt $USER@$host:~/oneflow_temp
ssh $USER@$host "cd ~/oneflow_temp; $SCHEDULER_CMD -this_machine_name=$host &"
done
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册