Line data Source code
1 : /**
2 : * Copyright (c) 2026 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 : // 本文件仅用于 legacy ascend910 历史兼容,不再演进,不承接新特性;新增能力请落 base_comm/ 或
12 : // coll_communicator_mgr/ 正式目录。
13 :
14 : #ifndef LEGACY_OP_HCOM_INFO_H
15 : #define LEGACY_OP_HCOM_INFO_H
16 :
17 : #include <mutex>
18 : #include <unordered_map>
19 : #include <map>
20 : #include <memory>
21 : #include "topoinfo_detect.h" // transitively includes hccl_comm_pub.h, comm.h, topoinfo_struct.h
22 :
23 : struct HcclInfoTag {
24 : HcclCommPtr pComm;
25 : hccl::HcclCommParams params;
26 : hccl::RankTable_t rankTable;
27 : bool cloudFlag = false; // cloudFlag为0即实验室场景,cloudFlag为1则为云场景
28 : bool isUsed;
29 : std::mutex opGroupMapMutex;
30 : std::unordered_map<std::string, std::shared_ptr<hccl::hcclComm>> opGroup2CommMap;
31 : std::map<std::string, std::shared_ptr<hccl::TopoInfoDetect>> hcclCommTopoInfoDetectServer;
32 : std::map<std::string, std::shared_ptr<hccl::TopoInfoDetect>> hcclCommTopoInfoDetectAgent;
33 594 : HcclInfoTag() : isUsed(false) {}
34 :
35 594 : ~HcclInfoTag()
36 : {
37 594 : pComm = nullptr;
38 594 : opGroup2CommMap.clear();
39 594 : hcclCommTopoInfoDetectServer.clear();
40 594 : hcclCommTopoInfoDetectAgent.clear();
41 594 : }
42 : };
43 :
44 : using HcclOpInfoCtx = HcclInfoTag;
45 :
46 : #endif // LEGACY_OP_HCOM_INFO_H
|