Line data Source code
1 : /**
2 : * Copyright (c) 2025 Huawei Technologies Co., Ltd.
3 : * This program is free software, you can redistribute it and/or modify it under the terms and conditions of
4 : * CANN Open Software License Agreement Version 2.0 (the "License").
5 : * Please refer to the License for details. You may not use this file except in compliance with the License.
6 : * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
7 : * INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
8 : * See LICENSE in the root of the software repository for the full text of the License.
9 : */
10 :
11 : #ifndef HCCLV2_TOPO_MATCH_CONCURR_MESH
12 : #define HCCLV2_TOPO_MATCH_CONCURR_MESH
13 :
14 : #include "topo_match_base.h"
15 :
16 : namespace Hccl {
17 :
18 : class TopoMatchConcurrMesh : public TopoMatchBase {
19 : public:
20 : explicit TopoMatchConcurrMesh(
21 : const RankId vRank, const u32 rankSize, const RankGraph* rankGraph, const DevType devType);
22 : ~TopoMatchConcurrMesh() override;
23 :
24 1 : std::string Describe() const override
25 : {
26 1 : return "Topo Match for Multi-dimensional Concurrent Mesh Algorithm (CURRENTLY only 2-D Concurr Mesh is "
27 2 : "supported).";
28 : }
29 : using TopoMatchBase::MatchTopo;
30 : HcclResult MatchTopo(
31 : std::vector<std::vector<RankId>>& vTopo, std::vector<RankId>& virtRanks,
32 : std::map<RankId, u32>& virtRankMap) override;
33 :
34 : private:
35 : std::vector<RankId> rankIds_; // virtualTopoRank
36 : std::vector<RankId> rankOnSameBoard_; // ranks with same boardIds in rack
37 : std::vector<RankId> rankOnSameSlot_; // ranks with same slotIds in rack
38 : std::vector<std::vector<RankId>> rankOnSameBoardVector_; // ranks vector with same boardIds in rack
39 : std::vector<std::vector<RankId>> rankOnSameSlotVector_; // ranks vector with same slotIds in rack
40 : std::vector<u32> numRanksPerBoard_; // ranks num with same boardIds in rack
41 : };
42 : } // namespace Hccl
43 :
44 : #endif // !HCCLV2_TOPO_MATCH_CONCURR_MESH
|