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 "comm.h"
22 : #include "hccl_comm_pub.h"
23 : #include "topoinfo_struct.h"
24 : #include "topoinfo_detect.h"
25 :
26 : struct HcclInfoTag {
27 : HcclCommPtr pComm;
28 : hccl::HcclCommParams params;
29 : hccl::RankTable_t rankTable;
30 : bool cloudFlag = false; // cloudFlag为0即实验室场景,cloudFlag为1则为云场景
31 : bool isUsed;
32 : std::mutex opGroupMapMutex;
33 : std::unordered_map<std::string, std::shared_ptr<hccl::hcclComm>> opGroup2CommMap;
34 : std::map<std::string, std::shared_ptr<hccl::TopoInfoDetect>> hcclCommTopoInfoDetectServer;
35 : std::map<std::string, std::shared_ptr<hccl::TopoInfoDetect>> hcclCommTopoInfoDetectAgent;
36 594 : HcclInfoTag() : isUsed(false) {}
37 :
38 594 : ~HcclInfoTag()
39 : {
40 594 : pComm = nullptr;
41 594 : opGroup2CommMap.clear();
42 594 : hcclCommTopoInfoDetectServer.clear();
43 594 : hcclCommTopoInfoDetectAgent.clear();
44 594 : }
45 : };
46 :
47 : using HcclOpInfoCtx = HcclInfoTag;
48 :
49 : #endif // LEGACY_OP_HCOM_INFO_H
|