LCOV - code coverage report
Current view: top level - legacy/ascend910/framework/communicator/impl - hccl_communicator_attrs_device.cc (source / functions) Coverage Total Hit
Test: coverage.info Lines: 95.3 % 86 82
Test Date: 2026-07-28 12:11:00 Functions: 95.3 % 43 41

            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 "hccl_communicator_attrs.h"
      12              : 
      13              : using namespace std;
      14              : 
      15              : namespace hccl
      16              : {
      17            1 :     HcclResult HcclCommunicatorAttrs::Init(HcclCommParams &params, const RankTable_t &rankTable)
      18              :     {
      19            1 :         return HCCL_SUCCESS;
      20              :     }
      21              : 
      22            0 :     HcclResult HcclCommunicatorAttrs::Init(HcclCommParams &params, const RankTable_t &rankTable,
      23              :                                            const std::map<HcclCMDType, std::vector<HcclAlgoType>>& algoConfigMap)
      24              :     {
      25            0 :         return HCCL_SUCCESS;
      26              :     }
      27              : 
      28            1 :     HcclResult HcclCommunicatorAttrs::Init(HcclCommParams &params, const std::vector<RankInfo> &rankList,
      29              :                                            WorldGroupInfo &groupCommonData)
      30              :     {
      31            1 :         return HCCL_SUCCESS;
      32              :     }
      33              : 
      34            0 :     HcclResult HcclCommunicatorAttrs::Init(HcclCommParams &params, const std::vector<RankInfo> &rankList,
      35              :                                            WorldGroupInfo &groupCommonData,
      36              :                                            const std::map<HcclCMDType, std::vector<HcclAlgoType>>& algoConfigMap)
      37              :     {
      38            0 :         return HCCL_SUCCESS;
      39              :     }
      40              : 
      41            1 :     bool HcclCommunicatorAttrs::IsStandardCard()
      42              :     {
      43            1 :         return false;
      44              :     }
      45              : 
      46            1 :     bool HcclCommunicatorAttrs::Is310PDuoCard()
      47              :     {
      48            1 :         return false;
      49              :     }
      50              : 
      51            1 :     bool HcclCommunicatorAttrs::IsCommon310P3DUO(const std::vector<RankInfo_t> &rankList)
      52              :     {
      53            1 :         return false;
      54              :     }
      55              : 
      56            1 :     bool HcclCommunicatorAttrs::CompareWithUserRank(const RankInfo &left, const RankInfo &right)
      57              :     {
      58            1 :         return false;
      59              :     }
      60              : 
      61            1 :     HcclResult HcclCommunicatorAttrs::CheckDeviceType(const DevType deviceType) const
      62              :     {
      63            1 :         return HCCL_SUCCESS;
      64              :     }
      65              : 
      66            1 :     HcclResult HcclCommunicatorAttrs::GetNicInfo(const NICDeployment &nicDeploy, const u32 curRankIndex,
      67              :                                                  const std::vector<RankInfo_t> &servRankList, RankInfo &rankInfo) const
      68              :     {
      69            1 :         return HCCL_SUCCESS;
      70              :     }
      71              : 
      72              :     // private
      73            1 :     HcclResult HcclCommunicatorAttrs::InitCommParams(HcclCommParams &params)
      74              :     {
      75            1 :         return HCCL_SUCCESS;
      76              :     }
      77              : 
      78            1 :     HcclResult HcclCommunicatorAttrs::SetServerId(const RankTable_t &rankTable)
      79              :     {
      80            1 :         return HCCL_SUCCESS;
      81              :     }
      82              : 
      83            1 :     HcclResult HcclCommunicatorAttrs::SetServerNum(const std::vector<RankInfo_t> &ranks)
      84              :     {
      85            1 :         return HCCL_SUCCESS;
      86              :     }
      87              : 
      88            1 :     HcclResult HcclCommunicatorAttrs::SetInnerServerAverageDevice(const RankTable_t &rankTable)
      89              :     {
      90            1 :         return HCCL_SUCCESS;
      91              :     }
      92              : 
      93              :     // sub group适配获取server内设配数
      94            1 :     HcclResult HcclCommunicatorAttrs::SetInnerServerAverageDevice(const std::vector<RankInfo> &rankList)
      95              :     {
      96            1 :         return HCCL_SUCCESS;
      97              :     }
      98              : 
      99            1 :     HcclResult HcclCommunicatorAttrs::TransformRankInfoByServerId(
     100              :         const std::vector<RankInfo_t> &rankList, ServRankInfo &servRankInfo) const
     101              :     {
     102            1 :         return HCCL_SUCCESS;
     103              :     }
     104              : 
     105            1 :     bool HcclCommunicatorAttrs::CompareWithDevicePhyId(const RankInfo_t &left, const RankInfo_t &right)
     106              :     {
     107            1 :         return false;
     108              :     }
     109              : 
     110            1 :     HcclResult HcclCommunicatorAttrs::SetModuleInfo(const std::vector<RankInfo_t> &rankList)
     111              :     {
     112            1 :         return HCCL_SUCCESS;
     113              :     }
     114              : 
     115            1 :     HcclResult HcclCommunicatorAttrs::SetSuperPodInfo(const std::vector<RankInfo_t> &rankList)
     116              :     {
     117            1 :         return HCCL_SUCCESS;
     118              :     }
     119              : 
     120              :     // 集群中存在910B A+X时,0-7卡: moduleIdx = 2 * serverIdx; 8-15卡: moduleIdx = 2 * serverIdx + 1
     121              :     // 集群中不存在910B A+X时,moduleIdx = serverIdx
     122            1 :     HcclResult HcclCommunicatorAttrs::GetModuleIdx(const RankInfo_t &rankInfo, u32 &moduleIdx)
     123              :     {
     124            1 :         return HCCL_SUCCESS;
     125              :     }
     126              : 
     127              :     // 用于标识集群中是否存在 910B A+X形态
     128            1 :     bool HcclCommunicatorAttrs::IsDiffDeviceModule(const std::vector<RankInfo_t> &rankList) const
     129              :     {
     130            1 :         return false;
     131              :     }
     132              : 
     133            1 :     HcclResult HcclCommunicatorAttrs::InitHccsPortNum()
     134              :     {
     135            1 :         return HCCL_SUCCESS;
     136              :     }
     137              : 
     138            1 :     HcclResult HcclCommunicatorAttrs::SetRankInfoList(const RankTable_t &rankTable)
     139              :     {
     140            1 :         return HCCL_SUCCESS;
     141              :     }
     142              : 
     143            1 :     HcclResult HcclCommunicatorAttrs::CheckRankTable(const RankTable_t &rankTable, const ServRankInfo &servRankInfo)
     144              :     {
     145            1 :         return HCCL_SUCCESS;
     146              :     }
     147              : 
     148            1 :     HcclResult HcclCommunicatorAttrs::CheckDevPhyId(const s32 &devicePhyId) const
     149              :     {
     150            1 :         return HCCL_SUCCESS;
     151              :     }
     152              : 
     153            1 :     HcclResult HcclCommunicatorAttrs::SortRankInfoList()
     154              :     {
     155            1 :         return HCCL_SUCCESS;
     156              :     }
     157              : 
     158            1 :     HcclResult HcclCommunicatorAttrs::CheckNicDeploy(NICDeployment nicDeploy, DevType deviceType) const
     159              :     {
     160            1 :         return HCCL_SUCCESS;
     161              :     }
     162              : 
     163            1 :     HcclResult HcclCommunicatorAttrs::CheckDevCount(const u32 devNum)
     164              :     {
     165            1 :         return HCCL_SUCCESS;
     166              :     }
     167              : 
     168            1 :     bool HcclCommunicatorAttrs::Check2N(u32 num) const
     169              :     {
     170            1 :         return false;
     171              :     }
     172              : 
     173            1 :     HcclResult HcclCommunicatorAttrs::SetLocalRankInfo()
     174              :     {
     175            1 :         return HCCL_SUCCESS;
     176              :     }
     177              : 
     178            1 :     HcclResult HcclCommunicatorAttrs::SetLocalRankInfoSubGroup(const std::vector<RankInfo> &rankList)
     179              :     {
     180            1 :         return HCCL_SUCCESS;
     181              :     }
     182              : 
     183            1 :     HcclResult HcclCommunicatorAttrs::CheckLocalRankInfo()
     184              :     {
     185            1 :         return HCCL_SUCCESS;
     186              :     }
     187              : 
     188            1 :     u32 HcclCommunicatorAttrs::CalMeshAggRankSize(int halfDevNum) const
     189              :     {
     190            1 :         return 0;
     191              :     }
     192              : 
     193            1 :     HcclResult HcclCommunicatorAttrs::SetMeshAggregationRankSize(u32 size)
     194              :     {
     195            1 :         return HCCL_SUCCESS;
     196              :     }
     197              : 
     198            1 :     HcclResult HcclCommunicatorAttrs::CalAndSetMeshAggRankSize()
     199              :     {
     200            1 :         return HCCL_SUCCESS;
     201              :     }
     202              : 
     203            1 :     HcclResult HcclCommunicatorAttrs::SetWorldGroupInfo(
     204              :         std::unordered_map<std::string, std::map<u32, HcclIpAddress>> &phyIdNicInfoMap,
     205              :         std::vector<RankInfo> &worldRankInfoList, std::vector<u32> &nicRanksPort, std::vector<u32> &vnicRanksPort)
     206              :     {
     207            1 :         return HCCL_SUCCESS;
     208              :     }
     209              : 
     210            1 :     HcclResult HcclCommunicatorAttrs::TransformRankList(
     211              :         const std::vector<RankInfo> &rankListIn, std::vector<RankInfo_t> &rankListOut)
     212              :     {
     213            1 :         return HCCL_SUCCESS;
     214              :     }
     215              : 
     216            1 :     bool HcclCommunicatorAttrs::IsEnableRoce()
     217              :     {
     218            1 :         return false;
     219              :     }
     220              : 
     221              :     // a+x mesh间需要同时保证ip有效和roce开关打开才能走rdma
     222            1 :     bool HcclCommunicatorAttrs::IsUsedRdmaLevel0AndIpInvalid()
     223              :     {
     224            1 :         return false;
     225              :     }
     226              : 
     227            1 :     bool HcclCommunicatorAttrs::IsSupportEnableRoce()
     228              :     {
     229            1 :         return false;
     230              :     }
     231              : 
     232            1 :     void HcclCommunicatorAttrs::GetTopoAttr(HcclTopoAttr &topoAttr)
     233              :     {
     234            1 :     }
     235              : 
     236            1 :     void HcclCommunicatorAttrs::GetAlgoAttr(HcclAlgoAttr &algoAttr)
     237              :     {
     238            1 :     }
     239              : 
     240            1 :     u32 HcclCommunicatorAttrs::GetLocalNicPort(NicType nicType)
     241              :     {
     242            1 :         return 0;
     243              :     }
     244              : }
        

Generated by: LCOV version 2.0-1