Merge commit '4c060df2f17405dc26dc65a77e412d5c2a23525a'

Conflicts:
	subtree/rabit/tracker/rabit_yarn.py
This commit is contained in:
tqchen
2015-03-09 14:45:23 -07:00
7 changed files with 23 additions and 5 deletions

View File

@@ -65,9 +65,8 @@ inline int GetRank(void);
/*! \brief gets total number of processes */
inline int GetWorldSize(void);
/*! \brief whether rabit env is in distributed mode */
inline bool IsDistributed(void) {
return GetWorldSize() != 1;
}
inline bool IsDistributed(void);
/*! \brief gets processor's name */
inline std::string GetProcessorName(void);
/*!

View File

@@ -145,6 +145,8 @@ class IEngine {
virtual int GetRank(void) const = 0;
/*! \brief gets total number of nodes */
virtual int GetWorldSize(void) const = 0;
/*! \brief whether we run in distribted mode */
virtual bool IsDistributed(void) const = 0;
/*! \brief gets the host name of the current node */
virtual std::string GetHost(void) const = 0;
/*!

View File

@@ -107,6 +107,10 @@ inline int GetRank(void) {
inline int GetWorldSize(void) {
return engine::GetEngine()->GetWorldSize();
}
// whether rabit is distributed
inline bool IsDistributed(void) {
return engine::GetEngine()->IsDistributed();
}
// get the name of current processor
inline std::string GetProcessorName(void) {
return engine::GetEngine()->GetHost();