开发者
资源

HcclRankGraphGetTopoInstsByLayer

产品支持情况

产品

是否支持

Atlas 350 加速卡

Atlas A3 训练系列产品/Atlas A3 推理系列产品

Atlas A2 训练系列产品/Atlas A2 推理系列产品

Atlas 200I/500 A2 推理产品

Atlas 推理系列产品

Atlas 训练系列产品

功能说明

给定通信域和拓扑层级编号,查询当前rank所在的拓扑实例集合。

函数原型

1
HcclResult HcclRankGraphGetTopoInstsByLayer(HcclComm comm, uint32_t netLayer, uint32_t **topoInsts, uint32_t *topoInstNum)

参数说明

参数名

输入/输出

描述

comm

输入

通信域。

HcclComm类型的定义如下:

1
typedef void *HcclComm;

netLayer

输入

拓扑层级编号。

topoInsts

输出

拓扑实例列表。

topoInstNum

输出

拓扑实例数量。

返回值

HcclResult:接口成功返回HCCL_SUCCESS,其他失败。

约束说明

调用示例

1
2
3
4
5
6
7
HcclComm comm;
uint32_t netLayer = 0;
uint32_t *topoInsts = nullptr;
uint32_t topoInstNum = 0;
// topo文件中不配置topoInstanceId时默认为0
HcclRankGraphGetTopoInstsByLayer(comm, netLayer, &topoInsts, &topoInstNum); 
// topoInsts = [0], topoInstNum = 1