MCPcopy Create free account
hub / github.com/LBANN/lbann / allreduce

Method allreduce

src/comm.cpp:559–585  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

557
558template <typename TensorDataType>
559void lbann_comm::allreduce(El::AbstractMatrix<TensorDataType>& m,
560 const El::mpi::Comm& c,
561 El::mpi::Op op) const
562{
563 if (El::mpi::Size(c) == 1 || m.Height() < 1 || m.Width() < 1) {
564 return;
565 }
566
567 const int local_size = m.Height() * m.Width();
568 m_bytes_sent += sizeof(DataType) * local_size;
569 m_bytes_received += sizeof(DataType) * local_size * (El::mpi::Size(c) - 1);
570
571 switch (m.GetDevice()) {
572 case El::Device::CPU:
573 return allreduce_impl(
574 static_cast<El::Matrix<TensorDataType, El::Device::CPU>&>(m),
575 c,
576 op);
577#ifdef LBANN_HAS_GPU
578 case El::Device::GPU:
579 return allreduce_impl(
580 static_cast<El::Matrix<TensorDataType, El::Device::GPU>&>(m),
581 c,
582 op);
583#endif // LBANN_HAS_GPU
584 }
585}
586
587template <typename TensorDataType>
588void lbann_comm::allreduce(El::AbstractDistMatrix<TensorDataType>& m,

Callers 15

fp_computeMethod · 0.45
bp_computeMethod · 0.45
compute_batch_statisticsFunction · 0.45
bp_training_implFunction · 0.45
fp_implFunction · 0.45
bp_implFunction · 0.45
fpFunction · 0.45
bpFunction · 0.45
fp_model_parallelFunction · 0.45
bp_model_parallelFunction · 0.45
fp_gpuFunction · 0.45
start_evaluationMethod · 0.45

Calls 3

allreduce_implFunction · 0.85
HeightMethod · 0.80
WidthMethod · 0.80

Tested by

no test coverage detected