Skip to content

Commit

Permalink
disabled some explicit multigpu code stuff with ifdefs
Browse files Browse the repository at this point in the history
  • Loading branch information
mcordery committed Jan 13, 2025
1 parent bf8663b commit 20581ce
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 26 deletions.
3 changes: 2 additions & 1 deletion cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ rapids_cpm_init()
###
# Linking to the `raft::raft` target implicitly links cugraph targets to the
# following public header-only raft dependencies:
# * CCCL
# * CCCL static_assert(multi_gpu==false,"cgfe 1");

# * RMM
# * GTest/GMock
#
Expand Down
3 changes: 2 additions & 1 deletion cpp/include/cugraph/mtmg/graph.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023, NVIDIA CORPORATION.
* Copyright (c) 2023-2025, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -92,6 +92,7 @@ void create_graph_from_edgelist(
std::optional<cugraph::mtmg::renumber_map_t<vertex_t>>& renumber_map,
bool do_expensive_check = false)
{
static_assert(multi_gpu == false);
if (handle.get_thread_rank() > 0) return;

CUGRAPH_EXPECTS(renumber_map.has_value() == renumber,
Expand Down
38 changes: 20 additions & 18 deletions cpp/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ enable_testing()
include(rapids-test)
rapids_test_init()

set(BUILD_CUGRAPH_MG_TESTS OFF)

###################################################################################################
# - set rapids dataset path ----------------------------------------------------------------------
if(RAPIDS_DATASET_ROOT_DIR)
Expand Down Expand Up @@ -58,12 +60,6 @@ foreach(SOURCE_FILE ${TEST_SOURCE_FILES})
endif()
endforeach()


target_compile_options(cugraphtestutil
PUBLIC "$<$<COMPILE_LANGUAGE:CXX>:${CUGRAPH_CXX_FLAGS}>"
"$<$<COMPILE_LANGUAGE:HIP>:${CUGRAPH_HIP_FLAGS}>"
)

set_property(TARGET cugraphtestutil PROPERTY POSITION_INDEPENDENT_CODE ON)

target_include_directories(cugraphtestutil
Expand All @@ -89,9 +85,10 @@ add_library(cugraph_c_testutil STATIC
c_api/test_utils.cpp)

target_compile_options(cugraph_c_testutil
PUBLIC "$<$<COMPILE_LANGUAGE:C>:${CUGRAPH_C_FLAGS}>"
"$<$<COMPILE_LANGUAGE:CXX>:${CUGRAPH_CXX_FLAGS}>"
"$<$<COMPILE_LANGUAGE:HIP>:${CUGRAPH_HIP_FLAGS}>"
PUBLIC
"$<$<COMPILE_LANGUAGE:C>:${CUGRAPH_C_FLAGS}>"
"$<$<COMPILE_LANGUAGE:CXX>:${CUGRAPH_CXX_FLAGS}>"
"$<$<COMPILE_LANGUAGE:HIP>:${CUGRAPH_HIP_FLAGS}>"
)

target_include_directories(cugraph_c_testutil
Expand All @@ -107,6 +104,7 @@ target_link_libraries(cugraph_c_testutil
PRIVATE
cugraph::cugraph_c
cugraph::cugraph

)

if(BUILD_CUGRAPH_MG_TESTS)
Expand Down Expand Up @@ -139,11 +137,6 @@ if(BUILD_CUGRAPH_MG_TESTS)

set_property(TARGET cugraphmgtestutil PROPERTY POSITION_INDEPENDENT_CODE ON)

target_compile_options(cugraphmgtestutil
PUBLIC "$<$<COMPILE_LANGUAGE:CXX>:${CUGRAPH_CXX_FLAGS}>"
"$<$<COMPILE_LANGUAGE:HIP>:${CUGRAPH_HIP_FLAGS}>"
)

target_include_directories(cugraphmgtestutil
PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/../include"
Expand Down Expand Up @@ -180,6 +173,9 @@ function(ConfigureTest CMAKE_TEST_NAME)
set(_CUGRAPH_TEST_PERCENT 100)
endif()

set(CMAKE_HIP_COMPILER ${CMAKE_CXX_COMPILER})
set(CMAKE_LINKER ${CMAKE_CXX_COMPILER})

add_executable(${CMAKE_TEST_NAME} ${_CUGRAPH_TEST_UNPARSED_ARGUMENTS})

get_target_property(CPPTEST_SOURCE_FILES ${CMAKE_TEST_NAME} SOURCES)
Expand All @@ -192,18 +188,23 @@ function(ConfigureTest CMAKE_TEST_NAME)

target_link_libraries(${CMAKE_TEST_NAME}
PRIVATE
cugraph::cugraph
cugraphtestutil
GTest::gtest
GTest::gtest_main
)



set_target_properties(
${CMAKE_TEST_NAME}
PROPERTIES INSTALL_RPATH "\$ORIGIN/../../../lib"
PROPERTIES
INSTALL_RPATH "\$ORIGIN/../../../lib"
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON
HIP_STANDARD 17
HIP_STANDARD_REQUIRED ON)
HIP_STANDARD_REQUIRED ON
)

rapids_test_add(
NAME ${CMAKE_TEST_NAME}
Expand All @@ -212,6 +213,7 @@ function(ConfigureTest CMAKE_TEST_NAME)
PERCENT ${_CUGRAPH_TEST_PERCENT}
INSTALL_COMPONENT_SET testing
)

set_tests_properties(${CMAKE_TEST_NAME} PROPERTIES LABELS "CUGRAPH")
endfunction()

Expand Down Expand Up @@ -360,11 +362,11 @@ ConfigureTest(ERDOS_RENYI_GENERATOR_TEST generators/erdos_renyi_test.cpp)

###################################################################################################
# - LOUVAIN tests ---------------------------------------------------------------------------------
#mjc ConfigureTest(LOUVAIN_TEST community/louvain_test.cpp)
ConfigureTest(LOUVAIN_TEST community/louvain_test.cpp)

###################################################################################################
# - LEIDEN tests ----------------------------------------------------------------------------------
ConfigureTest(LEIDEN_TEST community/leiden_test.cpp)
ConfigureTest(LEIDEN_TEST community/leiden_test.cpp)

###################################################################################################
# - WEIGHTED MATCHING tests -----------------------------------------------------------------------
Expand Down
18 changes: 17 additions & 1 deletion cpp/tests/utilities/csv_file_utilities.cu
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ read_edgelist_from_csv_file<int32_t, float>(raft::handle_t const& handle,
bool test_weighted,
bool store_transposed,
bool multi_gpu);

#warning mjc explicit instantiations diabled due to multi_gpu=true
template std::tuple<
cugraph::graph_t<int32_t, int32_t, false, false>,
std::optional<cugraph::edge_property_t<graph_view_t<int32_t, int32_t, false, false>, float>>,
Expand All @@ -336,6 +336,7 @@ read_graph_from_csv_file<int32_t, int32_t, float, false, false>(
bool test_weighted,
bool renumber);

#ifdef MULTIGPU
template std::tuple<
cugraph::graph_t<int32_t, int32_t, false, true>,
std::optional<cugraph::edge_property_t<graph_view_t<int32_t, int32_t, false, true>, float>>,
Expand All @@ -345,6 +346,7 @@ read_graph_from_csv_file<int32_t, int32_t, float, false, true>(
std::string const& graph_file_full_path,
bool test_weighted,
bool renumber);
#endif

template std::tuple<
cugraph::graph_t<int32_t, int32_t, true, false>,
Expand All @@ -356,6 +358,7 @@ read_graph_from_csv_file<int32_t, int32_t, float, true, false>(
bool test_weighted,
bool renumber);

#ifdef MULTIGPU
template std::tuple<
cugraph::graph_t<int32_t, int32_t, true, true>,
std::optional<cugraph::edge_property_t<graph_view_t<int32_t, int32_t, true, true>, float>>,
Expand All @@ -365,6 +368,7 @@ read_graph_from_csv_file<int32_t, int32_t, float, true, true>(
std::string const& graph_file_full_path,
bool test_weighted,
bool renumber);
#endif

template std::tuple<
cugraph::graph_t<int32_t, int32_t, false, false>,
Expand All @@ -376,6 +380,7 @@ read_graph_from_csv_file<int32_t, int32_t, double, false, false>(
bool test_weighted,
bool renumber);

#ifdef MULTIGPU
template std::tuple<
cugraph::graph_t<int32_t, int32_t, false, true>,
std::optional<cugraph::edge_property_t<graph_view_t<int32_t, int32_t, false, true>, double>>,
Expand All @@ -385,6 +390,7 @@ read_graph_from_csv_file<int32_t, int32_t, double, false, true>(
std::string const& graph_file_full_path,
bool test_weighted,
bool renumber);
#endif

template std::tuple<
cugraph::graph_t<int32_t, int32_t, true, false>,
Expand All @@ -396,6 +402,7 @@ read_graph_from_csv_file<int32_t, int32_t, double, true, false>(
bool test_weighted,
bool renumber);

#ifdef MULTIGPU
template std::tuple<
cugraph::graph_t<int32_t, int32_t, true, true>,
std::optional<cugraph::edge_property_t<graph_view_t<int32_t, int32_t, true, true>, double>>,
Expand All @@ -405,6 +412,7 @@ read_graph_from_csv_file<int32_t, int32_t, double, true, true>(
std::string const& graph_file_full_path,
bool test_weighted,
bool renumber);
#endif

template std::tuple<
cugraph::graph_t<int64_t, int64_t, false, false>,
Expand All @@ -416,6 +424,7 @@ read_graph_from_csv_file<int64_t, int64_t, float, false, false>(
bool test_weighted,
bool renumber);

#ifdef MULTIGPU
template std::tuple<
cugraph::graph_t<int64_t, int64_t, false, true>,
std::optional<cugraph::edge_property_t<graph_view_t<int64_t, int64_t, false, true>, float>>,
Expand All @@ -425,6 +434,7 @@ read_graph_from_csv_file<int64_t, int64_t, float, false, true>(
std::string const& graph_file_full_path,
bool test_weighted,
bool renumber);
#endif

template std::tuple<
cugraph::graph_t<int64_t, int64_t, true, false>,
Expand All @@ -436,6 +446,7 @@ read_graph_from_csv_file<int64_t, int64_t, float, true, false>(
bool test_weighted,
bool renumber);

#ifdef MULTIGPU
template std::tuple<
cugraph::graph_t<int64_t, int64_t, true, true>,
std::optional<cugraph::edge_property_t<graph_view_t<int64_t, int64_t, true, true>, float>>,
Expand All @@ -445,6 +456,7 @@ read_graph_from_csv_file<int64_t, int64_t, float, true, true>(
std::string const& graph_file_full_path,
bool test_weighted,
bool renumber);
#endif

template std::tuple<
cugraph::graph_t<int64_t, int64_t, false, false>,
Expand All @@ -456,6 +468,7 @@ read_graph_from_csv_file<int64_t, int64_t, double, false, false>(
bool test_weighted,
bool renumber);

#ifdef MULTIGPU
template std::tuple<
cugraph::graph_t<int64_t, int64_t, false, true>,
std::optional<cugraph::edge_property_t<graph_view_t<int64_t, int64_t, false, true>, double>>,
Expand All @@ -465,6 +478,7 @@ read_graph_from_csv_file<int64_t, int64_t, double, false, true>(
std::string const& graph_file_full_path,
bool test_weighted,
bool renumber);
#endif

template std::tuple<
cugraph::graph_t<int64_t, int64_t, true, false>,
Expand All @@ -476,6 +490,7 @@ read_graph_from_csv_file<int64_t, int64_t, double, true, false>(
bool test_weighted,
bool renumber);

#ifdef MULTIGPU
template std::tuple<
cugraph::graph_t<int64_t, int64_t, true, true>,
std::optional<cugraph::edge_property_t<graph_view_t<int64_t, int64_t, true, true>, double>>,
Expand All @@ -485,6 +500,7 @@ read_graph_from_csv_file<int64_t, int64_t, double, true, true>(
std::string const& graph_file_full_path,
bool test_weighted,
bool renumber);
#endif

} // namespace test
} // namespace cugraph
Loading

0 comments on commit 20581ce

Please sign in to comment.