Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move MTMG_TEST to MG tests block #3993

Merged
merged 7 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ VALIDARGS="
cugraph-dgl
nx-cugraph
cpp-mgtests
cpp-mtmgtests
docs
all
-v
Expand Down Expand Up @@ -59,6 +60,7 @@ HELP="$0 [<target> ...] [<flag> ...]
cugraph-dgl - build the cugraph-dgl extensions for DGL
nx-cugraph - build the nx-cugraph Python package
cpp-mgtests - build libcugraph and libcugraph_etl MG tests. Builds MPI communicator, adding MPI as a dependency.
cpp-mtmgtests - build libcugraph MTMG tests. Adds UCX as a dependency (temporary).
docs - build the docs
all - build everything
and <flag> is:
Expand Down Expand Up @@ -105,6 +107,7 @@ BUILD_TYPE=Release
INSTALL_TARGET="--target install"
BUILD_CPP_TESTS=ON
BUILD_CPP_MG_TESTS=OFF
BUILD_CPP_MTMG_TESTS=OFF
BUILD_ALL_GPU_ARCH=0
BUILD_WITH_CUGRAPHOPS=ON
CMAKE_GENERATOR_OPTION="-G Ninja"
Expand Down Expand Up @@ -172,6 +175,9 @@ fi
if hasArg --without_cugraphops; then
BUILD_WITH_CUGRAPHOPS=OFF
fi
if hasArg cpp-mtmgtests; then
BUILD_CPP_MTMG_TESTS=ON
fi
if hasArg cpp-mgtests || hasArg all; then
BUILD_CPP_MG_TESTS=ON
fi
Expand Down Expand Up @@ -264,6 +270,7 @@ if buildDefault || hasArg libcugraph || hasArg all; then
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DBUILD_TESTS=${BUILD_CPP_TESTS} \
-DBUILD_CUGRAPH_MG_TESTS=${BUILD_CPP_MG_TESTS} \
-DBUILD_CUGRAPH_MTMG_TESTS=${BUILD_CPP_MTMG_TESTS} \
-DUSE_CUGRAPH_OPS=${BUILD_WITH_CUGRAPHOPS} \
${CMAKE_GENERATOR_OPTION} \
${CMAKE_VERBOSE_OPTION}
Expand Down Expand Up @@ -294,6 +301,7 @@ if buildDefault || hasArg libcugraph_etl || hasArg all; then
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
-DBUILD_TESTS=${BUILD_CPP_TESTS} \
-DBUILD_CUGRAPH_MG_TESTS=${BUILD_CPP_MG_TESTS} \
-DBUILD_CUGRAPH_MTMG_TESTS=${BUILD_CPP_MTMG_TESTS} \
-DCMAKE_PREFIX_PATH=${LIBCUGRAPH_BUILD_DIR} \
${CMAKE_GENERATOR_OPTION} \
${CMAKE_VERBOSE_OPTION} \
Expand Down
5 changes: 4 additions & 1 deletion cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,10 @@ endif()

include(cmake/thirdparty/get_nccl.cmake)
include(cmake/thirdparty/get_cuhornet.cmake)
include(cmake/thirdparty/get_ucp.cmake)

if (BUILD_CUGRAPH_MTMG_TESTS)
include(cmake/thirdparty/get_ucp.cmake)
endif()

if(BUILD_TESTS)
include(cmake/thirdparty/get_gtest.cmake)
Expand Down
37 changes: 21 additions & 16 deletions cpp/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -415,13 +415,6 @@ ConfigureTest(K_HOP_NBRS_TEST traversal/k_hop_nbrs_test.cpp)
# - install tests ---------------------------------------------------------------------------------
rapids_test_install_relocatable(INSTALL_COMPONENT_SET testing DESTINATION bin/gtests/libcugraph)

###################################################################################################
# - MTMG tests -------------------------------------------------------------------------
ConfigureTest(MTMG_TEST mtmg/threaded_test.cu)
target_link_libraries(MTMG_TEST
PRIVATE
UCP::UCP
)

