forked from taskgraph/taskgraph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
full_topo_master.go
34 lines (30 loc) · 1.05 KB
/
full_topo_master.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package topo
//The full structure is basically assume that every one is also parent for every else.
//And everyone else is communicating to get the data they need. Task 0 is forced/assumed to be the master.
//
//Also the star structure stays the same between epochs.
type FullTopologyOfMaster struct {
numOfTasks uint64
taskID uint64
all []uint64
}
// TODO, do we really need to expose this? Ideally after proper construction of StarTopology
// we should not need to set this again.
func (t *FullTopologyOfMaster) SetTaskID(taskID uint64) {
t.all = make([]uint64, 0, t.numOfTasks)
t.taskID = taskID
for index := uint64(0); index < t.numOfTasks; index++ {
t.all = append(t.all, index)
}
}
func (t *FullTopologyOfMaster) GetNeighbors(epoch uint64) []uint64 {
res := []uint64{0}
return res
}
// Creates a new tree topology with given fanout and number of tasks.
// This will be called during the task graph configuration.
func NewFullTopologyOfMaster(nTasks uint64) *FullTopologyOfMaster {
return &FullTopologyOfMaster{
numOfTasks: nTasks,
}
}