MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / IsComputTaskNodeDutyRank

Function IsComputTaskNodeDutyRank

oneflow/core/graph/task_graph.cpp:1139–1150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1137namespace {
1138
1139bool IsComputTaskNodeDutyRank(int64_t current_rank, const ParallelDesc& parallel_desc,
1140 int64_t task_node_rank) {
1141 if (current_rank == 0) {
1142 // make sure master knows at least one op_node.
1143 return CHECK_JUST(parallel_desc.MachineId4ParallelId(0)) == task_node_rank;
1144 } else if (parallel_desc.HasMachineId(current_rank)) {
1145 // workers only care their own rank.
1146 return current_rank == task_node_rank;
1147 } else {
1148 return false;
1149 }
1150}
1151
1152// A template function to process task node for different task node type.
1153// RetT, function return type

Callers 2

SelectTaskNodeByRankMethod · 0.85
IsDutyRankMethod · 0.85

Calls 2

MachineId4ParallelIdMethod · 0.80
HasMachineIdMethod · 0.80

Tested by

no test coverage detected