Skip to content

Commit

Permalink
move Network method implementations from network.h to network.cpp (fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jameslamb authored Sep 23, 2021
1 parent b52ecb1 commit e157279
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 2 additions & 10 deletions include/LightGBM/network.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ class Network {
/*! \brief Free this static class */
static void Dispose();
/*! \brief Get rank of this machine */
static inline int rank();
static int rank();
/*! \brief Get total number of machines */
static inline int num_machines();
static int num_machines();

/*!
* \brief Perform all_reduce. if data size is small,
Expand Down Expand Up @@ -312,14 +312,6 @@ class Network {
static THREAD_LOCAL AllgatherFunction allgather_ext_fun_;
};

inline int Network::rank() {
return rank_;
}

inline int Network::num_machines() {
return num_machines_;
}

} // namespace LightGBM

#endif // LightGBM_NETWORK_H_
8 changes: 8 additions & 0 deletions src/network/network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -317,4 +317,12 @@ void Network::ReduceScatterRing(char* input, comm_size_t, int type_size,
std::memcpy(output, input + block_start[rank_], block_len[rank_]);
}

int Network::rank() {
return rank_;
}

int Network::num_machines() {
return num_machines_;
}

} // namespace LightGBM

0 comments on commit e157279

Please sign in to comment.