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 : #include "topoinfo_ranktableConcise.h"
12 : #include <map>
13 : #include <vector>
14 : #include <string>
15 : #include <fstream>
16 : #include <algorithm>
17 : #include <unistd.h>
18 : #include <chrono>
19 : #include <iostream>
20 : #include <arpa/inet.h>
21 :
22 : #include "log.h"
23 : #include "env_config.h"
24 : #include "hccl_comm_pub.h"
25 : // ltm指定config路径
26 : #include "common/src/config.h"
27 : #include "workflow_pub.h"
28 : #include "device_capacity.h"
29 :
30 : using namespace std;
31 : using namespace hccl;
32 :
33 1 : TopoinfoRanktableConcise::TopoinfoRanktableConcise(const std::string& rankTableM, const std::string& identify)
34 : : TopoInfoRanktableParser(rankTableM, identify),
35 1 : isInterSuperPodRetryEnable_(GetExternalInputInterSuperPodRetryEnable())
36 1 : {}
37 :
38 1 : TopoinfoRanktableConcise::~TopoinfoRanktableConcise() {}
39 :
40 0 : HcclResult TopoinfoRanktableConcise::Init() { return HCCL_E_NOT_SUPPORT; }
41 :
42 0 : HcclResult TopoinfoRanktableConcise::GetClusterInfo(RankTable_t& clusterInfo) { return HCCL_E_NOT_SUPPORT; }
43 :
44 0 : HcclResult TopoinfoRanktableConcise::GetSelfClusterInfo(HcclCommParams& params) { return HCCL_E_NOT_SUPPORT; }
45 :
46 0 : HcclResult TopoinfoRanktableConcise::GetClusterInfo(hccl::HcclCommParams& params, hccl::RankTable_t& rankTable)
47 : {
48 0 : return HCCL_E_NOT_SUPPORT;
49 : }
50 :
51 0 : HcclResult TopoinfoRanktableConcise::SetIsInterSuperPodRetryEnable(bool isRetryEnable) { return HCCL_E_NOT_SUPPORT; }
52 :
53 0 : void TopoinfoRanktableConcise::DetectNicDepoly(RankTable_t& rankTable) { return; }
54 :
55 0 : HcclResult TopoinfoRanktableConcise::ParserClusterInfo(hccl::HcclCommParams& params, hccl::RankTable_t& rankTable)
56 : {
57 0 : return HCCL_E_NOT_SUPPORT;
58 : }
59 :
60 0 : HcclResult TopoinfoRanktableConcise::CheckNicDeployConsistence(RankTable_t& clusterInfo, NICDeployment deploy) const
61 : {
62 0 : return HCCL_E_NOT_SUPPORT;
63 : }
64 :
65 0 : HcclResult TopoinfoRanktableConcise::GetRanktableInfo(RankTable_t& clusterInfo) { return HCCL_E_NOT_SUPPORT; }
66 :
67 0 : HcclResult TopoinfoRanktableConcise::GetServerList(const nlohmann::json& obj, RankTable_t& clusterInfo)
68 : {
69 0 : return HCCL_E_NOT_SUPPORT;
70 : }
71 :
72 : HcclResult
73 0 : TopoinfoRanktableConcise::GetSingleServer(const nlohmann::json& serverListObj, u32 objIndex, RankTable_t& clusterInfo)
74 : {
75 0 : return HCCL_E_NOT_SUPPORT;
76 : }
77 :
78 0 : HcclResult TopoinfoRanktableConcise::GetDeviceList(
79 : const nlohmann::json& serverListObj, u32 objIndex, RankTable_t& clusterInfo, std::string& serverId, u32& serverIdx,
80 : HcclIpAddress& hostIp)
81 : {
82 0 : return HCCL_E_NOT_SUPPORT;
83 : }
84 :
85 0 : HcclResult TopoinfoRanktableConcise::GetSingleDevice(
86 : const nlohmann::json& deviceListObj, u32 objIndex, RankTable_t& clusterInfo, std::string& serverId, u32& serverIdx,
87 : HcclIpAddress& hostIp)
88 : {
89 0 : return HCCL_E_NOT_SUPPORT;
90 : }
91 :
92 0 : HcclResult TopoinfoRanktableConcise::SplitString(
93 : const std::string& str, const std::string& strC, std::vector<std::string>& strVector) const
94 : {
95 0 : return HCCL_E_NOT_SUPPORT;
96 : }
97 :
98 0 : HcclResult TopoinfoRanktableConcise::GetSingleDeviceIp(
99 : const nlohmann::json& deviceListObj, u32 objIndex, RankTable_t& clusterInfo, RankInfo_t& rankinfo,
100 : DevType deviceType, bool invalidHostIp)
101 : {
102 0 : return HCCL_E_NOT_SUPPORT;
103 : }
104 :
105 0 : HcclResult TopoinfoRanktableConcise::GetSingleBackupDeviceIp(
106 : const nlohmann::json& deviceListObj, u32 objIndex, RankInfo_t& rankinfo)
107 : {
108 0 : return HCCL_E_NOT_SUPPORT;
109 : }
110 :
111 0 : HcclResult TopoinfoRanktableConcise::GetSingleDeviceHostPort(
112 : const nlohmann::json& deviceListObj, u32 objIndex, RankInfo_t& rankinfo)
113 : {
114 0 : return HCCL_E_NOT_SUPPORT;
115 : }
116 :
117 : HcclResult
118 0 : TopoinfoRanktableConcise::GetSingleDevicePort(const nlohmann::json& deviceListObj, u32 objIndex, RankInfo_t& rankinfo)
119 : {
120 0 : return HCCL_E_NOT_SUPPORT;
121 : }
122 :
123 0 : HcclResult TopoinfoRanktableConcise::GetSingleBackupDevicePort(
124 : const nlohmann::json& deviceListObj, u32 objIndex, RankInfo_t& rankinfo)
125 : {
126 0 : return HCCL_E_NOT_SUPPORT;
127 : }
128 :
129 0 : HcclResult TopoinfoRanktableConcise::VerifyBackupDeviceIpAndPort(std::vector<RankInfo_t>& rankList, u32 devIndex)
130 : {
131 0 : return HCCL_E_NOT_SUPPORT;
132 : }
133 :
134 0 : HcclResult TopoinfoRanktableConcise::GetSingleSuperDeviceId(
135 : const nlohmann::json& deviceListObj, u32 objIndex, RankTable_t& clusterInfo, RankInfo_t& rankinfo)
136 : {
137 0 : return HCCL_E_NOT_SUPPORT;
138 : }
139 :
140 0 : HcclResult TopoinfoRanktableConcise::GetSuperPodList(const nlohmann::json& obj, RankTable_t& clusterInfo)
141 : {
142 0 : return HCCL_E_NOT_SUPPORT;
143 : }
144 :
145 : HcclResult
146 0 : TopoinfoRanktableConcise::GetSingleSuperPod(const nlohmann::json& superPodList, u32 objIndex, RankTable_t& clusterInfo)
147 : {
148 0 : return HCCL_E_NOT_SUPPORT;
149 : }
150 :
151 0 : HcclResult TopoinfoRanktableConcise::GetSuperPodServerList(
152 : const nlohmann::json& superPodList, u32 objIndex, RankTable_t& clusterInfo, std::string superPodId)
153 : {
154 0 : return HCCL_E_NOT_SUPPORT;
155 : }
156 :
157 0 : HcclResult TopoinfoRanktableConcise::GetSingleSuperPodSever(
158 : const nlohmann::json& superPodServerList, u32 objIndex, RankTable_t& clusterInfo, std::string superPodId)
159 : {
160 0 : return HCCL_E_NOT_SUPPORT;
161 : }
162 :
163 0 : HcclResult TopoinfoRanktableConcise::CheckSuperPodInfo(RankTable_t& clusterInfo) const { return HCCL_E_NOT_SUPPORT; }
164 :
165 : HcclResult
166 1 : TopoinfoRanktableConcise::GetSingleNicInfo(const nlohmann::json& serverListObj, u32 objIndex, RankInfo_t& rankinfo)
167 : {
168 1 : return HCCL_E_NOT_SUPPORT;
169 : }
|