graph.h 828 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#pragma once

#include <vector>
#include "base.h"
#include "graph_utils.h"

namespace sccl {
namespace hardware {
namespace topology {
namespace graph {

class Graph {
public:
    Graph(int rank, int nRanks);
    virtual ~Graph();

    // 通信路径计算
18
    scclResult_t calculateCommunicationPaths(const BootstrapComm_t* bootstrap_comm, scclTopoGraph_t* topo_graph, Bootstrap* sccl_bootstrap);
19
20
21
22
23
24
25
26
27
28

    // 逻辑拓扑构建
    scclResult_t buildLogicalTopology();

    // 根据无向图计算topo路径
    scclResult_t calculateTopoChannels();

private:
    std::vector<std::vector<int>> adjacencyMatrix; // 使用邻接矩阵表示图
    // 你可以根据需要添加更多的私有成员变量和函数
29
30

    int rank, nRanks;
31
32
33
34
35
36
};

} // namespace graph
} // namespace topology
} // namespace hardware
} // namespace sccl