def is_cross_host(mpi_nodes, edge):
    """
    Return true if the supplied edge is a cross-host edge according to the
    mpi nodes supplied.
    """
    out_node_key = edge[0][0]
    in_node_key = edge[0][1]
    return mpi_nodes[out_node_key]["host"] != mpi_nodes[in_node_key]["host"]