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

Function broadcast_variable_grids

src/execution_algorithms/kfac.cpp:1185–1211  ·  view source on GitHub ↗

Broadcast the variabes in sub-grid parallelism

Source from the content-addressed store, hash-verified

1183}
1184// Broadcast the variabes in sub-grid parallelism
1185int broadcast_variable_grids(int variable, lbann_comm* comm)
1186{
1187
1188 El::Int variable_local[1], recvMetaData[1];
1189 if (comm->get_grid_type() == GridType::PRIMARY_GRID) {
1190 variable_local[0] = variable;
1191 }
1192 else if (comm->get_grid_type() == GridType::SECONDARY_GRID) {
1193 variable_local[0] = 0;
1194 }
1195
1196 if (comm->get_grid_type() == GridType::PRIMARY_GRID or
1197 comm->get_grid_type() == GridType::SECONDARY_GRID) {
1198 El::SyncInfo<El::Device::CPU> syncGeneralCPU =
1199 El::SyncInfo<El::Device::CPU>();
1200 El::mpi::AllReduce(variable_local,
1201 recvMetaData,
1202 1,
1203 El::mpi::MAX,
1204 comm->get_combined_grid_comm(),
1205 syncGeneralCPU);
1206 return recvMetaData[0];
1207 }
1208 else {
1209 return 0;
1210 }
1211}
1212
1213// =============================================
1214// KFAC implementation

Callers 1

on_forward_prop_endMethod · 0.85

Calls 1

get_grid_typeMethod · 0.80

Tested by

no test coverage detected