From 202006e30a166b1f8087633d13a6ef4f7e75dd5c Mon Sep 17 00:00:00 2001 From: Divya Shikre Date: Thu, 20 Aug 2020 10:22:24 -0400 Subject: [PATCH] Adding logic to skip the loop if src and dest device are the same in HW Topology. Signed-off-by: Divya Shikre Change-Id: Ib9cfbf5a7238ba75f6463e8fa6250bb9946b7979 [ROCm/amdsmi commit: 49734f8d3415b6b02bd786be81e3dca44d0cba17] --- projects/amdsmi/python_smi_tools/rocmSmiLib_cli.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/projects/amdsmi/python_smi_tools/rocmSmiLib_cli.py b/projects/amdsmi/python_smi_tools/rocmSmiLib_cli.py index 36ccda3b52..534644c9a4 100755 --- a/projects/amdsmi/python_smi_tools/rocmSmiLib_cli.py +++ b/projects/amdsmi/python_smi_tools/rocmSmiLib_cli.py @@ -1718,6 +1718,7 @@ def showWeightTopology(deviceList): for destdevice in deviceList: if (srcdevice == destdevice): gpu_links_weight[srcdevice][destdevice] = 0 + continue ret = rocmsmi.rsmi_topo_get_link_weight(srcdevice, destdevice, byref(weight)) if rsmi_ret_ok(ret): gpu_links_weight[srcdevice][destdevice] = weight @@ -1754,6 +1755,7 @@ def showHopsTopology(deviceList): for destdevice in deviceList: if (srcdevice == destdevice): gpu_links_hops[srcdevice][destdevice] = '0' + continue ret = rocmsmi.rsmi_topo_get_link_type(srcdevice, destdevice, byref(hops), byref(linktype)) if rsmi_ret_ok(ret): gpu_links_hops[srcdevice][destdevice] = hops @@ -1790,6 +1792,7 @@ def showTypeTopology(deviceList): for destdevice in deviceList: if (srcdevice == destdevice): gpu_links_type[srcdevice][destdevice] = '0' + continue ret = rocmsmi.rsmi_topo_get_link_type(srcdevice, destdevice, byref(hops), byref(linktype)) if rsmi_ret_ok(ret): if (linktype.value == 1):