def get_hosts_from_node(node):
    """
    Return the host set for an MPI node in the graph and its children
    """
    node_hosts = set()
    node_host = node["msg"].get("exec_host", "")
    node_hosts.add(node_host)

    children = node.get("chained", list())
    for c in children:
        child_hosts = get_hosts_from_node(c)
        node_hosts = node_hosts.union(child_hosts)

    return node_hosts