| 28 | |
| 29 | |
| 30 | void Network::Init(Config config) { |
| 31 | if (config.num_machines > 1) { |
| 32 | linkers_.reset(new Linkers(config)); |
| 33 | rank_ = linkers_->rank(); |
| 34 | num_machines_ = linkers_->num_machines(); |
| 35 | bruck_map_ = linkers_->bruck_map(); |
| 36 | recursive_halving_map_ = linkers_->recursive_halving_map(); |
| 37 | block_start_ = std::vector<comm_size_t>(num_machines_); |
| 38 | block_len_ = std::vector<comm_size_t>(num_machines_); |
| 39 | buffer_size_ = 1024 * 1024; |
| 40 | buffer_.resize(buffer_size_); |
| 41 | Log::Info("Local rank: %d, total number of machines: %d", rank_, num_machines_); |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | void Network::Init(int num_machines, int rank, |
| 46 | ReduceScatterFunction reduce_scatter_ext_fun, AllgatherFunction allgather_ext_fun) { |
nothing calls this directly
no test coverage detected