utils.py
def countInterNodeCommunication(G, p, g_nodes, g_ppn):
    """
    Simple method that collects the number of internode communication, both sum and bottleneck
    for a permutation p, given n_nodes number of nodes with ppn processes per node. The graph is
    assumed to be directed
    :param G: simpleGraph needed for neighbor extraction
    :param p: permutation parameter as list
    :return: a tuple with bottleneck b and total s number of inter-node connections b,s
    """
    #n_nodes, ppn = getNumberOfNodesUsed(p)
    #bottleneck, sum
    sum = 0
    perNode = [0 for _ in range(g_nodes)]
    for index, rank in enumerate(p):
        # Takes care of the possibility that we have more hardware ressources than processes
        if rank < 0:
            continue
        rankNodeID = index // g_ppn
        for neighbor in G.getUnweightedNeighbors(rank):
            neighborIndex = p.index(neighbor)
            neighborNodeID = neighborIndex // g_ppn
            if neighborNodeID != rankNodeID:
                sum += 1
                perNode[rankNodeID] += 1
        index += 1
    return (max(perNode), sum)

    Simple method that collects the number of internode communication, both sum and bottleneck
    for a permutation p, given n_nodes number of nodes with ppn processes per node. The graph is
    assumed to be directed
    :param G: simpleGraph needed for neighbor extraction
    :param p: permutation parameter as list
    :return: a tuple with bottleneck b and total s number of inter-node connections b,s
    
Simple method that collects the number of internode communication, both sum and bottleneck
for a permutation p, given n_nodes number of nodes with ppn processes per node. The graph is
assumed to be directed
Simple method that collects the number of internode communication both sum and bottleneck for a permutation p given n_nodes number of nodes with ppn processes per node . The graph is assumed to be directed
def countInterNodeCommunication(G, p, g_nodes, g_ppn):
    sum = 0
    perNode = [0 for _ in range(g_nodes)]
    for index, rank in enumerate(p):
        if rank < 0:
            continue
        rankNodeID = index // g_ppn
        for neighbor in G.getUnweightedNeighbors(rank):
            neighborIndex = p.index(neighbor)
            neighborNodeID = neighborIndex // g_ppn
            if neighborNodeID != rankNodeID:
                sum += 1
                perNode[rankNodeID] += 1
        index += 1
    return (max(perNode), sum)
def countInterNodeCommunication ( G , p , g_nodes , g_ppn ) : sum = 0 perNode = [ 0 for _ in range ( g_nodes ) ] for index , rank in enumerate ( p ) : if rank < 0 : continue rankNodeID = index // g_ppn for neighbor in G . getUnweightedNeighbors ( rank ) : neighborIndex = p . index ( neighbor ) neighborNodeID = neighborIndex // g_ppn if neighborNodeID != rankNodeID : sum += 1 perNode [ rankNodeID ] += 1 index += 1 return ( max ( perNode ) , sum )
Simple method that collects the number of internode communication, both sum and bottleneck
for a permutation p, given n_nodes number of nodes with ppn processes per node.
Simple method that collects the number of internode communication both sum and bottleneck for a permutation p given n_nodes number of nodes with ppn processes per node .
"""
    Simple method that collects the number of internode communication, both sum and bottleneck
    for a permutation p, given n_nodes number of nodes with ppn processes per node. The graph is
    assumed to be directed
    :param G: simpleGraph needed for neighbor extraction
    :param p: permutation parameter as list
    :return: a tuple with bottleneck b and total s number of inter-node connections b,s
    """ #n_nodes, ppn = getNumberOfNodesUsed(p) #bottleneck, sum # Takes care of the possibility that we have more hardware ressources than processes
a tuple with bottleneck b and total s number of inter-node connections b,s
a tuple with bottleneck b and total s number of inter - node connections b s
G
simpleGraph needed for neighbor extraction
simpleGraph needed for neighbor extraction
p
permutation parameter as list
permutation parameter as list
g_nodes
g_ppn