Ejemplo n.º 1
0
def bind(*nodes):
    nodes = list(set(nodes))
    res = ",".join(list(map(str, nodes)))
    c_string = bytes(res, "ascii")
    bitmask = LIBNUMA.numa_parse_nodestring(c_string)
    LIBNUMA.numa_run_on_node_mask(bitmask)
    LIBNUMA.numa_set_membind(bitmask)
Ejemplo n.º 2
0
def set_membind_nodes(*nodes) -> None:
    nodes = list(set(nodes))
    res = ",".join(list(map(str, nodes)))
    c_string = bytes(res, "ascii")
    bitmask = LIBNUMA.numa_parse_nodestring(c_string)
    op_res = LIBNUMA.numa_set_membind(bitmask)
    if op_res == -1:
        raise Exception(f"set membind nodes {res} failed")