Skip to content

Commit

Permalink
Restructure example dir
Browse files Browse the repository at this point in the history
  • Loading branch information
Naim committed Feb 8, 2024
1 parent 2f2f192 commit 10a016a
Show file tree
Hide file tree
Showing 11 changed files with 46 additions and 37 deletions.
19 changes: 14 additions & 5 deletions cpp/examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,24 @@ Example codes on how to use libcugraph.

## Contents

- single_gpu_application: example code on how to use libgraph to run different graph algorithms on a single-GPU node.
- simple

- multi_gpu_application: example code on how to use libgraph to run different graph algorithms on a multi-GPU node.
- single_gpu_application: example code on how to use libgraph to run different graph algorithms on a single-GPU node.

- graph_partition: code to explain vertex and edge partitioning in cugraph.
- multi_gpu_application: example code on how to use libgraph to run different graph algorithms on a multi-GPU node.

- cugraph_operations: example code for using cugraph primitives for simple graph operations needed to implement graph algorithms.
- advanced
- graph_partition: code to explain vertex and edge partitioning in cugraph.

- cugraph_operations: example code for using cugraph primitives for simple graph operations needed to implement graph algorithms.

## Build instructions:

Run `build.sh` to build the above listed examples.
Run `build.sh` to from examples dir to build the above listed examples.

```sh
~/cugraph/cpp/examples$./build.sh
```

## Run instructions

Expand All @@ -26,6 +33,8 @@ For multi_gpu, graph_partitioning and cugraph_operations

`mpirun -np 2 path_to_executable path_to_a_csv_graph_file [memory allocation mode]`

NOTE: The example codes a

Memory allocation mode can be one of the followings -

- cuda
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ project(
LANGUAGES CXX CUDA
)

include(../fetch_dependencies.cmake)
include(../../fetch_dependencies.cmake)

find_package(MPI REQUIRED COMPONENTS CXX)
include(../../cmake/thirdparty/get_nccl.cmake)
include(../../../cmake/thirdparty/get_nccl.cmake)

add_library(csvfileutil STATIC ../../tests/utilities/csv_file_utilities.cu)
add_library(csvfileutil STATIC ../../../tests/utilities/csv_file_utilities.cu)
target_include_directories(csvfileutil
PUBLIC
"../../../thirdparty/mmio"
"../../tests"
"../../include"
"../../src"
"../../../../thirdparty/mmio"
"../../../tests"
"../../../include"
"../../../src"
)
set_target_properties(csvfileutil PROPERTIES CUDA_ARCHITECTURES "native")
target_link_libraries(csvfileutil PUBLIC cugraph::cugraph NCCL::NCCL MPI::MPI_CXX)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@ project(
LANGUAGES CXX CUDA
)

include(../fetch_dependencies.cmake)
include(../../fetch_dependencies.cmake)

find_package(MPI REQUIRED COMPONENTS CXX)
include(../../cmake/thirdparty/get_nccl.cmake)
include(../../../cmake/thirdparty/get_nccl.cmake)

add_library(csvfileutil STATIC ../../tests/utilities/csv_file_utilities.cu)
add_library(csvfileutil STATIC ../../../tests/utilities/csv_file_utilities.cu)
target_include_directories(csvfileutil
PUBLIC
"../../../thirdparty/mmio"
"../../tests"
"../../include"
"../../src"
"../../../../thirdparty/mmio"
"../../../tests"
"../../../include"
"../../../src"
)
set_target_properties(csvfileutil PROPERTIES CUDA_ARCHITECTURES "native")
target_link_libraries(csvfileutil PUBLIC cugraph::cugraph NCCL::NCCL MPI::MPI_CXX)
Expand Down
8 changes: 4 additions & 4 deletions cpp/examples/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ build_example() {
cmake --build ${build_dir} -j${PARALLEL_LEVEL}
}

build_example single_gpu_application
build_example multi_gpu_application
build_example graph_partition
build_example cugraph_operations
build_example simple/single_gpu_application
build_example simple/multi_gpu_application
build_example advanced/graph_partition
build_example advanced/cugraph_operations

2 changes: 1 addition & 1 deletion cpp/examples/fetch_dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ CPMFindPackage(
cpp
)

include(../../../fetch_rapids.cmake)
include(../../../../fetch_rapids.cmake)
include(rapids-find)
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,19 @@ project(
LANGUAGES CXX CUDA
)

include(../fetch_dependencies.cmake)
include(../../fetch_dependencies.cmake)

find_package(MPI REQUIRED COMPONENTS CXX)
include(../../cmake/thirdparty/get_nccl.cmake)
include(../../../cmake/thirdparty/get_nccl.cmake)

add_library(csvfileutil STATIC ../../tests/utilities/csv_file_utilities.cu)
add_library(csvfileutil STATIC ../../../tests/utilities/csv_file_utilities.cu)
target_include_directories(csvfileutil
PUBLIC
"../../../thirdparty/mmio"
"../../tests"
"../../../../thirdparty/mmio"
"../../../tests"
PRIVATE
"../../include"
"../../src"
"../../../include"
"../../../src"
)
set_target_properties(csvfileutil PROPERTIES CUDA_ARCHITECTURES "native")
target_link_libraries(csvfileutil PUBLIC cugraph::cugraph NCCL::NCCL MPI::MPI_CXX)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ project(
LANGUAGES CXX CUDA
)

include(../fetch_dependencies.cmake)
include(../../fetch_dependencies.cmake)

add_library(csvfileutil STATIC ../../tests/utilities/csv_file_utilities.cu)
add_library(csvfileutil STATIC ../../../tests/utilities/csv_file_utilities.cu)
target_include_directories(csvfileutil
PUBLIC
"../../../thirdparty/mmio"
"../../tests"
"../../../../thirdparty/mmio"
"../../../tests"
PRIVATE
"../../include"
"../../src"
"../../../include"
"../../../src"
)
set_target_properties(csvfileutil PROPERTIES CUDA_ARCHITECTURES "native")
target_link_libraries(csvfileutil PUBLIC cugraph::cugraph)
Expand Down

0 comments on commit 10a016a

Please sign in to comment.