tensorflow/core/common_runtime/collective_param_resolver_local.cc
// Create a populated GlobalDeviceMap from CollInstanceParams and localities.
Create a populated GlobalDeviceMap from CollInstanceParams and localities.
Create a populated GlobalDeviceMap from CollInstanceParams and localities .
GlobalDeviceMap BuildDevRecs(const CollGroupParams& gp) {
  GlobalDeviceMap gdm;
  CHECK_EQ(gp.members.size(), gp.members.size());
  for (int i = 0; i < gp.members.size(); ++i) {
    TaskDeviceMap& tdm = gdm[gp.members[i].task];
    DevRec* dr = &tdm[gp.members[i].device.name()];
    dr->task = gp.members[i].task;
    dr->device = gp.members[i].device.name();
    dr->original_rank = i;
    dr->local_rank = 0;   
    dr->global_rank = 0;  
    dr->locality = &gp.members[i].device.locality();
  }
  return gdm;
}
GlobalDeviceMap BuildDevRecs ( const CollGroupParams & gp ) { GlobalDeviceMap gdm ; CHECK_EQ ( gp . members . size ( ) , gp . members . size ( ) ) ; for ( int i = 0 ; i < gp . members . size ( ) ; ++ i ) { TaskDeviceMap & tdm = gdm [ gp . members [ i ] . task ] ; DevRec * dr = & tdm [ gp . members [ i ] . device . name ( ) ] ; dr -> task = gp . members [ i ] . task ; dr -> device = gp . members [ i ] . device . name ( ) ; dr -> original_rank = i ; dr -> local_rank = 0 ; dr -> global_rank = 0 ; dr -> locality = & gp . members [ i ] . device . locality ( ) ; } return gdm ; }
Create a populated GlobalDeviceMap from CollInstanceParams and localities.
Create a populated GlobalDeviceMap from CollInstanceParams and localities .
// Will be populated later by OrderTaskDeviceMap. // Will be populated later by EstablishGlobalRank.