parameters: (self, trace_event: list)
return_statement: return src_dst_dict
docstring: Divide information by src rank id and dst rank id
docstring_summary: Divide information by src rank id and dst rank id
docstring_tokens: Divide information by src rank id and dst rank id
function: def _divide_communication_info_by_src_dst_rank(self, trace_event: list):
          """Divide information by src rank id and dst rank id"""
          src_dst_dict = dict()
          for item in trace_event:
              src_rank = item.get("args").get("src rank")
              dst_rank = item.get("args").get("dst rank")
              if src_rank is None or dst_rank is None:
                  continue
  
              # When the SDMA operation is in the card,
              # the source card or destination card is 0xffffffff, and it needs to be converted to localrank.
              if int(src_rank) == int('0xffffffff', 16):
                  src_rank = dst_rank
  
              if int(dst_rank) == int('0xffffffff', 16):
                  dst_rank = src_rank
  
              if item.get("args").get("transport type") == CommunicationInfo.LOCAL.value:
                  item["args"]["src rank"] = dst_rank
                  item["args"]["dst rank"] = src_rank
                  src_dst_key = str(dst_rank) + '-' + str(src_rank)
              else:
                  src_dst_key = str(src_rank) + '-' + str(dst_rank)
  
              if src_dst_key not in src_dst_dict.keys():
                  src_dst_dict[src_dst_key] = [item]
              else:
                  src_dst_dict[src_dst_key].append(item)
          return src_dst_dict
function_tokens: def _divide_communication_info_by_src_dst_rank ( self , trace_event : list ) : src_dst_dict = dict ( ) for item in trace_event : src_rank = item . get ( "args" ) . get ( "src rank" ) dst_rank = item . get ( "args" ) . get ( "dst rank" ) if src_rank is None or dst_rank is None : continue # When the SDMA operation is in the card, # the source card or destination card is 0xffffffff, and it needs to be converted to localrank. if int ( src_rank ) == int ( '0xffffffff' , 16 ) : src_rank = dst_rank if int ( dst_rank ) == int ( '0xffffffff' , 16 ) : dst_rank = src_rank if item . get ( "args" ) . get ( "transport type" ) == CommunicationInfo . LOCAL . value : item [ "args" ] [ "src rank" ] = dst_rank item [ "args" ] [ "dst rank" ] = src_rank src_dst_key = str ( dst_rank ) + '-' + str ( src_rank ) else : src_dst_key = str ( src_rank ) + '-' + str ( dst_rank ) if src_dst_key not in src_dst_dict . keys ( ) : src_dst_dict [ src_dst_key ] = [ item ] else : src_dst_dict [ src_dst_key ] . append ( item ) return src_dst_dict