def _get_graph_from_shared_mem(graph_name, use_graphbolt):
    """Get the graph from the DistGraph server.

    The DistGraph server puts the graph structure of the local partition in the shared memory.
    The client can access the graph structure and some metadata on nodes and edges directly
    through shared memory to reduce the overhead of data access.
    """
    if use_graphbolt:
        return gb.load_from_shared_memory(graph_name)
    g, ntypes, etypes = heterograph_index.create_heterograph_from_shared_memory(
        graph_name
    )
    if g is None:
        return None
    g = DGLGraph(g, ntypes, etypes)

    g.ndata["inner_node"] = _get_shared_mem_ndata(g, graph_name, "inner_node")
    g.ndata[NID] = _get_shared_mem_ndata(g, graph_name, NID)

    g.edata["inner_edge"] = _get_shared_mem_edata(g, graph_name, "inner_edge")
    g.edata[EID] = _get_shared_mem_edata(g, graph_name, EID)

    # heterogeneous graph has ETYPE
    if _exist_shared_mem_array(graph_name, ETYPE):
        g.edata[ETYPE] = _get_shared_mem_edata(g, graph_name, ETYPE)
    return g
Get the graph from the DistGraph server.

    The DistGraph server puts the graph structure of the local partition in the shared memory.
    The client can access the graph structure and some metadata on nodes and edges directly
    through shared memory to reduce the overhead of data access.
    
python/dgl/distributed/dist_graph.py