示例#1
0
def test_symmetrize_unweighted(managed, pool, graph_file):
    gc.collect()

    rmm.reinitialize(managed_memory=managed, pool_allocator=pool)

    assert (rmm.is_initialized())

    cu_M = utils.read_csv_file(graph_file + '.csv')

    sym_sources, sym_destinations = cugraph.symmetrize(cu_M['0'], cu_M['1'])

    #
    #  Check to see if all pairs in sources/destinations exist in
    #  both directions
    #
    #  Try this with join logic.  Note that if we create data frames
    #  we can join the data frames (using the DataFrame.merge function).
    #  The symmetrize function should contain every edge that was contained
    #  in the input data.  So if we join the input data with the output
    #  the length of the data frames should be equal.
    #
    sym_df = cudf.DataFrame()
    sym_df['src_s'] = sym_sources
    sym_df['dst_s'] = sym_destinations

    orig_df = cudf.DataFrame()
    orig_df['src'] = cu_M['0']
    orig_df['dst'] = cu_M['1']

    compare(orig_df['src'], orig_df['dst'], None, sym_df['src_s'],
            sym_df['dst_s'], None)
示例#2
0
def test_symmetrize_unweighted(graph_file):
    gc.collect()

    cu_M = utils.read_csv_file(graph_file)

    sym_sources, sym_destinations = cugraph.symmetrize(cu_M["0"], cu_M["1"])

    #
    #  Check to see if all pairs in sources/destinations exist in
    #  both directions
    #
    #  Try this with join logic.  Note that if we create data frames
    #  we can join the data frames (using the DataFrame.merge function).
    #  The symmetrize function should contain every edge that was contained
    #  in the input data.  So if we join the input data with the output
    #  the length of the data frames should be equal.
    #
    sym_df = cudf.DataFrame()
    sym_df["src_s"] = sym_sources
    sym_df["dst_s"] = sym_destinations

    orig_df = cudf.DataFrame()
    orig_df["src"] = cu_M["0"]
    orig_df["dst"] = cu_M["1"]

    compare(
        orig_df["src"],
        orig_df["dst"],
        None,
        sym_df["src_s"],
        sym_df["dst_s"],
        None,
    )
示例#3
0
def test_symmetrize_weighted(graph_file):
    gc.collect()

    cu_M = utils.read_csv_file(graph_file)

    sym_src, sym_dst, sym_w = cugraph.symmetrize(cu_M["0"], cu_M["1"],
                                                 cu_M["2"])

    compare(cu_M["0"], cu_M["1"], cu_M["2"], sym_src, sym_dst, sym_w)
示例#4
0
def test_symmetrize_weighted(graph_file):
    gc.collect()

    cu_M = utils.read_csv_file(graph_file+'.csv')

    sym_src, sym_dst, sym_w = cugraph.symmetrize(cu_M['0'],
                                                 cu_M['1'],
                                                 cu_M['2'])

    compare(cu_M['0'], cu_M['1'], cu_M['2'], sym_src, sym_dst, sym_w)
示例#5
0
def test_mg_symmetrize(graph_file, client_connection):
    gc.collect()

    ddf = utils.read_dask_cudf_csv_file(graph_file)
    sym_src, sym_dst = cugraph.symmetrize(ddf["src"], ddf["dst"])

    # convert to regular cudf to facilitate comparison
    df = ddf.compute()

    compare(df["src"], df["dst"], None, sym_src.compute(), sym_dst.compute(),
            None)
示例#6
0
def test_symmetrize_weighted(managed, pool, graph_file):
    gc.collect()

    rmm.reinitialize(managed_memory=managed, pool_allocator=pool)

    assert (rmm.is_initialized())

    cu_M = utils.read_csv_file(graph_file + '.csv')

    sym_src, sym_dst, sym_w = cugraph.symmetrize(cu_M['0'], cu_M['1'],
                                                 cu_M['2'])

    compare(cu_M['0'], cu_M['1'], cu_M['2'], sym_src, sym_dst, sym_w)
示例#7
0
def test_symmetrize_unweighted(graph_file):
    gc.collect()

    cu_M = utils.read_csv_file(graph_file)

    sym_sources, sym_destinations = cugraph.symmetrize(cu_M["0"], cu_M["1"])

    #
    #  Check to see if all pairs in sources/destinations exist in
    #  both directions
    #
    compare(
        cu_M["0"],
        cu_M["1"],
        None,
        sym_sources,
        sym_destinations,
        None,
    )