utils.py
def hash_permutation(p: [int], n_sockets: int, n_nodes: int,  pps: int):
    """
    Takes a permutation array and produces a hash key in string form.
    Ranks on a socket a sorted and delimited with a '_', sockets are
    delimited by '__', whereas nodes are delimited with '-'.
    :param p: permutation array
    :param n_sockets: number of sockets
    :param pps: processes per socket
    :return: string array to be cashed
    """
    ppn = n_sockets * pps
    node_ranks = [p[ppn*i:ppn+ppn*i] for i in range(n_nodes)]
    socket_ranks = [[sorted(node[i*pps:i*pps + pps]) for i in range(n_sockets)] for node in node_ranks]
    socket_ranks.sort()
    return str(socket_ranks)

    Takes a permutation array and produces a hash key in string form.
    Ranks on a socket a sorted and delimited with a '_', sockets are
    delimited by '__', whereas nodes are delimited with '-'.
    :param p: permutation array
    :param n_sockets: number of sockets
    :param pps: processes per socket
    :return: string array to be cashed
    
Takes a permutation array and produces a hash key in string form.
Takes a permutation array and produces a hash key in string form .
def hash_permutation(p: [int], n_sockets: int, n_nodes: int,  pps: int):
    ppn = n_sockets * pps
    node_ranks = [p[ppn*i:ppn+ppn*i] for i in range(n_nodes)]
    socket_ranks = [[sorted(node[i*pps:i*pps + pps]) for i in range(n_sockets)] for node in node_ranks]
    socket_ranks.sort()
    return str(socket_ranks)
def hash_permutation ( p : [ int ] , n_sockets : int , n_nodes : int , pps : int ) : ppn = n_sockets * pps node_ranks = [ p [ ppn * i : ppn + ppn * i ] for i in range ( n_nodes ) ] socket_ranks = [ [ sorted ( node [ i * pps : i * pps + pps ] ) for i in range ( n_sockets ) ] for node in node_ranks ] socket_ranks . sort ( ) return str ( socket_ranks )
Takes a permutation array and produces a hash key in string form.
Takes a permutation array and produces a hash key in string form .
"""
    Takes a permutation array and produces a hash key in string form.
    Ranks on a socket a sorted and delimited with a '_', sockets are
    delimited by '__', whereas nodes are delimited with '-'.
    :param p: permutation array
    :param n_sockets: number of sockets
    :param pps: processes per socket
    :return: string array to be cashed
    """
string array to be cashed
string array to be cashed
p
[int]
None
n_sockets
int
number of sockets
number of sockets
n_nodes
int
pps
int
processes per socket
processes per socket