tensorflow/core/common_runtime/ring_alg.cc
// When a RingField transitions from first to second recompute the
// do_send and do_recv values.
When a RingField transitions from first to second recompute the
do_send and do_recv values.
When a RingField transitions from first to second recompute the do_send and do_recv values .
void RingAlg::AdvanceToSecondPass(RingField* rf) {
  VLOG(3) << "IncrRingField old value " << rf->DebugString();
  DCHECK(!rf->second_pass);
  rf->second_pass = true;
  rf->action = RF_INIT;
  if (ca_->ChunkBytes(rf->sc_idx) > 0) {
    rf->do_recv =
        (rf->rank != ((rf->chunk_idx + (group_size_ - 1)) % group_size_));
    rf->do_send =
        (rf->rank != ((rf->chunk_idx + (group_size_ - 2)) % group_size_));
  }
  rf->is_final =
      (rf->rank == ((rf->chunk_idx + (group_size_ - 2)) % group_size_));
  VLOG(3) << "IncrRingField new value " << rf->DebugString();
}
void RingAlg :: AdvanceToSecondPass ( RingField * rf ) { VLOG ( 3 ) << " " << rf -> DebugString ( ) ; DCHECK ( ! rf -> second_pass ) ; rf -> second_pass = true ; rf -> action = RF_INIT ; if ( ca_ -> ChunkBytes ( rf -> sc_idx ) > 0 ) { rf -> do_recv = ( rf -> rank != ( ( rf -> chunk_idx + ( group_size_ - 1 ) ) % group_size_ ) ) ; rf -> do_send = ( rf -> rank != ( ( rf -> chunk_idx + ( group_size_ - 2 ) ) % group_size_ ) ) ; } rf -> is_final = ( rf -> rank == ( ( rf -> chunk_idx + ( group_size_ - 2 ) ) % group_size_ ) ) ; VLOG ( 3 ) << " " << rf -> DebugString ( ) ; }
When a RingField transitions from first to second recompute the
do_send and do_recv values.
When a RingField transitions from first to second recompute the do_send and do_recv values .
// In pass 1 the send/no-send boundary moves down 1 place.