graph.h 749 Bytes
Newer Older
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
#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();

    // 通信路径计算
    scclResult_t calculateCommunicationPaths(const BootstrapComm_t* bootstrap_comm);

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

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

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

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