###################################################################################################
# - MG tests --------------------------------------------------------------------------------------
Expand Down Expand Up @@ -681,15 +674,6 @@ if(BUILD_CUGRAPH_MG_TESTS)

rapids_test_install_relocatable(INSTALL_COMPONENT_SET testing_mg DESTINATION bin/gtests/libcugraph_mg)

###############################################################################################
# - Multi-node MTMG tests ---------------------------------------------------------------------
ConfigureTest(MTMG_MULTINODE_TEST mtmg/multi_node_threaded_test.cu utilities/mg_utilities.cpp)
target_link_libraries(MTMG_MULTINODE_TEST
PRIVATE
cugraphmgtestutil
UCP::UCP
)

endif()

###################################################################################################
Expand Down Expand Up @@ -749,4 +733,25 @@ ConfigureCTest(CAPI_EGONET_TEST c_api/egonet_test.c)
ConfigureCTest(CAPI_TWO_HOP_NEIGHBORS_TEST c_api/two_hop_neighbors_test.c)
ConfigureCTest(CAPI_LEGACY_K_TRUSS_TEST c_api/legacy_k_truss_test.c)

if (BUILD_CUGRAPH_MTMG_TESTS)
###################################################################################################
# - MTMG tests -------------------------------------------------------------------------
ConfigureTest(MTMG_TEST mtmg/threaded_test.cu)
target_link_libraries(MTMG_TEST
PRIVATE
UCP::UCP
)

if(BUILD_CUGRAPH_MG_TESTS)
###############################################################################################
# - Multi-node MTMG tests ---------------------------------------------------------------------
ConfigureTest(MTMG_MULTINODE_TEST mtmg/multi_node_threaded_test.cu utilities/mg_utilities.cpp)
target_link_libraries(MTMG_MULTINODE_TEST
PRIVATE
cugraphmgtestutil
UCP::UCP
)
endif(BUILD_CUGRAPH_MG_TESTS)
endif(BUILD_CUGRAPH_MTMG_TESTS)

rapids_test_install_relocatable(INSTALL_COMPONENT_SET testing_c DESTINATION bin/gtests/libcugraph_c)
24 changes: 6 additions & 18 deletions python/cugraph/cugraph/structure/property_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -800,15 +800,9 @@ def add_vertex_data(
tmp_df.index = tmp_df.index.rename(self.vertex_col_name)

# FIXME: handle case of a type_name column already being in tmp_df
if self.__series_type is cudf.Series:
# cudf does not yet support initialization with a scalar
tmp_df[TCN] = cudf.Series(
cudf.Series([type_name], dtype=cat_dtype).repeat(len(tmp_df)),
index=tmp_df.index,
)
else:
# pandas is oddly slow if dtype is passed to the constructor here
tmp_df[TCN] = pd.Series(type_name, index=tmp_df.index).astype(cat_dtype)
tmp_df[TCN] = self.__series_type(type_name, index=tmp_df.index).astype(
cat_dtype
)

if property_columns:
# all columns
Expand Down Expand Up @@ -1207,15 +1201,9 @@ def add_edge_data(
tmp_df[self.src_col_name] = tmp_df[vertex_col_names[0]]
tmp_df[self.dst_col_name] = tmp_df[vertex_col_names[1]]

if self.__series_type is cudf.Series:
# cudf does not yet support initialization with a scalar
tmp_df[TCN] = cudf.Series(
cudf.Series([type_name], dtype=cat_dtype).repeat(len(tmp_df)),
index=tmp_df.index,
)
else:
# pandas is oddly slow if dtype is passed to the constructor here
tmp_df[TCN] = pd.Series(type_name, index=tmp_df.index).astype(cat_dtype)
tmp_df[TCN] = self.__series_type(type_name, index=tmp_df.index).astype(
cat_dtype
)

# Add unique edge IDs to the new rows. This is just a count for each
# row starting from the last edge ID value, with initial edge ID 0.
Expand Down
Loading