LSTC is a project that provides a high-performance and Memory Efficient Graph Analytical Framework for GPUs. We use Cuda and various graph partitioning-based parallel programs for counting the number of triangles in a CSR sparse matrix graphs.
DGL is a framework that provides the program's graph transformations.
- Download, build and install Nvidia CUDA.
- Note: We use Cuda 11.7 for this project.
- Download, build, and install DGL 2.x , on link Document.
pip install dgl -f https://data.dgl.ai/wheels/torch-2.1/cu118/repo.html
- Note: please see your compatible Cuda version and install dgl based on this.
Download the dataset from websites like GraphChallenge or SuiteSparse.
- Navigate to the preprocessing directory:
cd preprocess_GPU/generate_clean_undir_dataset/
- Run the preprocessing script:
Example:
python3 Halo_creation_preprocess.py <dataset_file>
python3 Halo_creation_preprocess.py ../data/Dataset/GraphChallange/amazon0302_adj.tsv
- This generates the undirected CSR file
<filename.csr>
and partitioned node parts files<filename.csr_node_parts_<part_method>_<part_number>
. - Create the induced subgraph by cleaning the redundant vertex and edges:
Example:
cd ../../ cd preprocess_GPU/Halo_cleanned_preprocess/ ./round_clean_sg <part_number> <filename.csr> <filename.csr_node_parts_<part_method>_<part_number>
./round_clean_sg 2 it-2004_convert_part.csr it-2004_convert_part.csr_node_parts_random_2
- The generated file is a cleaned induced subgraph for triangle counting.
- Navigate to the source directory:
cd TriangleCount/src/WithPartition/
- Compile the code:
./compile.sh
- Run the triangle count:
Example:
./wo_sort_tc_256 <filename> <part_number>
./wo_sort_tc_256 ../LSTC/Dataset_part/it-2004_convert_part.csr_node_parts_random_2_output.csr 2
- Preprocess the data for triangle counting without partition:
Example:
cd TriangleCount/Med_dataset/ python3 without_part_preprocess.py <filename>
python3 without_part_preprocess.py ../data/Dataset/GraphChallange/amazon0302_adj.tsv
- Navigate to the source directory:
cd ../src/WithoutPartition/
- Compile the code:
./compile.sh
- Run the triangle count:
Example:
./TC_128 <filename.csr>
./TC_128 /data/kishan/TriangleCount/Med_dataset/wikipedia/wikipedia_link_en_output.csr
- Navigate to the source directory:
cd src/WithoutPartition/
- Run with atomic operations:
./With_Atomic_op <filename.csr>
- Run without shared memory operations:
./Without_ShareMemory_TC <filename.csr>
- Navigate to the profiling directory:
cd src/profiling/
- Compile the code:
./compile.sh
- Run the profiling script:
Note: In
./run.sh
run.sh
, pass the<filename.csr>
generated inMed_dataset/without_part_preprocess.py
file.