fix rabit for single node without initialization
This commit is contained in:
parent
e40047f9c2
commit
cfea4dbe85
@ -21,7 +21,7 @@ AllreduceBase::AllreduceBase(void) {
|
||||
host_uri = "";
|
||||
slave_port = 9010;
|
||||
nport_trial = 1000;
|
||||
rank = -1;
|
||||
rank = 0;
|
||||
world_size = -1;
|
||||
hadoop_mode = 0;
|
||||
version_number = 0;
|
||||
@ -50,6 +50,8 @@ void AllreduceBase::Init(void) {
|
||||
this->SetParam("rabit_world_size", num_task);
|
||||
}
|
||||
}
|
||||
// clear the setting before start reconnection
|
||||
this->rank = -1;
|
||||
//---------------------
|
||||
// start socket
|
||||
utils::Socket::Startup();
|
||||
|
||||
@ -58,6 +58,7 @@ class AllreduceBase : public IEngine {
|
||||
}
|
||||
/*! \brief get rank */
|
||||
virtual int GetWorldSize(void) const {
|
||||
if (world_size == -1) return 1;
|
||||
return world_size;
|
||||
}
|
||||
/*! \brief get rank */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user