Example #1
0
    def _replicate_edgelist(self):
        client = mg_utils.get_client()
        comms = Comms.get_comms()

        # FIXME: There  might be a better way to control it
        if client is None:
            return
        work_futures = replication.replicate_cudf_dataframe(
            self.edgelist.edgelist_df, client=client, comms=comms)

        self.batch_edgelists = work_futures
def test_replicate_cudf_dataframe_no_weights(input_data_path, mg_device_count):
    skip_if_not_enough_devices(mg_device_count)
    df = cudf.read_csv(input_data_path,
                       delimiter=' ',
                       names=['src', 'dst'],
                       dtype=['int32', 'int32'])
    with MGContext(mg_device_count):
        worker_to_futures = replication.replicate_cudf_dataframe(df)
        for worker in worker_to_futures:
            replicated_df = worker_to_futures[worker].result()
            assert df.equals(replicated_df), "There is a mismatch in one " \
                "of the replications"
Example #3
0
def test_replicate_cudf_dataframe_no_weights(input_data_path, dask_client):
    gc.collect()
    df = cudf.read_csv(
        input_data_path,
        delimiter=" ",
        names=["src", "dst"],
        dtype=["int32", "int32"],
    )
    worker_to_futures = replication.replicate_cudf_dataframe(df)
    for worker in worker_to_futures:
        replicated_df = worker_to_futures[worker].result()
        assert_frame_equal(df, replicated_df)
Example #4
0
def test_replicate_cudf_dataframe_no_weights(input_data_path, mg_device_count):
    gc.collect()
    skip_if_not_enough_devices(mg_device_count)
    df = cudf.read_csv(
        input_data_path,
        delimiter=" ",
        names=["src", "dst"],
        dtype=["int32", "int32"],
    )
    with MGContext(number_of_devices=mg_device_count, p2p=True):
        worker_to_futures = replication.replicate_cudf_dataframe(df)
        for worker in worker_to_futures:
            replicated_df = worker_to_futures[worker].result()
            assert df.equals(replicated_df), ("There is a mismatch in one "
                                              "of the replications")