├── .clang-format ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md └── SECURITY.md ├── .gitignore ├── .gitmodules ├── CMakeLists.txt ├── CODE_OF_CONDUCT.md ├── Jenkinsfile ├── LICENSE.TXT ├── README.md ├── cmake ├── AutoDetectCudaArch.cmake ├── CodeCoverage.cmake ├── DownloadGoogleTest.cmake ├── FindBoost.cmake ├── FindBoostHeaders.cmake ├── FindCUB.cmake ├── FindGoogleTest.cmake ├── FindMetis.cmake ├── FindModernGPU.cmake ├── FindOpenMP.cmake ├── FindRapidJson.cmake ├── GetGitRevisionDescription.cmake ├── GetGitRevisionDescription.cmake.in └── SetSubProject.cmake ├── dataset ├── gcn │ ├── citeseer.graph │ ├── citeseer.split │ ├── citeseer.svmlight │ ├── cora.graph │ ├── cora.split │ ├── cora.svmlight │ ├── pubmed.graph │ ├── pubmed.split │ └── pubmed.svmlight ├── large │ ├── Makefile │ ├── ak2010 │ │ └── Makefile │ ├── arabic-2005 │ │ └── Makefile │ ├── asia_osm │ │ └── Makefile │ ├── belgium_osm │ │ └── Makefile │ ├── cit-Patents │ │ └── Makefile │ ├── coAuthorsDBLP │ │ └── Makefile │ ├── common.mk │ ├── delaunay_n13 │ │ └── Makefile │ ├── delaunay_n21 │ │ └── Makefile │ ├── delaunay_n24 │ │ └── Makefile │ ├── europe_osm │ │ └── Makefile │ ├── germany_osm │ │ └── Makefile │ ├── hollywood-2009 │ │ └── Makefile │ ├── indochina-2004 │ │ └── Makefile │ ├── kron_g500-logn21 │ │ └── Makefile │ ├── networkrepo.mk │ ├── rgg_n_2_24_s0 │ │ └── readme.txt │ ├── roadNet-CA │ │ └── Makefile │ ├── road_central │ │ └── Makefile │ ├── road_usa │ │ └── Makefile │ ├── soc-LiveJournal1 │ │ └── Makefile │ ├── soc-orkut │ │ └── Makefile │ ├── soc-sinaweibo │ │ └── Makefile │ ├── soc-twitter-2010 │ │ └── Makefile │ ├── ufl.mk │ ├── uk-2002 │ │ └── Makefile │ ├── uk-2005 │ │ └── Makefile │ ├── webbase-1M │ │ └── Makefile │ └── webbase-2001 │ │ └── Makefile └── small │ ├── data_sm.label │ ├── map │ ├── cities.map │ ├── cities.txt │ ├── gen_graph.py │ └── small.map │ ├── query_sm.label │ └── tri_sm.label ├── docker ├── ubuntu16.04-cuda10.1 │ ├── README.md │ └── dockerfile ├── ubuntu16.04-cuda9.0 │ ├── README.md │ └── dockerfile └── ubuntu16.04-cuda9.1 │ ├── README.md │ └── dockerfile ├── doxygen ├── gunrock.doxygen ├── release_checklist.md ├── releasedoc.sh └── resources │ ├── bootstrap.min.css │ ├── bootstrap.min.js │ ├── customdoxygen.css │ ├── doxy-boot.js │ ├── footer.html │ ├── header.html │ └── readme.txt ├── examples ├── BaseMakefile.mk ├── CMakeLists.txt ├── README.md ├── bc │ ├── CMakeLists.txt │ ├── Makefile │ ├── README.md │ ├── make_summary.cpp │ ├── make_summary.sh │ ├── run.sh │ ├── run_real.sh │ ├── run_rmat.sh │ ├── test.sh │ └── test_bc.cu ├── bfs │ ├── CMakeLists.txt │ ├── Makefile │ ├── make_summary.cpp │ ├── make_summary.sh │ ├── run.sh │ ├── run_avgDegree.sh │ ├── run_do.sh │ ├── run_real.sh │ ├── run_rmat.sh │ ├── run_scale.sh │ ├── test_bfs.cu │ ├── test_parameters.cu │ └── test_refactor.cu ├── cc │ ├── CMakeLists.txt │ ├── Makefile │ ├── make_summary.cpp │ ├── make_summary.sh │ ├── run.sh │ ├── run_real.sh │ ├── run_rmat.sh │ └── test_cc.cu ├── color │ ├── CMakeLists.txt │ ├── Makefile │ ├── benchmark.sh │ ├── rgg.sh │ ├── runAll.sh │ └── test_color.cu ├── core │ ├── Makefile │ ├── test_bandwidth_latency.cuh │ ├── test_binarysearch.cuh │ ├── test_core.cu │ ├── test_for.cuh │ └── test_segreduce.cuh ├── gcn │ ├── CMakeLists.txt │ └── test_gcn.cu ├── geo │ ├── CMakeLists.txt │ ├── Makefile │ ├── _data │ │ └── sample │ │ │ ├── locations.labels │ │ │ └── sample.labels │ ├── generate-data.py │ ├── run-hive.sh │ ├── run.sh │ └── test_geo.cu ├── gtc │ ├── CMakeLists.txt │ ├── Makefile │ └── test_gtc.cu ├── gtf │ ├── CMakeLists.txt │ ├── Makefile │ ├── _data │ │ ├── agnes.py │ │ ├── generate_graph.py │ │ ├── gengraph.py │ │ └── taxi_tsv_file_preprocessing.py │ ├── new_test_gtf.cu │ └── test_gtf.cu ├── hello │ ├── CMakeLists.txt │ ├── Makefile │ └── test_hello.cu ├── hits │ ├── CMakeLists.txt │ ├── Makefile │ ├── run.sh │ └── test_hits.cu ├── knn │ ├── CMakeLists.txt │ ├── Makefile │ ├── run.sh │ └── test_knn.cu ├── louvain │ ├── CMakeLists.txt │ ├── Makefile │ ├── run.sh │ └── test_louvain.cu ├── mf │ ├── CMakeLists.txt │ ├── Makefile │ ├── run.sh │ └── test_mf.cu ├── pr │ ├── CMakeLists.txt │ ├── Makefile │ ├── make_summary.cpp │ ├── make_summary.sh │ ├── run.sh │ ├── run_real.sh │ ├── run_rmat.sh │ └── test_pr.cu ├── pr_nibble │ ├── CMakeLists.txt │ ├── Makefile │ ├── test │ ├── test.sh │ └── test_pr_nibble.cu ├── proj │ ├── CMakeLists.txt │ ├── Makefile │ ├── run.sh │ └── test_proj.cu ├── rw │ ├── CMakeLists.txt │ ├── Makefile │ ├── examples.sh │ ├── random-values.py │ ├── run.sh │ └── test_rw.cu ├── sage │ ├── CMakeLists.txt │ ├── Makefile │ ├── run.sh │ ├── test.sh │ ├── test2.sh │ └── test_sage.cu ├── shared_libs │ ├── CMakeLists.txt │ ├── shared_lib_pr.c │ └── shared_lib_sm.c ├── sm │ ├── CMakeLists.txt │ ├── Makefile │ ├── run.sh │ └── test_sm.cu ├── ss │ ├── CMakeLists.txt │ ├── Makefile │ ├── run.sh │ ├── run_all.sh │ └── test_ss.cu ├── sssp │ ├── CMakeLists.txt │ ├── Makefile │ ├── make_summary.cpp │ ├── make_summary.sh │ ├── run.sh │ ├── run_real.sh │ ├── run_rmat.sh │ ├── run_simple_advance.sh │ └── test_sssp.cu ├── tc │ ├── CMakeLists.txt │ ├── Makefile │ ├── run.sh │ └── test_tc.cu └── vn │ ├── CMakeLists.txt │ ├── Makefile │ ├── make_summary.cpp │ ├── make_summary.sh │ ├── run.sh │ ├── run_real.sh │ ├── run_rmat.sh │ └── test_vn.cu ├── gunrock ├── CMakeLists.txt ├── app │ ├── app.cuh │ ├── app_base.cuh │ ├── bc │ │ ├── bc_app.cu │ │ ├── bc_enactor.cuh │ │ ├── bc_problem.cuh │ │ └── bc_test.cuh │ ├── bfs │ │ ├── bfs_app.cu │ │ ├── bfs_enactor.cuh │ │ ├── bfs_kernel.cuh │ │ ├── bfs_problem.cuh │ │ └── bfs_test.cuh │ ├── brp │ │ └── brp_partitioner.cuh │ ├── cc │ │ ├── cc_app.cu │ │ ├── cc_enactor.cuh │ │ ├── cc_functor.cuh │ │ └── cc_problem.cuh │ ├── color │ │ ├── color_app.cu │ │ ├── color_enactor.cuh │ │ ├── color_problem.cuh │ │ └── color_test.cuh │ ├── cp │ │ └── cp_partitioner.cuh │ ├── dup │ │ └── dup_partitioner.cuh │ ├── enactor_base.cuh │ ├── enactor_helper.cuh │ ├── enactor_iteration.cuh │ ├── enactor_kernel.cuh │ ├── enactor_loop.cuh │ ├── enactor_types.cuh │ ├── frontier.cuh │ ├── gcn │ │ ├── CrossEntropyLoss │ │ │ ├── CrossEntropyLoss_app.cu │ │ │ ├── CrossEntropyLoss_enactor.cuh │ │ │ ├── CrossEntropyLoss_problem.cuh │ │ │ └── CrossEntropyLoss_test.cuh │ │ ├── dropout │ │ │ └── dropout.cuh │ │ ├── gcn_app.cu │ │ ├── gcn_enactor.cuh │ │ ├── gcn_problem.cuh │ │ ├── graphsum │ │ │ ├── graphsum_app.cu │ │ │ ├── graphsum_enactor.cuh │ │ │ └── graphsum_problem.cuh │ │ ├── matmul │ │ │ └── mat_mul.cuh │ │ ├── module.h │ │ ├── relu │ │ │ └── relu.cuh │ │ └── sparseMatMul │ │ │ ├── sparseMatMul_app.cu │ │ │ ├── sparseMatMul_enactor.cuh │ │ │ ├── sparseMatMul_problem.cuh │ │ │ └── sparseMatMul_test.cuh │ ├── geo │ │ ├── geo_app.cu │ │ ├── geo_enactor.cuh │ │ ├── geo_problem.cuh │ │ ├── geo_spatial.cuh │ │ └── geo_test.cuh │ ├── graph_slice.cuh │ ├── gtc │ │ ├── gtc_app.cu │ │ ├── gtc_enactor.cuh │ │ ├── gtc_problem.cuh │ │ └── gtc_test.cuh │ ├── gtf │ │ ├── gtf_app.cu │ │ ├── gtf_enactor.cuh │ │ ├── gtf_problem.cuh │ │ └── gtf_test.cuh │ ├── hello │ │ ├── hello_app.cu │ │ ├── hello_enactor.cuh │ │ ├── hello_problem.cuh │ │ └── hello_test.cuh │ ├── hits │ │ ├── hits_app.cu │ │ ├── hits_app.cuh │ │ ├── hits_enactor.cuh │ │ ├── hits_problem.cuh │ │ └── hits_test.cuh │ ├── knn │ │ ├── knn_app.cu │ │ ├── knn_enactor.cuh │ │ ├── knn_problem.cuh │ │ └── knn_test.cuh │ ├── louvain │ │ ├── louvain_app.cu │ │ ├── louvain_enactor.cuh │ │ ├── louvain_problem.cuh │ │ └── louvain_test.cuh │ ├── metisp │ │ └── metis_partitioner.cuh │ ├── mf │ │ ├── mf_app.cu │ │ ├── mf_enactor.cuh │ │ ├── mf_helpers.cuh │ │ ├── mf_problem.cuh │ │ └── mf_test.cuh │ ├── mgpu_slice.cuh │ ├── partitioner_base.cuh │ ├── pr │ │ ├── pr_app.cu │ │ ├── pr_enactor.cuh │ │ ├── pr_problem.cuh │ │ └── pr_test.cuh │ ├── pr_nibble │ │ ├── pr_nibble_app.cu │ │ ├── pr_nibble_enactor.cuh │ │ ├── pr_nibble_problem.cuh │ │ └── pr_nibble_test.cuh │ ├── problem_base.cuh │ ├── proj │ │ ├── proj_app.cu │ │ ├── proj_enactor.cuh │ │ ├── proj_problem.cuh │ │ └── proj_test.cuh │ ├── rp │ │ └── rp_partitioner.cuh │ ├── rw │ │ ├── rw_app.cu │ │ ├── rw_enactor.cuh │ │ ├── rw_problem.cuh │ │ └── rw_test.cuh │ ├── sage │ │ ├── sage_app.cu │ │ ├── sage_enactor.cuh │ │ ├── sage_problem.cuh │ │ └── sage_test.cuh │ ├── sm │ │ ├── sm_app.cu │ │ ├── sm_app.cuh │ │ ├── sm_enactor.cuh │ │ ├── sm_problem.cuh │ │ └── sm_test.cuh │ ├── sp │ │ └── sp_partitioner.cuh │ ├── ss │ │ ├── ss_app.cu │ │ ├── ss_enactor.cuh │ │ ├── ss_problem.cuh │ │ └── ss_test.cuh │ ├── sssp │ │ ├── sssp_app.cu │ │ ├── sssp_enactor.cuh │ │ ├── sssp_problem.cuh │ │ └── sssp_test.cuh │ ├── tc │ │ ├── tc_app.cu │ │ ├── tc_enactor.cuh │ │ ├── tc_problem.cuh │ │ └── tc_test.cuh │ ├── test_base.cuh │ └── vn │ │ ├── vn_app.cu │ │ ├── vn_enactor.cuh │ │ ├── vn_problem.cuh │ │ └── vn_test.cuh ├── graph │ ├── coo.cuh │ ├── csc.cuh │ ├── csr.cuh │ ├── gp.cuh │ └── graph_base.cuh ├── graphio │ ├── graphio.cuh │ ├── labels.cuh │ ├── market.cuh │ ├── rgg.cuh │ ├── rmat.cuh │ ├── small_world.cuh │ └── utils.cuh ├── gunrock.h ├── oprtr │ ├── 1D_oprtr │ │ ├── 1D_1D.cuh │ │ ├── 1D_scalar.cuh │ │ ├── for.cuh │ │ ├── for_all.cuh │ │ ├── for_each.cuh │ │ └── sort.cuh │ ├── AE_advance │ │ ├── kernel.cuh │ │ └── kernel_policy.cuh │ ├── BP_filter │ │ ├── kernel.cuh │ │ └── kernel_policy.cuh │ ├── CULL_filter │ │ ├── cta.cuh │ │ ├── kernel.cuh │ │ └── kernel_policy.cuh │ ├── LB_CULL_advance │ │ ├── cta.cuh │ │ ├── kernel.cuh │ │ └── kernel_policy.cuh │ ├── LB_advance │ │ ├── cta.cuh │ │ ├── kernel.cuh │ │ └── kernel_policy.cuh │ ├── TWC_advance │ │ ├── cta.cuh │ │ ├── kernel.cuh │ │ └── kernel_policy.cuh │ ├── advance │ │ ├── advance_base.cuh │ │ ├── kernel.cuh │ │ └── kernel_policy.cuh │ ├── compacted_cull_filter │ │ ├── cta.cuh │ │ ├── kernel.cuh │ │ └── kernel_policy.cuh │ ├── edge_map_backward │ │ ├── cta.cuh │ │ ├── kernel.cuh │ │ └── kernel_policy.cuh │ ├── edge_map_partitioned_backward │ │ ├── kernel.cuh │ │ └── kernel_policy.cuh │ ├── filter │ │ ├── kernel.cuh │ │ └── kernel_policy.cuh │ ├── intersection │ │ ├── cta.cuh │ │ ├── kernel.cuh │ │ └── kernel_policy.cuh │ ├── neighborreduce │ │ └── kernel.cuh │ ├── oprtr.cuh │ ├── oprtr_base.cuh │ ├── oprtr_parameters.cuh │ ├── simplified2_filter │ │ ├── cta.cuh │ │ ├── kernel.cuh │ │ └── kernel_policy.cuh │ ├── simplified_advance │ │ ├── kernel.cuh │ │ └── kernel_policy.cuh │ └── simplified_filter │ │ ├── cta.cuh │ │ ├── kernel.cuh │ │ └── kernel_policy.cuh ├── partitioner │ ├── biased_random.cuh │ ├── cluster.cuh │ ├── duplicate.cuh │ ├── metis.cuh │ ├── partitioner.cuh │ ├── partitioner_base.cuh │ ├── random.cuh │ └── static.cuh ├── priority_queue │ ├── kernel.cuh │ ├── kernel_policy.cuh │ └── near_far_pile.cuh └── util │ ├── array_utils.cuh │ ├── basic_utils.h │ ├── binary_search.cuh │ ├── cta_work_distribution.cuh │ ├── cta_work_progress.cuh │ ├── cuda_properties.cuh │ ├── device_intrinsics.cuh │ ├── error_utils.cu │ ├── error_utils.cuh │ ├── gitsha1.c.in │ ├── gitsha1.h │ ├── gitsha1make.c │ ├── global_barrier.cuh │ ├── info.cuh │ ├── info_rapidjson.cuh │ ├── io │ ├── cub_io.cuh │ ├── initialize_tile.cuh │ ├── load_tile.cuh │ ├── modified_load.cuh │ ├── modified_store.cuh │ ├── scatter_tile.cuh │ └── store_tile.cuh │ ├── json_spirit_value.h │ ├── json_spirit_writer_options.h │ ├── json_spirit_writer_template.h │ ├── kernel_runtime_stats.cuh │ ├── latency_utils.cuh │ ├── mark_segment.cuh │ ├── misc_utils.cu │ ├── misc_utils.cuh │ ├── multiple_buffering.cuh │ ├── multithread_utils.cuh │ ├── multithreading.cuh │ ├── numeric_traits.cuh │ ├── operators.cuh │ ├── parameters.h │ ├── random_bits.h │ ├── reduce_device.cuh │ ├── reduction │ ├── cooperative_reduction.cuh │ ├── kernel.cuh │ ├── serial_reduce.cuh │ ├── soa │ │ ├── cooperative_soa_reduction.cuh │ │ ├── serial_soa_reduce.cuh │ │ └── warp_soa_reduce.cuh │ ├── tree_reduce.cuh │ └── warp_reduce.cuh │ ├── sarray_utils.cuh │ ├── scan │ ├── block_scan.cuh │ ├── cooperative_scan.cuh │ ├── multi_scan.cuh │ ├── serial_scan.cuh │ ├── soa │ │ ├── cooperative_soa_scan.cuh │ │ ├── serial_soa_scan.cuh │ │ └── warp_soa_scan.cuh │ └── warp_scan.cuh │ ├── scan_device.cuh │ ├── select_device.cuh │ ├── shared_utils.cuh │ ├── sharedmem.cuh │ ├── soa_tuple.cuh │ ├── sort_device.cuh │ ├── sort_omp.cuh │ ├── srts_details.cuh │ ├── srts_grid.cuh │ ├── srts_soa_details.cuh │ ├── str_to_T.cu │ ├── str_to_T.cuh │ ├── sysinfo.h │ ├── sysinfo_rapidjson.h │ ├── test_utils.cu │ ├── test_utils.cuh │ ├── test_utils.h │ ├── track_utils.cuh │ ├── type_enum.cuh │ ├── type_limits.cuh │ ├── vector_types.cuh │ └── vector_utils.cuh ├── python ├── pagerank.py └── toy_graph │ ├── col.txt │ ├── row.txt │ └── val.txt ├── scripts ├── v0.5.x │ ├── ipdps17 │ │ ├── Makefile │ │ ├── run_fig2.sh │ │ ├── run_fig3.sh │ │ ├── run_fig4.sh │ │ └── run_fig5.sh │ ├── performance │ │ ├── bc-test.sh │ │ ├── bfs-test.sh │ │ ├── cc-test.sh │ │ ├── grapl19-test.sh │ │ ├── pr-test.sh │ │ └── sssp-test.sh │ ├── ppopp16 │ │ ├── bc-test.sh │ │ ├── bfs-test.sh │ │ ├── cc-test.sh │ │ ├── ppopp16-test.sh │ │ ├── pr-test.sh │ │ └── sssp-test.sh │ ├── standard │ │ ├── README.md │ │ ├── bc-test.sh │ │ ├── bfs-test.sh │ │ ├── cc-test.sh │ │ ├── pr-test.sh │ │ ├── run-tests.sh │ │ └── sssp-test.sh │ └── topc │ │ ├── README.md │ │ ├── bc-test.sh │ │ ├── bfs-test.sh │ │ ├── cc-test.sh │ │ ├── pr-test.sh │ │ ├── sssp-test.sh │ │ └── topc-test.sh └── v1.x.x │ └── perf │ ├── bc.sh │ ├── bfs.sh │ ├── pr.sh │ ├── run.sh │ ├── skeleton.sh │ ├── sssp.sh │ └── tc.sh ├── tools ├── associate_weights.py ├── convert_to_gr │ ├── Makefile │ ├── convert_to_gr.cu │ └── run.sh ├── gr_to_mtx_general.py ├── gr_to_mtx_symmetric.py ├── matrix2snap.py ├── mtx_to_gr.py ├── remove_weights.py └── replace_weights.py └── unittests ├── CMakeLists.txt ├── test_binarysearch.h ├── test_lib_pr.h ├── test_lib_sm.h ├── test_repeatfor.h ├── test_segreduce.h └── test_unittests.cu /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: I found a bug! Here are the deets you need to start work on a fix. 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Summary:** 11 | A clear and concise description of the bug. 12 | 13 | **Reproducibility:** 14 | Always or Sometimes 15 | 16 | **To Reproduce:** 17 | Detail the steps necessary to reproduce the behavior. 18 | 19 | For example: 20 | 1. Clone gunrock 21 | 2. Switch to the dev-refactor branch 22 | 23 | Make sure to: 24 | $ git submodule init 25 | $ git submodule update 26 | etc. 27 | etc. 28 | 29 | **Expected Behavior:** 30 | A clear and concise description of what you expected to happen. 31 | 32 | **Actual Results:** 33 | A clear and concise description of what you actually experienced. 34 | 35 | **System Configuration:** 36 | 37 | GPU: GTX 970 38 | CPU: Intel(R) Xeon(R) CPU E3-1280 v5 @ 3.70GHz 39 | OS: Ubuntu 18.04.1 LTS 40 | Cuda compilation tools, release 10.0, V10.0.130 41 | NVIDIA-SMI 415.13 42 | Driver Version: 415.13 43 | CUDA Version: 10.0 44 | gcc (Ubuntu 6.4.0-17ubuntu1) 6.4.0 20180424 45 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: I have a suggestion for Gunrock. 4 | title: '' 5 | labels: enhancement 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Feature Description:** 11 | A clear and concise description of the feature you are requesting and the problem it solves. 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | -------------------------------------------------------------------------------- /.github/SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | Moving forward, we will only be supporting version `1.x.x`, the new API of Gunrock. 6 | All applications will be ported from version `0.5.x` to `1.x.x`. Please also see the build 7 | status in the README.md file for important build information. 8 | 9 | | Version | Supported | 10 | | ------- | ------------------ | 11 | | 1.x.x | :white_check_mark: | 12 | | 0.5.x | :x: | 13 | 14 | ## Reporting a Vulnerability 15 | 16 | If you have found a vulnerability, please use the GitHub issues to report it. 17 | 18 | You may also file a fix for it using GitHub's pull requests. We will perform a code review, 19 | and if everything is good, the fix will be merged into the repository. 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | 6 | # Compiled Dynamic libraries 7 | *.so 8 | *.dylib 9 | 10 | # Compiled Static libraries 11 | *.lai 12 | *.la 13 | *.a 14 | 15 | # Ignore graph dataset files 16 | *.mtx* 17 | 18 | # Ignore vim undo file 19 | *.un~ 20 | 21 | # Ignore tarball 22 | *.tar.gz 23 | 24 | # Ignore bin directory 25 | bin/ 26 | 27 | # Ignore eval directory 28 | eval/ 29 | 30 | # Ignore doc generated files 31 | doxygen/warn.log 32 | doxygen/html 33 | 34 | # Ignore text files under tests directories 35 | unittests/*/*.txt 36 | examples/*/*.txt 37 | 38 | # exceptions for ignore 39 | !unittests/*/CMakeLists.txt 40 | !examples/*/CMakeLists.txt 41 | 42 | # Ignore vim temp files 43 | *.sw~ 44 | 45 | # Ignore cmake configure_file() files 46 | gunrock/util/gitsha1.c 47 | 48 | # Ignore build directory 49 | build 50 | 51 | # ignore clion files 52 | .idea* 53 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "externals/cub"] 2 | path = externals/cub 3 | url = https://github.com/NVlabs/cub.git 4 | branch = 1.8.0 5 | [submodule "externals/moderngpu"] 6 | path = externals/moderngpu 7 | url = https://github.com/NVlabs/moderngpu.git 8 | branch = branch_1.1 9 | [submodule "docs"] 10 | path = docs 11 | url = https://github.com/gunrock/docs.git 12 | branch = master 13 | [submodule "externals/rapidjson"] 14 | path = externals/rapidjson 15 | url = https://github.com/Tencent/rapidjson.git 16 | [submodule "G3-Demo"] 17 | path = G3-Demo 18 | url = https://github.com/lushl9301/G3-Demo 19 | -------------------------------------------------------------------------------- /cmake/DownloadGoogleTest.cmake: -------------------------------------------------------------------------------- 1 | # Download GoogleTest 2 | cmake_minimum_required(VERSION 2.8.2) 3 | 4 | project(googletest-download NONE) 5 | 6 | include(ExternalProject) 7 | ExternalProject_Add(googletest 8 | GIT_REPOSITORY https://github.com/google/googletest.git 9 | GIT_TAG master 10 | SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/googletest-src" 11 | BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/googletest-build" 12 | CONFIGURE_COMMAND "" 13 | BUILD_COMMAND "" 14 | INSTALL_COMMAND "" 15 | TEST_COMMAND "" 16 | ) 17 | 18 | -------------------------------------------------------------------------------- /cmake/FindBoost.cmake: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------ 2 | # Gunrock: Finds Boost package and includes/links directories 3 | # ------------------------------------------------------------------------ 4 | SET(gunrock_REQUIRED_BOOST_VERSION 1.58) 5 | 6 | FIND_PACKAGE(Boost ${gunrock_REQUIRED_BOOST_VERSION}) 7 | IF (Boost_FOUND) 8 | INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) 9 | LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) 10 | ELSE () 11 | MESSAGE(WARNING "Boost was requested but support was not found, run 12 | `sudo apt-get install libboost1.58-all-dev` `/dep/install_boost.sh` for installation.") 13 | ENDIF () 14 | -------------------------------------------------------------------------------- /cmake/FindCUB.cmake: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------ 2 | # Gunrock: Find external cub directories 3 | # ------------------------------------------------------------------------ 4 | SET(cub_INCLUDE_DIRS 5 | ${CMAKE_SOURCE_DIR}/externals/cub 6 | CACHE PATH 7 | "Directory to the CUB include files") 8 | -------------------------------------------------------------------------------- /cmake/FindGoogleTest.cmake: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------ 2 | # Gunrock: Find external googletest directories 3 | # ------------------------------------------------------------------------ 4 | 5 | # Download and unpack googletest at configure time 6 | configure_file(${CMAKE_SOURCE_DIR}/cmake/DownloadGoogleTest.cmake googletest-download/CMakeLists.txt) 7 | execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . 8 | RESULT_VARIABLE result 9 | WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download ) 10 | 11 | if(result) 12 | message(FATAL_ERROR "CMake step for googletest failed: ${result}") 13 | endif() 14 | 15 | execute_process(COMMAND ${CMAKE_COMMAND} --build . 16 | RESULT_VARIABLE result 17 | WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download ) 18 | 19 | if(result) 20 | message(FATAL_ERROR "Build step for googletest failed: ${result}") 21 | endif() 22 | 23 | # Prevent overriding the parent project's compiler/linker 24 | # settings on Windows 25 | set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) 26 | 27 | # Add googletest directly to our build. This defines 28 | # the gtest and gtest_main targets. 29 | add_subdirectory(${CMAKE_CURRENT_BINARY_DIR}/googletest-src 30 | ${CMAKE_CURRENT_BINARY_DIR}/googletest-build 31 | EXCLUDE_FROM_ALL) 32 | 33 | # The gtest/gtest_main targets carry header search path 34 | # dependencies automatically when using CMake 2.8.11 or 35 | # later. Otherwise we have to add them here ourselves. 36 | if (CMAKE_VERSION VERSION_LESS 2.8.11) 37 | include_directories("${gtest_SOURCE_DIR}/include") 38 | endif() 39 | 40 | # Now simply link against gtest or gtest_main as needed. Eg 41 | # add_executable(example example.cpp) 42 | # target_link_libraries(example gtest_main) 43 | # add_test(NAME example_test COMMAND example) 44 | 45 | -------------------------------------------------------------------------------- /cmake/FindMetis.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Find the PARMETIS includes and libraries 3 | # 4 | # ParMETIS is an MPI-based parallel library that implements a variety of algorithms for 5 | # partitioning unstructured graphs, meshes, and for computing fill-reducing orderings of 6 | # sparse matrices. It can be found at: 7 | # http://www-users.cs.umn.edu/~karypis/metis/parmetis/index.html 8 | # 9 | # PARMETIS_INCLUDE_DIR - where to find autopack.h 10 | # PARMETIS_LIBRARIES - List of fully qualified libraries to link against. 11 | # PARMETIS_FOUND - Do not attempt to use if "no" or undefined. 12 | 13 | FIND_PATH(PARMETIS_INCLUDE_DIR parmetis.h 14 | /usr/local/include 15 | /usr/include 16 | ) 17 | 18 | FIND_LIBRARY(PARMETIS_LIBRARY parmetis 19 | /usr/local/lib 20 | /usr/lib 21 | ) 22 | 23 | IF(PARMETIS_INCLUDE_DIR) 24 | IF(PARMETIS_LIBRARY) 25 | SET( PARMETIS_LIBRARIES ${PARMETIS_LIBRARY} ${METIS_LIBRARY}) 26 | SET( PARMETIS_FOUND "YES" ) 27 | ENDIF(PARMETIS_LIBRARY) 28 | ENDIF(PARMETIS_INCLUDE_DIR) 29 | 30 | # ------------------------------------------------------------------------ 31 | # Gunrock: Find Metis and set pre-compiler flag 32 | # ------------------------------------------------------------------------ 33 | FIND_LIBRARY(METIS_LIBRARY metis 34 | /usr/local/lib 35 | /usr/lib 36 | ) 37 | 38 | SET(gunrock_REQUIRED_METIS_VERSION 5.0) 39 | 40 | IF (METIS_LIBRARY) 41 | SET(METIS_FOUND true) 42 | ADD_DEFINITIONS( -DMETIS_FOUND=true ) 43 | MESSAGE(STATUS "Found Metis") 44 | ELSE (METIS_LIBRARY) 45 | #SET(METIS_FOUND false) 46 | #ADD_DEFINITIONS( -DMETIS_FOUND=false ) 47 | MESSAGE(WARNING "Metis was requested but support was not found, run `sudo apt-get install metis` or `/dep/install_metis.sh` for installation.") 48 | ENDIF (METIS_LIBRARY) 49 | -------------------------------------------------------------------------------- /cmake/FindModernGPU.cmake: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------ 2 | # Gunrock: Find external moderngpu directories 3 | # ------------------------------------------------------------------------ 4 | SET(mgpu_INCLUDE_DIRS 5 | ${CMAKE_SOURCE_DIR}/externals/moderngpu/include 6 | CACHE PATH 7 | "Directory to the Modern GPU include files") 8 | 9 | SET(mgpu_SOURCE_DIRS 10 | ${CMAKE_SOURCE_DIR}/externals/moderngpu/src 11 | CACHE PATH 12 | "Directory to the Modern GPU source files") 13 | -------------------------------------------------------------------------------- /cmake/GetGitRevisionDescription.cmake.in: -------------------------------------------------------------------------------- 1 | # 2 | # Internal file for GetGitRevisionDescription.cmake 3 | # 4 | # Requires CMake 2.6 or newer (uses the 'function' command) 5 | # 6 | # Original Author: 7 | # 2009-2010 Ryan Pavlik 8 | # http://academic.cleardefinition.com 9 | # Iowa State University HCI Graduate Program/VRAC 10 | # 11 | # Copyright Iowa State University 2009-2010. 12 | # Distributed under the Boost Software License, Version 1.0. 13 | # (See accompanying file LICENSE_1_0.txt or copy at 14 | # http://www.boost.org/LICENSE_1_0.txt) 15 | 16 | set(HEAD_HASH) 17 | 18 | file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024) 19 | 20 | string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS) 21 | if(HEAD_CONTENTS MATCHES "ref") 22 | # named branch 23 | string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}") 24 | if(EXISTS "@GIT_DIR@/${HEAD_REF}") 25 | configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY) 26 | else() 27 | configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs" COPYONLY) 28 | file(READ "@GIT_DATA@/packed-refs" PACKED_REFS) 29 | if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}") 30 | set(HEAD_HASH "${CMAKE_MATCH_1}") 31 | endif() 32 | endif() 33 | else() 34 | # detached HEAD 35 | configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY) 36 | endif() 37 | 38 | if(NOT HEAD_HASH) 39 | file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024) 40 | string(STRIP "${HEAD_HASH}" HEAD_HASH) 41 | endif() 42 | -------------------------------------------------------------------------------- /cmake/SetSubProject.cmake: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------ 2 | # Gunrock: Set sub projects includes, links and executables. 3 | # ------------------------------------------------------------------------ 4 | 5 | # begin /* rapidjson include directories */ 6 | if(RAPIDJSON_FOUND) 7 | include_directories(${RAPIDJSON_INCLUDEDIR}) 8 | else() 9 | message(SEND_ERROR "RapidJson include directory not set.") 10 | endif() 11 | # end /* rapidjson include directories */ 12 | 13 | # begin /* moderngpu include directories */ 14 | if(mgpu_INCLUDE_DIRS) 15 | include_directories(${mgpu_INCLUDE_DIRS}) 16 | else() 17 | message(SEND_ERROR "Modern GPU include directory not set.") 18 | endif() 19 | 20 | set (mgpu_SOURCE_FILES 21 | ${mgpu_SOURCE_DIRS}/mgpucontext.cu 22 | ${mgpu_SOURCE_DIRS}/mgpuutil.cpp) 23 | # end /* moderngpu include directories */ 24 | 25 | # begin /* CUB include directories */ 26 | if (cub_INCLUDE_DIRS) 27 | include_directories(${cub_INCLUDE_DIRS}) 28 | else() 29 | message(SEND_ERROR "CUB include directory not set.") 30 | endif() 31 | # end /* CUB include directories */ 32 | 33 | # begin /* Add CUDA executables */ 34 | CUDA_ADD_EXECUTABLE(${PROJECT_NAME} 35 | test_${PROJECT_NAME}.cu 36 | ${CMAKE_SOURCE_DIR}/gunrock/util/str_to_T.cu 37 | ${CMAKE_SOURCE_DIR}/gunrock/util/test_utils.cu 38 | ${CMAKE_SOURCE_DIR}/gunrock/util/error_utils.cu 39 | ${CMAKE_SOURCE_DIR}/gunrock/util/misc_utils.cu 40 | ${CMAKE_SOURCE_DIR}/gunrock/util/gitsha1.c 41 | ${mgpu_SOURCE_FILES} 42 | OPTIONS ${GENCODE} ${VERBOSE_PTXAS}) 43 | # end /* Add CUDA executables */ 44 | 45 | # begin /* Link Metis and Boost */ 46 | target_link_libraries(${PROJECT_NAME} ${Boost_LIBRARIES}) 47 | if (METIS_LIBRARY) 48 | target_link_libraries(${PROJECT_NAME} ${METIS_LIBRARY}) 49 | endif() 50 | # end /* Link Metis and Boost */ 51 | 52 | # begin /* Simple ctest that tests cmd help */ 53 | string(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UP) 54 | add_test(NAME TEST_${PROJECT_NAME_UP}_CMD COMMAND ${PROJECT_NAME} --help) 55 | set_tests_properties(TEST_${PROJECT_NAME_UP}_CMD PROPERTIES 56 | PASS_REGULAR_EXPRESSION "Required arguments:") 57 | # end /* Simple ctest that tests cmd help */ 58 | 59 | -------------------------------------------------------------------------------- /dataset/large/Makefile: -------------------------------------------------------------------------------- 1 | #Makefile to fetch and install graph data for regression 2 | #testing borrowed from Royal Caliber 3 | 4 | #Each graph lives in its own directory 5 | SUBDIRS = ak2010 belgium_osm delaunay_n13 delaunay_n21 delaunay_n24 coAuthorsDBLP kron_g500-logn21 soc-LiveJournal1 webbase-1M europe_osm road_usa cit-Patents soc-orkut indochina-2004 hollywood-2009 roadNet-CA 6 | 7 | SUBDIRS_IPDPS17 = soc-LiveJournal1 hollywood-2009 soc-orkut soc-sinaweibo soc-twitter-2010 indochina-2004 uk-2002 arabic-2005 uk-2005 webbase-2001 germany_osm asia_osm europe_osm road_central road_usa kron_g500-logn21 8 | 9 | SUBDIRS_TOPC = soc-LiveJournal1 hollywood-2009 soc-orkut indochina-2004 road_usa 10 | 11 | SUBDIRS_STANDARD = soc-LiveJournal1 hollywood-2009 soc-orkut indochina-2004 road_usa 12 | 13 | .PHONY: $(GRAPHS) 14 | 15 | #fetches all graphs, extracts and sets up files for tests 16 | all: recurse 17 | 18 | #only download the graphs, but do not proceed further 19 | fetch: recurse 20 | 21 | #clean everything except the downloaded graphs 22 | clean: recurse 23 | 24 | #clean everything including the downloaded graphs 25 | realclean: recurse 26 | 27 | #recurse into each subdirectory and try to build the provided targets 28 | recurse: 29 | for subdir in $(SUBDIRS); do $(MAKE) -C $$subdir $(MAKECMDGOALS); done 30 | 31 | IPDPS17: recurse_ipdps17 32 | 33 | recurse_ipdps17: 34 | for subdir in $(SUBDIRS_IPDPS17); do $(MAKE) -C $$subdir; done 35 | 36 | TOPC: recurse_topc 37 | 38 | recurse_topc: 39 | for subdir in $(SUBDIRS_TOPC); do $(MAKE) -C $$subdir; done 40 | 41 | STANDARD: recurse_standard 42 | 43 | recurse_standard: 44 | for subdir in $(SUBDIRS_STANDARD); do $(MAKE) -C $$subdir; done 45 | 46 | $(GRAPHS): 47 | $(MAKE) -C $@ 48 | -------------------------------------------------------------------------------- /dataset/large/ak2010/Makefile: -------------------------------------------------------------------------------- 1 | GRAPH_NAME = ak2010 2 | GRAPH_URL = https://www.cise.ufl.edu/research/sparse/MM/DIMACS10/ak2010.tar.gz 3 | 4 | include ../common.mk 5 | include ../ufl.mk 6 | -------------------------------------------------------------------------------- /dataset/large/arabic-2005/Makefile: -------------------------------------------------------------------------------- 1 | GRAPH_NAME = arabic-2005 2 | GRAPH_URL = https://www.cise.ufl.edu/research/sparse/MM/LAW/arabic-2005.tar.gz 3 | 4 | include ../ufl.mk 5 | include ../common.mk 6 | -------------------------------------------------------------------------------- /dataset/large/asia_osm/Makefile: -------------------------------------------------------------------------------- 1 | GRAPH_NAME = asia_osm 2 | GRAPH_URL = https://www.cise.ufl.edu/research/sparse/MM/DIMACS10/asia_osm.tar.gz 3 | 4 | include ../common.mk 5 | include ../ufl.mk 6 | -------------------------------------------------------------------------------- /dataset/large/belgium_osm/Makefile: -------------------------------------------------------------------------------- 1 | GRAPH_NAME = belgium_osm 2 | GRAPH_URL = https://www.cise.ufl.edu/research/sparse/MM/DIMACS10/belgium_osm.tar.gz 3 | 4 | include ../common.mk 5 | include ../ufl.mk 6 | -------------------------------------------------------------------------------- /dataset/large/cit-Patents/Makefile: -------------------------------------------------------------------------------- 1 | GRAPH_NAME = cit-Patents 2 | GRAPH_URL = https://www.cise.ufl.edu/research/sparse/MM/SNAP/cit-Patents.tar.gz 3 | 4 | include ../common.mk 5 | include ../ufl.mk 6 | -------------------------------------------------------------------------------- /dataset/large/coAuthorsDBLP/Makefile: -------------------------------------------------------------------------------- 1 | GRAPH_NAME = coAuthorsDBLP 2 | GRAPH_URL = https://www.cise.ufl.edu/research/sparse/MM/DIMACS10/coAuthorsDBLP.tar.gz 3 | 4 | include ../ufl.mk 5 | include ../common.mk 6 | -------------------------------------------------------------------------------- /dataset/large/common.mk: -------------------------------------------------------------------------------- 1 | #The following variables must be defined prior to including this 2 | #makefile fragment 3 | # 4 | #GRAPH_URL: the url path to the file 5 | 6 | OSUPPER := $(shell uname -s 2>/dev/null | tr [:lower:] [:upper:]) 7 | 8 | ifeq (DARWIN, $(findstring DARWIN, $(OSUPPER))) 9 | WGET := curl -O 10 | else 11 | WGET := wget -N 12 | endif 13 | 14 | TAR := tar 15 | GZIP := gzip 16 | MATRIX2SNAP := ../matrix2snap.py 17 | 18 | GRAPH_FILE := $(notdir $(GRAPH_URL)) 19 | 20 | all: setup 21 | 22 | fetch: $(GRAPH_FILE) 23 | 24 | $(GRAPH_FILE): 25 | $(WGET) $(GRAPH_URL) 26 | 27 | IPDPS17: setup 28 | -------------------------------------------------------------------------------- /dataset/large/delaunay_n13/Makefile: -------------------------------------------------------------------------------- 1 | GRAPH_NAME = delaunay_n13 2 | GRAPH_URL = https://www.cise.ufl.edu/research/sparse/MM/DIMACS10/delaunay_n13.tar.gz 3 | 4 | 5 | include ../ufl.mk 6 | include ../common.mk 7 | -------------------------------------------------------------------------------- /dataset/large/delaunay_n21/Makefile: -------------------------------------------------------------------------------- 1 | GRAPH_NAME = delaunay_n21 2 | GRAPH_URL = https://www.cise.ufl.edu/research/sparse/MM/DIMACS10/delaunay_n21.tar.gz 3 | 4 | 5 | include ../ufl.mk 6 | include ../common.mk 7 | -------------------------------------------------------------------------------- /dataset/large/delaunay_n24/Makefile: -------------------------------------------------------------------------------- 1 | GRAPH_NAME = delaunay_n24 2 | GRAPH_URL = https://www.cise.ufl.edu/research/sparse/MM/DIMACS10/delaunay_n24.tar.gz 3 | 4 | 5 | include ../ufl.mk 6 | include ../common.mk 7 | -------------------------------------------------------------------------------- /dataset/large/europe_osm/Makefile: -------------------------------------------------------------------------------- 1 | GRAPH_NAME = europe_osm 2 | GRAPH_URL = https://www.cise.ufl.edu/research/sparse/MM/DIMACS10/europe_osm.tar.gz 3 | 4 | include ../common.mk 5 | include ../ufl.mk 6 | -------------------------------------------------------------------------------- /dataset/large/germany_osm/Makefile: -------------------------------------------------------------------------------- 1 | GRAPH_NAME = germany_osm 2 | GRAPH_URL = https://www.cise.ufl.edu/research/sparse/MM/DIMACS10/germany_osm.tar.gz 3 | 4 | include ../common.mk 5 | include ../ufl.mk 6 | -------------------------------------------------------------------------------- /dataset/large/hollywood-2009/Makefile: -------------------------------------------------------------------------------- 1 | GRAPH_NAME = hollywood-2009 2 | GRAPH_URL = https://www.cise.ufl.edu/research/sparse/MM/LAW/hollywood-2009.tar.gz 3 | 4 | include ../ufl.mk 5 | include ../common.mk 6 | -------------------------------------------------------------------------------- /dataset/large/indochina-2004/Makefile: -------------------------------------------------------------------------------- 1 | GRAPH_NAME = indochina-2004 2 | GRAPH_URL = https://www.cise.ufl.edu/research/sparse/MM/LAW/indochina-2004.tar.gz 3 | 4 | include ../ufl.mk 5 | include ../common.mk 6 | -------------------------------------------------------------------------------- /dataset/large/kron_g500-logn21/Makefile: -------------------------------------------------------------------------------- 1 | GRAPH_NAME = kron_g500-logn21 2 | GRAPH_URL = https://www.cise.ufl.edu/research/sparse/MM/DIMACS10/kron_g500-logn21.tar.gz 3 | 4 | 5 | include ../ufl.mk 6 | include ../common.mk 7 | -------------------------------------------------------------------------------- /dataset/large/networkrepo.mk: -------------------------------------------------------------------------------- 1 | #common make file fragment for networkrepository.com 2 | #just define GRAPH_NAME prior to including this fragment 3 | 4 | GRAPH_ZIP = $(GRAPH_NAME).zip 5 | 6 | setup: $(GRAPH_NAME).mtx 7 | 8 | $(GRAPH_NAME).mtx: $(GRAPH_ZIP) 9 | unzip $(GRAPH_ZIP) 10 | rm -rf readme.txt 11 | 12 | clean: 13 | rm $(GRAPH_NAME).mtx 14 | 15 | realclean: clean 16 | rm $(GRAPH_ZIP) 17 | 18 | -------------------------------------------------------------------------------- /dataset/large/rgg_n_2_24_s0/readme.txt: -------------------------------------------------------------------------------- 1 | Dataset download link: 2 | https://drive.google.com/uc?export=download&id=0Bw6LwCuER0a3VWNrVUV6eTZyeFUI 3 | -------------------------------------------------------------------------------- /dataset/large/roadNet-CA/Makefile: -------------------------------------------------------------------------------- 1 | GRAPH_NAME = roadNet-CA 2 | GRAPH_URL = https://www.cise.ufl.edu/research/sparse/MM/SNAP/roadNet-CA.tar.gz 3 | 4 | 5 | include ../ufl.mk 6 | include ../common.mk 7 | -------------------------------------------------------------------------------- /dataset/large/road_central/Makefile: -------------------------------------------------------------------------------- 1 | GRAPH_NAME = road_central 2 | GRAPH_URL = https://www.cise.ufl.edu/research/sparse/MM/DIMACS10/road_central.tar.gz 3 | 4 | include ../common.mk 5 | include ../ufl.mk 6 | -------------------------------------------------------------------------------- /dataset/large/road_usa/Makefile: -------------------------------------------------------------------------------- 1 | GRAPH_NAME = road_usa 2 | GRAPH_URL = https://www.cise.ufl.edu/research/sparse/MM/DIMACS10/road_usa.tar.gz 3 | 4 | include ../common.mk 5 | include ../ufl.mk 6 | -------------------------------------------------------------------------------- /dataset/large/soc-LiveJournal1/Makefile: -------------------------------------------------------------------------------- 1 | GRAPH_NAME = soc-LiveJournal1 2 | GRAPH_URL = https://www.cise.ufl.edu/research/sparse/MM/SNAP/soc-LiveJournal1.tar.gz 3 | 4 | include ../ufl.mk 5 | include ../common.mk 6 | -------------------------------------------------------------------------------- /dataset/large/soc-orkut/Makefile: -------------------------------------------------------------------------------- 1 | GRAPH_NAME = soc-orkut 2 | GRAPH_URL = http://nrvis.com/download/data/soc/soc-orkut.zip 3 | 4 | 5 | include ../networkrepo.mk 6 | include ../common.mk 7 | 8 | -------------------------------------------------------------------------------- /dataset/large/soc-sinaweibo/Makefile: -------------------------------------------------------------------------------- 1 | GRAPH_NAME = soc-sinaweibo 2 | GRAPH_URL = http://nrvis.com/download/data/massive/soc-sinaweibo.zip 3 | 4 | 5 | include ../networkrepo.mk 6 | include ../common.mk 7 | 8 | -------------------------------------------------------------------------------- /dataset/large/soc-twitter-2010/Makefile: -------------------------------------------------------------------------------- 1 | GRAPH_NAME = soc-twitter-2010 2 | GRAPH_URL = http://nrvis.com/download/data/massive/soc-twitter-2010.zip 3 | 4 | 5 | include ../networkrepo.mk 6 | include ../common.mk 7 | 8 | -------------------------------------------------------------------------------- /dataset/large/ufl.mk: -------------------------------------------------------------------------------- 1 | #common make file fragment for ufl graph datasets 2 | #just define GRAPH_NAME prior to including this fragment 3 | 4 | GRAPH_TAR = $(GRAPH_NAME).tar.gz 5 | 6 | setup: $(GRAPH_NAME).mtx 7 | 8 | $(GRAPH_NAME).mtx: $(GRAPH_TAR) 9 | tar xvfz $(GRAPH_TAR) 10 | cp $(GRAPH_NAME)/$(GRAPH_NAME).mtx $(GRAPH_NAME).mtx 11 | rm -rf $(GRAPH_NAME) 12 | 13 | clean: 14 | rm $(GRAPH_NAME).mtx 15 | 16 | realclean: clean 17 | rm $(GRAPH_TAR) 18 | 19 | -------------------------------------------------------------------------------- /dataset/large/uk-2002/Makefile: -------------------------------------------------------------------------------- 1 | GRAPH_NAME = uk-2002 2 | GRAPH_URL = https://www.cise.ufl.edu/research/sparse/MM/LAW/uk-2002.tar.gz 3 | 4 | include ../ufl.mk 5 | include ../common.mk 6 | -------------------------------------------------------------------------------- /dataset/large/uk-2005/Makefile: -------------------------------------------------------------------------------- 1 | GRAPH_NAME = uk-2005 2 | GRAPH_URL = https://www.cise.ufl.edu/research/sparse/MM/LAW/uk-2005.tar.gz 3 | 4 | include ../ufl.mk 5 | include ../common.mk 6 | -------------------------------------------------------------------------------- /dataset/large/webbase-1M/Makefile: -------------------------------------------------------------------------------- 1 | GRAPH_NAME = webbase-1M 2 | GRAPH_URL = https://www.cise.ufl.edu/research/sparse/MM/Williams/webbase-1M.tar.gz 3 | 4 | include ../ufl.mk 5 | include ../common.mk 6 | -------------------------------------------------------------------------------- /dataset/large/webbase-2001/Makefile: -------------------------------------------------------------------------------- 1 | GRAPH_NAME = webbase-2001 2 | GRAPH_URL = https://www.cise.ufl.edu/research/sparse/MM/LAW/webbase-2001.tar.gz 3 | 4 | include ../ufl.mk 5 | include ../common.mk 6 | -------------------------------------------------------------------------------- /dataset/small/data_sm.label: -------------------------------------------------------------------------------- 1 | 5 5 2 | 1 1 3 | 2 1 4 | 3 1 5 | 4 1 6 | 5 1 7 | -------------------------------------------------------------------------------- /dataset/small/map/gen_graph.py: -------------------------------------------------------------------------------- 1 | import sys 2 | from sets import Set 3 | from math import sqrt 4 | 5 | edge_file = open('cities.mtx', 'w') 6 | map_file = open('cities.map', 'w') 7 | 8 | if len(sys.argv) != 3: 9 | print "Usage: python gen_graph.py filename threshold" 10 | else: 11 | #get (vid, name, lat, lon, loc) tuple 12 | script, fname, threshold = sys.argv 13 | threshold = float(threshold) 14 | with open(fname) as f: 15 | lines = f.readlines() 16 | 17 | idx = 0 18 | vids = [] 19 | names = [] 20 | lat = [] 21 | lon = [] 22 | loc = [] 23 | for line in lines: 24 | if line[0] == 'I' or line[0] == 'z': 25 | continue 26 | items = line.split() 27 | vids.append(idx) 28 | names.append(items[0]) 29 | lat.append(float(items[1])) 30 | lon.append(float(items[2])) 31 | loc.append(''.join(items[3:])) 32 | idx += 1 33 | 34 | res = '' 35 | num_edges = 0 36 | nodes = Set() 37 | for i in range(len(vids)-1): 38 | for j in range(i+1,len(vids)): 39 | distance = (lat[i]-lat[j])**2+(lon[i]-lon[j])**2 40 | if distance <= threshold**2: 41 | res += str(i+1) + ' ' + str(j+1) + ' ' + str(sqrt(distance)) + '\n' 42 | num_edges += 1 43 | nodes.add(i) 44 | nodes.add(j) 45 | num_nodes = len(nodes) 46 | head = str(num_nodes) + ' ' + str(num_nodes) + ' ' + str(num_edges) + '\n' 47 | edge_file.write(head) 48 | edge_file.write(res) 49 | edge_file.close() 50 | 51 | for each in nodes: 52 | line = str(each) + ' ' + names[each] + ' ' + str(lat[each]) + ' ' + str(lon[each]) + '\n' 53 | map_file.write(line) 54 | map_file.close() 55 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /dataset/small/map/small.map: -------------------------------------------------------------------------------- 1 | 0 Troy 42.73 73.68 2 | 1 LakePlacid 44.28 73.99 3 | 2 Plattsburgh 44.70 73.46 4 | 3 Massena 44.93 74.89 5 | 4 Watertown 43.97 75.91 6 | 5 Utica 43.10 75.23 7 | 6 Syracuse 43.04 76.14 8 | 7 Rochester 43.17 77.61 9 | 8 Buffalo 42.89 78.86 10 | 9 Ithaca 42.44 76.50 11 | 10 Binghamton 42.10 75.91 12 | 11 Woodstock 42.04 74.11 13 | 12 NewYork 40.67 73.94 14 | -------------------------------------------------------------------------------- /dataset/small/query_sm.label: -------------------------------------------------------------------------------- 1 | 3 3 2 | 1 1 3 | 2 1 4 | 3 1 5 | -------------------------------------------------------------------------------- /dataset/small/tri_sm.label: -------------------------------------------------------------------------------- 1 | 3 3 2 | 1 1 3 | 2 1 4 | 3 1 5 | -------------------------------------------------------------------------------- /docker/ubuntu16.04-cuda10.1/README.md: -------------------------------------------------------------------------------- 1 | #### Instructions 2 | 3 | ``` 4 | user@home$ docker build . -t gunrock # Build container 5 | user@home$ nvidia-docker run -it gunrock /bin/bash # Start bash session in container 6 | 7 | root@docker$ cd gunrock/build 8 | root@docker$ make test # Run tests 9 | root@docker$ ./bin/cc market ../dataset/small/data_sm.mtx # Run app 10 | ``` 11 | -------------------------------------------------------------------------------- /docker/ubuntu16.04-cuda10.1/dockerfile: -------------------------------------------------------------------------------- 1 | FROM nvidia/cuda:10.1-devel-ubuntu16.04 2 | 3 | ######################## 4 | # Install Dependencies # 5 | ######################## 6 | 7 | RUN apt-get update && apt-get install -y --no-install-recommends \ 8 | cmake git && rm -rf /var/lib/apt/lists/* 9 | 10 | ################# 11 | # Build Gunrock # 12 | ################# 13 | 14 | RUN git clone --recursive https://github.com/gunrock/gunrock.git && \ 15 | cd gunrock && mkdir build && cd build && cmake .. && make -j$(nproc) 16 | -------------------------------------------------------------------------------- /docker/ubuntu16.04-cuda9.0/README.md: -------------------------------------------------------------------------------- 1 | #### Instructions 2 | 3 | ``` 4 | user@home$ docker build . -t gunrock # Build container 5 | user@home$ nvidia-docker run -it gunrock /bin/bash # Start bash session in container 6 | 7 | root@docker$ cd gunrock/build 8 | root@docker$ make test # Run tests 9 | root@docker$ ./bin/cc market ../dataset/small/data_sm.mtx # Run app 10 | ``` -------------------------------------------------------------------------------- /docker/ubuntu16.04-cuda9.0/dockerfile: -------------------------------------------------------------------------------- 1 | FROM nvidia/cuda:9.0-devel-ubuntu16.04 2 | 3 | ######################## 4 | # Install Dependencies # 5 | ######################## 6 | 7 | RUN apt-get update && apt-get install -y --no-install-recommends \ 8 | cmake git libboost-all-dev && rm -rf /var/lib/apt/lists/* 9 | 10 | ################# 11 | # Build Gunrock # 12 | ################# 13 | 14 | RUN git clone --recursive https://github.com/gunrock/gunrock.git && \ 15 | cd gunrock && mkdir build && cd build && cmake .. && make -j$(nproc) 16 | -------------------------------------------------------------------------------- /docker/ubuntu16.04-cuda9.1/README.md: -------------------------------------------------------------------------------- 1 | #### Instructions 2 | 3 | ``` 4 | user@home$ docker build . -t gunrock # Build container 5 | user@home$ nvidia-docker run -it gunrock /bin/bash # Start bash session in container 6 | 7 | root@docker$ cd gunrock/build 8 | root@docker$ make test # Run tests 9 | root@docker$ ./bin/cc market ../dataset/small/data_sm.mtx # Run app 10 | ``` -------------------------------------------------------------------------------- /docker/ubuntu16.04-cuda9.1/dockerfile: -------------------------------------------------------------------------------- 1 | FROM nvidia/cuda:9.1-devel-ubuntu16.04 2 | 3 | ######################## 4 | # Install Dependencies # 5 | ######################## 6 | 7 | RUN apt-get update && apt-get install -y --no-install-recommends \ 8 | cmake git libboost-all-dev && rm -rf /var/lib/apt/lists/* 9 | 10 | ################# 11 | # Build Gunrock # 12 | ################# 13 | 14 | RUN git clone --recursive https://github.com/gunrock/gunrock.git && \ 15 | cd gunrock && mkdir build && cd build && cmake .. && make -j$(nproc) 16 | -------------------------------------------------------------------------------- /doxygen/resources/footer.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /doxygen/resources/readme.txt: -------------------------------------------------------------------------------- 1 | doxy-boot.js and customdoxygen.css appears to have come from: 2 | 3 | https://github.com/Velron/doxygen-bootstrapped 4 | 5 | customdoxygen had a bunch of font stuff though, which was not in the current build. So I patched that back in. Also changed some colors to make the header look decent (it was broken). 6 | 7 | doxy-boot: copied some menu items (pages, files, globals, hierarchy) 8 | 9 | Also patch into header.html: 10 | 11 | https://github.com/Velron/doxygen-bootstrapped/blob/master/example-site/header.html 12 | 13 | footer.html is identical. 14 | 15 | 16 | 17 | Bootstrap: Replaced both bootstrap files with latest 3.x release from here: 18 | http://getbootstrap.com/getting-started/#download 19 | -------------------------------------------------------------------------------- /examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Gunrock's Testing CMake File 2 | 3 | # begin /* Add premitives' subdirectories */ 4 | 5 | #add_subdirectory(graphsum) 6 | #add_subdirectory(gtc) 7 | #add_subdirectory(sparseMatMul) 8 | #add_subdirectory(ReLU) 9 | #add_subdirectory(MatMul) 10 | #add_subdirectory(CrossEntropyLoss) 11 | add_subdirectory(gcn) 12 | #add_subdirectory(sgc) 13 | 14 | # end /* Add premitives' subdirectories */ 15 | 16 | # note: Some premitives are not added as test because they don't have 17 | # cpu reference code. 18 | 19 | if(GUNROCK_MGPU_TESTS) 20 | if(DEFINED DEVICES) 21 | set(DEVICES "--device=${DEVICES}") 22 | else(DEFINED DEVICES) 23 | message(WARNING "GUNROCK_MGPU_TESTS was set ON, but devices were not" 24 | " specified, using `-DDEVICES=0,0` instead (default).") 25 | set(DEVICES "--device=0,0") 26 | endif(DEFINED DEVICES) 27 | endif(GUNROCK_MGPU_TESTS) 28 | # end /* Enable Testing for `ctest` */ 29 | -------------------------------------------------------------------------------- /examples/README.md: -------------------------------------------------------------------------------- 1 | #### tests/README.md 2 | 3 | Code in these subdirectories runs CPU reference implementations and Gunrock GPU implementations. 4 | 5 | To compile: 6 | ``` 7 | cd 8 | make 9 | ``` 10 | 11 | ##### Getting started 12 | 13 | The `Template` and `hello` subdirectories have annotated code that is useful for getting started. 14 | 15 | - `Template` is an annotated/commented version of the `SSSP` app. 16 | - `hello` is a functional app that computes the degree of each node, which is about the simplest app possible given the current API. -------------------------------------------------------------------------------- /examples/bc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------ 2 | # Gunrock: Sub-Project Betweenness Centrality 3 | # ------------------------------------------------------------------------ 4 | project(bc) 5 | message("-- Project Added: ${PROJECT_NAME}") 6 | include(${CMAKE_SOURCE_DIR}/cmake/SetSubProject.cmake) 7 | 8 | add_test(NAME TEST_BC COMMAND bc market 9 | ${gunrock_INCLUDE_DIRS}/dataset/small/bips98_606.mtx --undirected --src=0) 10 | set_tests_properties(TEST_BC PROPERTIES FAIL_REGULAR_EXPRESSION "INCORRECT") 11 | -------------------------------------------------------------------------------- /examples/bc/Makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------- 2 | # Gunrock -- Fast and Efficient GPU Graph Library 3 | # ---------------------------------------------------------------- 4 | # This source code is distributed under the terms of LICENSE.TXT 5 | # in the root directory of this source distribution. 6 | # ---------------------------------------------------------------- 7 | 8 | #------------------------------------------------------------------------------- 9 | # (make test) Test driver for ALGO 10 | #------------------------------------------------------------------------------- 11 | 12 | include ../BaseMakefile.mk 13 | ALGO = bc 14 | EXEC = bin/test_$(ALGO)_$(NVCC_VERSION)_$(ARCH_SUFFIX) 15 | 16 | test: $(EXEC) 17 | 18 | $(EXEC) : test_$(ALGO).cu $(DEPS) 19 | mkdir -p bin 20 | $(NVCC) -w $(DEFINES) $(SM_TARGETS) -o $(EXEC) test_$(ALGO).cu $(EXTRA_SOURCE) $(NVCCFLAGS) $(ARCH) $(INC) -O3 21 | 22 | a : test_$(ALGO).cu $(DEPS) 23 | mkdir -p bin 24 | rm -f $(EXEC) 25 | $(NVCC) $(DEFINES) $(SM_TARGETS) -o $(EXEC) test_$(ALGO).cu $(EXTRA_SOURCE) $(NVCCFLAGS) $(ARCH) $(INC) -O3 > a.txt 2>&1 || true 26 | grep rror: a.txt; grep arn a.txt 27 | 28 | .DEFAULT_GOAL := test 29 | -------------------------------------------------------------------------------- /examples/bc/README.md: -------------------------------------------------------------------------------- 1 | ### tests/bc 2 | 3 | Betweeness centrality app 4 | 5 | #### Notes 6 | 7 | - Test fails on `delaunay_n21.mtx` due to overflow errors 8 | - Test fails (segfault) when `--src=-1` -------------------------------------------------------------------------------- /examples/bc/make_summary.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | g++ -Wall make_summary.cpp -o eval/make_summary -std=c++11 4 | cd eval 5 | 6 | DIRS="$(ls -d *K[48]0*)" 7 | 8 | for i in $DIRS 9 | do 10 | if [ -d $i ] ; 11 | then 12 | #echo $i 13 | ./make_summary $i 14 | fi 15 | done 16 | 17 | cd .. 18 | 19 | -------------------------------------------------------------------------------- /examples/bc/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | OPTION[0]="--src=largestdegree --device=0 --partition-method=random" 4 | 5 | MARK[0]="" 6 | 7 | #get all execution files in ./bin 8 | files=./bin/* 9 | #split file names into arr 10 | arr=$(echo $files | tr " " "\n") 11 | max_ver_num="$" 12 | exe_file=${arr[0]} 13 | #iterate over all file names to get the largest version number 14 | for x in $arr 15 | do 16 | output=$(grep -o "[0-9]\.[0-9]" <<<"$x") 17 | if [ "$output" \> "$max_ver_num" ]; then 18 | exe_file=$x 19 | fi 20 | done 21 | 22 | #put OS and Device type here 23 | SUFFIX="ubuntu16.04_TitanV" 24 | EXECUTION="./bin/test_bc_9.2_x86_64" #$exe_file 25 | DATADIR="/data/gunrock_dataset/large" 26 | 27 | mkdir -p eval/$SUFFIX 28 | 29 | for i in ak2010 belgium_osm coAuthorsDBLP delaunay_n13 delaunay_n21 soc-LiveJournal1 kron_g500-logn21 webbase-1M 30 | do 31 | for j in 0 32 | do 33 | echo $EXECUTION market $DATADIR/$i/$i.mtx ${OPTION[$j]} "> eval/$SUFFIX/$i.$SUFFIX${MARK[$j]}.txt" 34 | $EXECUTION market $DATADIR/$i/$i.mtx ${OPTION[$j]} > eval/$SUFFIX/$i.$SUFFIX${MARK[$j]}.txt 35 | sleep 1 36 | done 37 | done 38 | 39 | OPTION[0]="--src=-1 --device=0 --partition-method=random" 40 | MARK[0]="" 41 | 42 | for i in chesapeake test_bc 43 | do 44 | for j in 0 45 | do 46 | echo $EXECUTION market $DATADIR/../small/$i.mtx ${OPTION[$j]} "> eval/$SUFFIX/$i.$SUFFIX${MARK[$j]}.txt" 47 | $EXECUTION market $DATADIR/../small/$i.mtx ${OPTION[$j]} > eval/$SUFFIX/$i.$SUFFIX${MARK[$j]}.txt 48 | sleep 1 49 | done 50 | done 51 | -------------------------------------------------------------------------------- /examples/bc/run_rmat.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | OPTION="--src=largestdegree --traversal-mode=LB_CULL --in-sizing=1 --iteration-num=10" 4 | MARK=".skip_pred.LB_CULL.32bitSizeT" 5 | EXECUTION="./bin/test_bc_7.5_x86_64" 6 | DATADIR="../../dataset/large" 7 | 8 | cd ~/Projects/gunrock_dev/gunrock/tests/bc 9 | 10 | for d in {4..6} 11 | do 12 | SUFFIX="CentOS6_6.k40cx${d}.rand" 13 | mkdir -p eval/$SUFFIX 14 | DEVICE="0" 15 | for i in {1..8} 16 | do 17 | if [ "$i" -lt "$d" ]; then 18 | DEVICE=$DEVICE",$i" 19 | fi 20 | done 21 | queue_sizing=$(echo "${d} * 1.21" | bc) 22 | for i in 25 #{20..25} 23 | do 24 | max_j=$(echo "29-${i}" | bc) 25 | for j in {4..9} 26 | do 27 | edge_factor=$(echo "2^${j}" | bc) 28 | if [ "$j" -le $((29-${i})) ]; then 29 | echo $EXECUTION grmat --rmat_scale=${i} --rmat_edgefactor=${edge_factor} $OPTION --queue-sizing=${queue_sizing} --device=$DEVICE --jsondir=./eval/$SUFFIX "> ./eval/$SUFFIX/rmat_n${i}_${edge_factor}${MARK}.txt" 30 | $EXECUTION grmat --rmat_scale=${i} --rmat_edgefactor=${edge_factor} $OPTION --queue-sizing=${queue_sizing} --device=$DEVICE --jsondir=./eval/$SUFFIX > ./eval/$SUFFIX/rmat_n${i}_${edge_factor}${MARK}.txt 31 | sleep 1 32 | fi 33 | done 34 | done 35 | 36 | if [ "$d" -eq "1" ]; then 37 | for i in {20..25} 38 | do 39 | edge_factor=$(echo "2^( 29 - ${i} )" | bc) 40 | echo $EXECUTION rmat --rmat_scale=${i} --rmat_edgefactor=${edge_factor} $OPTION --queue-sizing=${queue_sizing} --device=$DEVICE --jsondir=./eval/$SUFFIX "> ./eval/$SUFFIX/rmat_n${i}_${edge_factor}${MARK}.txt" 41 | $EXECUTION rmat --rmat_scale=${i} --rmat_edgefactor=${edge_factor} $OPTION --queue-sizing=${queue_sizing} --device=$DEVICE --jsondir=./eval/$SUFFIX > ./eval/$SUFFIX/rmat_n${i}_${edge_factor}${MARK}.txt 42 | done 43 | fi 44 | done 45 | 46 | -------------------------------------------------------------------------------- /examples/bc/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # test.sh 4 | 5 | ./bin/test_bc* --graph-type market --graph-file ../../dataset/small/chesapeake.mtx --src 0 6 | 7 | -------------------------------------------------------------------------------- /examples/bfs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------ 2 | # Gunrock: Sub-Project Breadth First Search 3 | # ------------------------------------------------------------------------ 4 | project(bfs) 5 | message("-- Project Added: ${PROJECT_NAME}") 6 | include(${CMAKE_SOURCE_DIR}/cmake/SetSubProject.cmake) 7 | 8 | add_test(NAME TEST_BFS COMMAND bfs market 9 | ${gunrock_INCLUDE_DIRS}/dataset/small/bips98_606.mtx --undirected --src=0) 10 | set_tests_properties(TEST_BFS PROPERTIES FAIL_REGULAR_EXPRESSION "INCORRECT") 11 | 12 | if(GUNROCK_MGPU_TESTS) 13 | add_test(NAME TEST_MGPU_BFS COMMAND bfs market 14 | ${gunrock_INCLUDE_DIRS}/dataset/small/bips98_606.mtx ${DEVICES} --undirected --src=0) 15 | set_tests_properties(TEST_BFS PROPERTIES FAIL_REGULAR_EXPRESSION "INCORRECT") 16 | endif(GUNROCK_MGPU_TESTS) 17 | -------------------------------------------------------------------------------- /examples/bfs/Makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------- 2 | # Gunrock -- Fast and Efficient GPU Graph Library 3 | # ---------------------------------------------------------------- 4 | # This source code is distributed under the terms of LICENSE.TXT 5 | # in the root directory of this source distribution. 6 | # ---------------------------------------------------------------- 7 | 8 | #------------------------------------------------------------------------------- 9 | # (make test) Test driver for ALGO 10 | #------------------------------------------------------------------------------- 11 | 12 | include ../BaseMakefile.mk 13 | ALGO = bfs 14 | EXEC = bin/test_$(ALGO)_$(NVCC_VERSION)_$(ARCH_SUFFIX) 15 | 16 | test: $(EXEC) 17 | 18 | $(EXEC) : test_$(ALGO).cu $(DEPS) 19 | mkdir -p bin 20 | $(NVCC) $(DEFINES) $(SM_TARGETS) -o $(EXEC) test_$(ALGO).cu $(EXTRA_SOURCE) $(NVCCFLAGS) $(ARCH) $(INC) -O3 21 | 22 | a : test_$(ALGO).cu $(DEPS) 23 | mkdir -p bin 24 | rm -f $(EXEC) 25 | $(NVCC) $(DEFINES) $(SM_TARGETS) -o $(EXEC) test_$(ALGO).cu $(EXTRA_SOURCE) $(NVCCFLAGS) $(ARCH) $(INC) -O3 > a.txt 2>&1 || true 26 | grep rror: a.txt; grep arn a.txt 27 | 28 | .DEFAULT_GOAL := test 29 | -------------------------------------------------------------------------------- /examples/bfs/make_summary.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | g++ -Wall make_summary.cpp -o eval/make_summary -std=c++11 4 | cd eval 5 | 6 | DIRS="$(ls -d *K[48]0*)" 7 | 8 | for i in $DIRS 9 | do 10 | if [ -d $i ] ; 11 | then 12 | #echo $i 13 | ./make_summary $i 14 | fi 15 | done 16 | 17 | cd .. 18 | 19 | -------------------------------------------------------------------------------- /examples/bfs/run_avgDegree.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | OPTION="--undirected --idempotence --src=randomize2 --traversal-mode=LB --iteration-num=10" 4 | MARK=".skip_pred.undir.idempotence.LB.32bitSizeT.fw" 5 | EXECUTION="./bin/test_bfs_8.0_x86_64" 6 | DATADIR="/data/gunrock_dataset/large" 7 | 8 | #cd ~/Projects/gunrock_dev/gunrock/tests/bfs 9 | 10 | for d in 1 #{1..4} 11 | do 12 | SUFFIX="ubuntu14.04_k40cx${d}" 13 | mkdir -p eval/$SUFFIX 14 | DEVICE="0" 15 | for i in {1..8} 16 | do 17 | if [ "$i" -lt "$d" ]; then 18 | DEVICE=$DEVICE",$i" 19 | fi 20 | done 21 | queue_sizing=$(echo "1.25 * ${d}" | bc) 22 | 23 | scale="21" 24 | for edge_factor in 1 2 4 8 16 25 | do 26 | GRAPH="grmat --rmat_scale=${scale} --rmat_edgefactor=${edge_factor}" 27 | echo $EXECUTION $GRAPH $OPTION --queue-sizing=${queue_sizing} --device=$DEVICE --jsondir=./eval/$SUFFIX "> ./eval/$SUFFIX/rmat_n${scale}_${edge_factor}${MARK}.txt" 28 | $EXECUTION $GRAPH $OPTION --queue-sizing=${queue_sizing} --device=$DEVICE --jsondir=./eval/$SUFFIX > ./eval/$SUFFIX/rmat_n${scale}_${edge_factor}${MARK}.txt 29 | done 30 | 31 | queue_sizing=1 32 | for thfactor in "0.2" "0.3" "0.4" "0.6" "0.8" 33 | do 34 | GRAPH="rgg --rgg_scale=${scale} --rgg_thfactor=${thfactor}" 35 | echo $EXECUTION $GRAPH $OPTION --queue-sizing=${queue_sizing} --device=$DEVICE --jsondir=./eval/$SUFFIX "> ./eval/$SUFFIX/rgg_n${scale}_${thfactor}${MARK}.txt" 36 | $EXECUTION $GRAPH $OPTION --queue-sizing=${queue_sizing} --device=$DEVICE --jsondir=./eval/$SUFFIX > ./eval/$SUFFIX/rgg_n${scale}_${thfactor}${MARK}.txt 37 | done 38 | done 39 | 40 | -------------------------------------------------------------------------------- /examples/bfs/run_rmat.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | OPTION="--idempotence --src=largestdegree --traversal-mode=LB_CULL --direction-optimized --queue-sizing=6.5 --in-sizing=4 --iteration-num=10 --do_a=0.00001 --do_b=0.1" 4 | MARK=".skip_pred.idempotence.LB_CULL.32bitSizeT.do" 5 | EXECUTION="./bin/test_bfs_8.0_x86_64" 6 | DATADIR="/data/gunrock_dataset/large" 7 | 8 | for d in {1..2} 9 | do 10 | SUFFIX="ubuntu14.04_k40cx${d}_rand" 11 | mkdir -p eval/$SUFFIX 12 | #DEVICE="2" 13 | #if [ "$d" -eq "2" ]; then 14 | # DEVICE=$DEVICE",3" 15 | #fi 16 | 17 | DEVICE="0" 18 | for i in {1..8} 19 | do 20 | if [ "$i" -lt "$d" ]; then 21 | DEVICE=$DEVICE",$i" 22 | fi 23 | done 24 | 25 | for i in {20..25} 26 | do 27 | max_j=$(echo "29-${i}" | bc) 28 | for j in {4..9} 29 | do 30 | edge_factor=$(echo "2^${j}" | bc) 31 | if [ "$j" -le $((29-${i})) ]; then 32 | echo $EXECUTION grmat --rmat_scale=${i} --rmat_edgefactor=${edge_factor} $OPTION --device=$DEVICE --jsondir=./eval/$SUFFIX "> ./eval/$SUFFIX/rmat_n${i}_${edge_factor}${MARK}.txt" 33 | $EXECUTION grmat --rmat_scale=${i} --rmat_edgefactor=${edge_factor} $OPTION --device=$DEVICE --jsondir=./eval/$SUFFIX > ./eval/$SUFFIX/rmat_n${i}_${edge_factor}${MARK}.txt 34 | sleep 1 35 | fi 36 | done 37 | done 38 | 39 | if [ "$d" -eq "1" ]; then 40 | for i in {20..25} 41 | do 42 | edge_factor=$(echo "2^( 29 - ${i} )" | bc) 43 | echo $EXECUTION rmat --rmat_scale=${i} --rmat_edgefactor=${edge_factor} $OPTION --device=$DEVICE --jsondir=./eval/$SUFFIX "> ./eval/$SUFFIX/rmat_n${i}_${edge_factor}${MARK}.txt" 44 | $EXECUTION rmat --rmat_scale=${i} --rmat_edgefactor=${edge_factor} $OPTION --device=$DEVICE --jsondir=./eval/$SUFFIX > ./eval/$SUFFIX/rmat_n${i}_${edge_factor}${MARK}.txt 45 | done 46 | fi 47 | done 48 | 49 | -------------------------------------------------------------------------------- /examples/cc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------ 2 | # Gunrock: Sub-Project Connected Component 3 | # ------------------------------------------------------------------------ 4 | project(cc) 5 | message("-- Project Added: ${PROJECT_NAME}") 6 | include(${CMAKE_SOURCE_DIR}/cmake/SetSubProject.cmake) 7 | 8 | add_test(NAME TEST_CC COMMAND cc market 9 | ${gunrock_INCLUDE_DIRS}/dataset/small/bips98_606.mtx) 10 | set_tests_properties(TEST_CC PROPERTIES FAIL_REGULAR_EXPRESSION "INCORRECT") 11 | 12 | if(GUNROCK_MGPU_TESTS) 13 | add_test(NAME TEST_MGPU_CC COMMAND cc market 14 | ${gunrock_INCLUDE_DIRS}/dataset/small/bips98_606.mtx ${DEVICES}) 15 | set_tests_properties(TEST_CC PROPERTIES FAIL_REGULAR_EXPRESSION "INCORRECT") 16 | endif(GUNROCK_MGPU_TESTS) 17 | -------------------------------------------------------------------------------- /examples/cc/Makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------- 2 | # Gunrock -- Fast and Efficient GPU Graph Library 3 | # ---------------------------------------------------------------- 4 | # This source code is distributed under the terms of LICENSE.TXT 5 | # in the root directory of this source distribution. 6 | # ---------------------------------------------------------------- 7 | 8 | #------------------------------------------------------------------------------- 9 | # (make test) Test driver for ALGO 10 | #------------------------------------------------------------------------------- 11 | 12 | include ../BaseMakefile.mk 13 | 14 | ALGO = cc 15 | test: bin/test_$(ALGO)_$(NVCC_VERSION)_$(ARCH_SUFFIX) 16 | 17 | bin/test_$(ALGO)_$(NVCC_VERSION)_$(ARCH_SUFFIX) : test_$(ALGO).cu $(DEPS) 18 | mkdir -p bin 19 | $(NVCC) $(DEFINES) $(SM_TARGETS) -o bin/test_$(ALGO)_$(NVCC_VERSION)_$(ARCH_SUFFIX) test_$(ALGO).cu $(EXTRA_SOURCE) $(NVCCFLAGS) $(ARCH) $(INC) -O3 20 | 21 | .DEFAULT_GOAL := test 22 | -------------------------------------------------------------------------------- /examples/cc/make_summary.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | g++ -Wall make_summary.cpp -o eval/make_summary -std=c++11 4 | cd eval 5 | 6 | DIRS="$(ls -d *K[48]0*)" 7 | 8 | for i in $DIRS 9 | do 10 | if [ -d $i ] ; 11 | then 12 | #echo $i 13 | ./make_summary $i 14 | fi 15 | done 16 | 17 | cd .. 18 | 19 | -------------------------------------------------------------------------------- /examples/cc/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #get all execution files in ./bin 4 | files=./bin/* 5 | 6 | #split file names into arr 7 | arr=$(echo $files | tr " " "\n") 8 | max_ver_num="$" 9 | exe_file="" 10 | #iterate over all file names to get the largest version number 11 | for x in $arr; 12 | do 13 | output=$(grep -o "[0-9]\.[0-9]" <<< "$x") 14 | if [ "$output" \> "$max_ver_num" ]; then 15 | exe_file=$x 16 | fi 17 | done 18 | 19 | #put OS and Device type here 20 | SUFFIX="GUNROCK_v0-5-0" 21 | 22 | mkdir -p eval/$SUFFIX 23 | 24 | for i in ak2010 belgium_osm coAuthorsDBLP delaunay_n13 delaunay_n21 soc-LiveJournal1 kron_g500-logn21 webbase-1M; 25 | do 26 | echo $exe_file market ../../dataset/large/$i/$i.mtx 27 | $exe_file market ../../dataset/large/$i/$i.mtx > eval/$SUFFIX/$i.$SUFFIX.txt 28 | sleep 1 29 | done 30 | 31 | 32 | -------------------------------------------------------------------------------- /examples/cc/run_real.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | BASEOPTION="--iteration-num=16 --in-sizing=1.1" 4 | BASEFLAG="" 5 | EXECUTION="./bin/test_cc_8.0_x86_64" 6 | DATADIR="/data/gunrock_dataset/large" 7 | 8 | OPTION[0]="" && FLAG[0]=".default" 9 | OPTION[1]=" --undirected" && FLAG[1]=".undir" 10 | 11 | OPTION[8]="" && FLAG[8]=".32bit_SizeT" 12 | OPTION[9]=" --64bit-SizeT" && FLAG[9]=".64bit_SizeT" 13 | #OPTION[10]=" --64bit-VertexId" && FLAG[10]=".64bit_VertexId" 14 | 15 | OPTION[11]="" && FLAG[11]=".DEF" 16 | OPTION[12]=" --traversal-mode=LB" && FLAG[12]=".LB" 17 | OPTION[13]=" --traversal-mode=TWC" && FLAG[13]=".TWC" 18 | OPTION[14]=" --traversal-mode=LB_LIGHT" && FLAG[14]=".LB_LIGHT" 19 | OPTION[15]=" --traversal-mode=ALL_EDGES" && FLAG[15]=".ALL_EDGES" 20 | 21 | NAME[ 0]="soc-twitter-2010" 22 | NAME[ 1]="hollywood-2009" 23 | NAME[ 2]="soc-sinaweibo" 24 | NAME[ 3]="soc-orkut" 25 | NAME[ 4]="soc-LiveJournal1" 26 | NAME[ 5]="uk-2002" 27 | NAME[ 6]="uk-2005" 28 | NAME[ 7]="webbase-2001" 29 | NAME[ 8]="indochina-2004" 30 | NAME[ 9]="arabic-2005" 31 | NAME[10]="europe_osm" 32 | NAME[11]="asia_osm" 33 | NAME[12]="germany_osm" 34 | NAME[13]="road_usa" 35 | NAME[14]="road_central" 36 | 37 | for d in {1..4} 38 | do 39 | SUFFIX="ubuntu14.04_K40cx${d}" 40 | mkdir -p eval/$SUFFIX 41 | DEVICE="0" 42 | for i in {1..8} 43 | do 44 | if [ "$i" -lt "$d" ]; then 45 | DEVICE=$DEVICE",$i" 46 | fi 47 | done 48 | 49 | for o1 in {0..1}; do for o2 in {8..9}; do for o3 in {11..15}; do 50 | 51 | OPTIONS=${BASEOPTION}${OPTION[${o1}]}${OPTION[${o2}]}${OPTION[${o3}]} 52 | FLAGS=${BASEFLAG}${FLAG[${o1}]}${FLAG[${o2}]}${FLAG[${o3}]} 53 | for i in {0..14} 54 | do 55 | echo $EXECUTION market $DATADIR/${NAME[$i]}/${NAME[$i]}.mtx $OPTIONS --device=$DEVICE --jsondir=./eval/$SUFFIX "> ./eval/$SUFFIX/${NAME[$i]}${FLAGS}.txt" 56 | $EXECUTION market $DATADIR/${NAME[$i]}/${NAME[$i]}.mtx $OPTIONS --device=$DEVICE --jsondir=./eval/$SUFFIX > ./eval/$SUFFIX/${NAME[$i]}${FLAGS}.txt 57 | sleep 1 58 | done 59 | done; done; done 60 | done 61 | 62 | -------------------------------------------------------------------------------- /examples/cc/run_rmat.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | OPTION="--in-sizing=1.1 --iteration-num=10 --partition-method=random --quick" 4 | MARK=".32bitSizeT" 5 | EXECUTION="./bin/test_cc_7.5_x86_64" 6 | DATADIR="../../dataset/large" 7 | 8 | # cd ~/Projects/gunrock_dev/gunrock/tests/cc 9 | 10 | for d in {2..3} 11 | do 12 | SUFFIX="ubuntu14_04.k40cx${d}.rand" 13 | mkdir -p eval/$SUFFIX 14 | DEVICE="0" 15 | for i in {1..8} 16 | do 17 | if [ "$i" -lt "$d" ]; then 18 | DEVICE=$DEVICE",$i" 19 | fi 20 | done 21 | 22 | for i in {20..25} 23 | do 24 | max_j=$(echo "29-${i}" | bc) 25 | for j in {4..9} 26 | do 27 | edge_factor=$(echo "2^${j}" | bc) 28 | if [ "$j" -le $((29-${i})) ]; then 29 | echo $EXECUTION grmat --rmat_scale=${i} --rmat_edgefactor=${edge_factor} $OPTION --device=$DEVICE --jsondir=./eval/$SUFFIX "> ./eval/$SUFFIX/rmat_n${i}_${edge_factor}${MARK}.txt" 30 | $EXECUTION grmat --rmat_scale=${i} --rmat_edgefactor=${edge_factor} $OPTION --device=$DEVICE --jsondir=./eval/$SUFFIX > ./eval/$SUFFIX/rmat_n${i}_${edge_factor}${MARK}.txt 31 | sleep 1 32 | fi 33 | done 34 | done 35 | 36 | if [ "$d" -eq "1" ]; then 37 | for i in {20..25} 38 | do 39 | edge_factor=$(echo "2^( 29 - ${i} )" | bc) 40 | echo $EXECUTION rmat --rmat_scale=${i} --rmat_edgefactor=${edge_factor} $OPTION --device=$DEVICE --jsondir=./eval/$SUFFIX "> ./eval/$SUFFIX/rmat_n${i}_${edge_factor}${MARK}.txt" 41 | $EXECUTION rmat --rmat_scale=${i} --rmat_edgefactor=${edge_factor} $OPTION --device=$DEVICE --jsondir=./eval/$SUFFIX > ./eval/$SUFFIX/rmat_n${i}_${edge_factor}${MARK}.txt 42 | done 43 | fi 44 | done 45 | 46 | -------------------------------------------------------------------------------- /examples/color/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------ 2 | # Gunrock: Sub-Project Graph Coloring 3 | # ------------------------------------------------------------------------ 4 | project(color) 5 | message("-- Project Added: ${PROJECT_NAME}") 6 | include(${CMAKE_SOURCE_DIR}/cmake/SetSubProject.cmake) 7 | 8 | add_test(NAME TEST_COLOR COMMAND color market 9 | ${gunrock_INCLUDE_DIRS}/dataset/small/chesapeake.mtx --undirected) 10 | set_tests_properties(TEST_COLOR PROPERTIES PASS_REGULAR_EXPRESSION "0 errors occurred.") 11 | -------------------------------------------------------------------------------- /examples/color/Makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------- 2 | # Gunrock -- Fast and Efficient GPU Graph Library 3 | # ---------------------------------------------------------------- 4 | # This source code is distributed under the terms of LICENSE.TXT 5 | # in the root directory of this source distribution. 6 | # ---------------------------------------------------------------- 7 | 8 | #------------------------------------------------------------------------------- 9 | # (make test) Test driver for ALGO 10 | #------------------------------------------------------------------------------- 11 | 12 | include ../BaseMakefile.mk 13 | ALGO = color 14 | EXEC = bin/test_$(ALGO)_$(NVCC_VERSION)_$(ARCH_SUFFIX) 15 | NVCCFLAGS += -lcurand 16 | 17 | test: $(EXEC) 18 | 19 | $(EXEC) : test_$(ALGO).cu $(DEPS) 20 | mkdir -p bin 21 | $(NVCC) $(DEFINES) $(SM_TARGETS) -o $(EXEC) test_$(ALGO).cu $(EXTRA_SOURCE) $(NVCCFLAGS) $(ARCH) $(INC) -O3 22 | 23 | a : test_$(ALGO).cu $(DEPS) 24 | mkdir -p bin 25 | rm -f $(EXEC) 26 | $(NVCC) $(DEFINES) $(SM_TARGETS) -o $(EXEC) test_$(ALGO).cu $(EXTRA_SOURCE) $(NVCCFLAGS) $(ARCH) $(INC) -O3 > a.txt 2>&1 || true 27 | grep rror: a.txt; grep arn a.txt 28 | 29 | .DEFAULT_GOAL := test 30 | -------------------------------------------------------------------------------- /examples/color/rgg.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # get all execution files in ./bin 4 | files=(./bin/*) 5 | # split file names into arr 6 | arr=$(echo $files | tr " " "\n") 7 | max_ver_num="$" 8 | 9 | exe_file=${arr[0]} 10 | # iterate over all file names to get the largest version number 11 | for x in $arr 12 | do 13 | output=$(grep -o "[0-9]\.[0-9]" <<<"$x") 14 | if [ "$output" \> "$max_ver_num" ]; then 15 | exe_file=$x 16 | fi 17 | done 18 | 19 | EXECUTION=$exe_file 20 | 21 | # addresses 22 | DATADIR="/data/gunrock_dataset/large" 23 | NAME[0]="rgg_n_2_15_s0" 24 | NAME[1]="rgg_n_2_16_s0" 25 | NAME[2]="rgg_n_2_17_s0" 26 | NAME[3]="rgg_n_2_18_s0" 27 | NAME[4]="rgg_n_2_19_s0" 28 | NAME[5]="rgg_n_2_20_s0" 29 | NAME[6]="rgg_n_2_21_s0" 30 | NAME[7]="rgg_n_2_22_s0" 31 | NAME[8]="rgg_n_2_23_s0" 32 | NAME[9]="rgg_n_2_24_s0" 33 | 34 | OPTIONS="--JPL=true --test-run=true --undirected --tag=Size-vs-Colors-Performance" 35 | 36 | for i in {0..9} 37 | do 38 | SUFFIX="K40C_Ubunru_16-04" 39 | mkdir -p eval/$SUFFIX 40 | DEVICE="0" 41 | 42 | echo $EXECUTION market $DATADIR/${NAME[$i]}/${NAME[$i]}.mtx $OPTIONS --device=$DEVICE --jsondir=./eval/$SUFFIX "> ./eval/$SUFFIX/${NAME[$i]}.txt" 43 | $EXECUTION market $DATADIR/${NAME[$i]}/${NAME[$i]}.mtx $OPTIONS --device=$DEVICE --jsondir=./eval/$SUFFIX > ./eval/$SUFFIX/${NAME[$i]}.txt 44 | sleep 1 45 | done 46 | -------------------------------------------------------------------------------- /examples/core/Makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------- 2 | # Gunrock -- Fast and Efficient GPU Graph Library 3 | # ---------------------------------------------------------------- 4 | # This source code is distributed under the terms of LICENSE.TXT 5 | # in the root directory of this source distribution. 6 | # ---------------------------------------------------------------- 7 | 8 | #------------------------------------------------------------------------------- 9 | # (make test) Test driver for Gunrock's core 10 | #------------------------------------------------------------------------------- 11 | 12 | include ../BaseMakefile.mk 13 | ALGO = core 14 | EXEC = bin/test_$(ALGO)_$(NVCC_VERSION)_$(ARCH_SUFFIX) 15 | 16 | test: $(EXEC) 17 | 18 | $(EXEC) : test_$(ALGO).cu $(DEPS) 19 | mkdir -p bin 20 | $(NVCC) -w $(DEFINES) $(SM_TARGETS) -o $(EXEC) test_$(ALGO).cu $(EXTRA_SOURCE) $(NVCCFLAGS) $(ARCH) $(INC) -O3 21 | 22 | a : test_$(ALGO).cu $(DEPS) 23 | mkdir -p bin 24 | rm -f $(EXEC) 25 | $(NVCC) $(DEFINES) $(SM_TARGETS) -o $(EXEC) test_$(ALGO).cu $(EXTRA_SOURCE) $(NVCCFLAGS) $(ARCH) $(INC) -O3 > a.txt 2>&1 || true 26 | grep rror: a.txt; grep arn a.txt 27 | 28 | .DEFAULT_GOAL := test 29 | -------------------------------------------------------------------------------- /examples/core/test_core.cu: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------- 2 | // Gunrock -- Fast and Efficient GPU Graph Library 3 | // ---------------------------------------------------------------- 4 | // This source code is distributed under the terms of LICENSE.TXT 5 | // in the root directory of this source distribution. 6 | // ---------------------------------------------------------------- 7 | 8 | /** 9 | * @file 10 | * test_core.cu 11 | * 12 | * @brief Test driver for some of the core functionality within gunrock 13 | * includes things like, operators, searches, device intrinsics, etc.. 14 | */ 15 | #include 16 | #include 17 | #include 18 | 19 | int main() { 20 | std::cout << "--- Testing RepeatFor ---" << std::endl; 21 | RepeatForTest(); 22 | 23 | std::cout << "--- Testing SegReduce ---" << std::endl; 24 | SegReduceTest(); 25 | 26 | std::cout << "--- Testing BinarySearch ---" << std::endl; 27 | BinarySearchTest(); 28 | 29 | return 0; 30 | } 31 | -------------------------------------------------------------------------------- /examples/gcn/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------ 2 | # Gunrock: Sub-Project PageRank 3 | # ------------------------------------------------------------------------ 4 | project(gcn) 5 | message("-- Project Added: ${PROJECT_NAME}") 6 | include(${CMAKE_SOURCE_DIR}/cmake/SetSubProject.cmake) 7 | 8 | add_test(NAME TEST_PR COMMAND pr market 9 | ${gunrock_INCLUDE_DIRS}/dataset/small/bips98_606.mtx --normalized --compensate --undirected) 10 | set_tests_properties(TEST_PR PROPERTIES FAIL_REGULAR_EXPRESSION "INCORRECT") 11 | 12 | if(GUNROCK_MGPU_TESTS) 13 | add_test(NAME TEST_MGPU_PR COMMAND pr market 14 | ${gunrock_INCLUDE_DIRS}/dataset/small/bips98_606.mtx ${DEVICES} 15 | --normalized --compensate --undirected) 16 | set_tests_properties(TEST_MGPU_PR PROPERTIES FAIL_REGULAR_EXPRESSION "INCORRECT") 17 | endif(GUNROCK_MGPU_TESTS) 18 | -------------------------------------------------------------------------------- /examples/geo/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------ 2 | # Gunrock: Sub-Project Geolocation 3 | # ------------------------------------------------------------------------ 4 | project(geo) 5 | message("-- Project Added: ${PROJECT_NAME}") 6 | include(${CMAKE_SOURCE_DIR}/cmake/SetSubProject.cmake) 7 | 8 | add_test(NAME TEST_GEO COMMAND geo market 9 | ${gunrock_INCLUDE_DIRS}/dataset/small/chesapeake.mtx 10 | --labels-file=${gunrock_INCLUDE_DIRS}/examples/geo/_data/samples/sample.labels) 11 | set_tests_properties(TEST_GEO PROPERTIES PASS_REGULAR_EXPRESSION "0 errors occurred") 12 | -------------------------------------------------------------------------------- /examples/geo/Makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------- 2 | # Gunrock -- Fast and Efficient GPU Graph Library 3 | # ---------------------------------------------------------------- 4 | # This source code is distributed under the terms of LICENSE.TXT 5 | # in the root directory of this source distribution. 6 | # ---------------------------------------------------------------- 7 | 8 | #------------------------------------------------------------------------------- 9 | # (make test) Test driver for ALGO 10 | #------------------------------------------------------------------------------- 11 | 12 | include ../BaseMakefile.mk 13 | ALGO = geo 14 | EXEC = bin/test_$(ALGO)_$(NVCC_VERSION)_$(ARCH_SUFFIX) 15 | 16 | test: $(EXEC) 17 | 18 | $(EXEC) : test_$(ALGO).cu $(DEPS) 19 | mkdir -p bin 20 | $(NVCC) -w $(DEFINES) $(SM_TARGETS) -o $(EXEC) test_$(ALGO).cu $(EXTRA_SOURCE) $(NVCCFLAGS) $(ARCH) $(INC) -O3 21 | 22 | a : test_$(ALGO).cu $(DEPS) 23 | mkdir -p bin 24 | rm -f $(EXEC) 25 | $(NVCC) $(DEFINES) $(SM_TARGETS) -o $(EXEC) test_$(ALGO).cu $(EXTRA_SOURCE) $(NVCCFLAGS) $(ARCH) $(INC) -O3 > a.txt 2>&1 || true 26 | grep rror: a.txt; grep arn a.txt 27 | 28 | .DEFAULT_GOAL := test 29 | -------------------------------------------------------------------------------- /examples/geo/_data/sample/locations.labels: -------------------------------------------------------------------------------- 1 | % Node Label Label(optional) 2 | 39 2 2 3 | 1 37.7449063493 -122.009432884 4 | 2 37.8668048274 -122.257973253 5 | 4 37.869112506 -122.25910604 6 | 6 37.6431858915 -121.816156983 7 | 11 37.8652346572 -122.250634008 8 | 19 38.2043433677 -114.300341275 9 | 21 36.7582225593 -118.167916598 10 | 22 33.9774659389 -114.886512278 11 | 30 39.2598884729 -106.804662071 12 | 31 37.880443573 -122.230147039 13 | 39 9.4276164485 -110.640705659 14 | -------------------------------------------------------------------------------- /examples/geo/_data/sample/sample.labels: -------------------------------------------------------------------------------- 1 | % Node Label Label(optional) 2 | 39 2 2 3 | 1 37.7449063493 -160.009432884 4 | 2 37.8668048274 -130.797325311 5 | 3 63.6431858915 -112.816156983 6 | 4 51.6431858915 -172.816156983 7 | 5 21.8691125061 -133.259106041 8 | 6 55.6431858915 -177.816156983 9 | 7 63.8652346572 -131.250634008 10 | 8 61.2043433677 -114.300341275 11 | 9 12 | 10 13 | 11 14 | 12 15 | 13 37.8691125062 -122.259106043 16 | 14 30.8691125062 -100.259106043 17 | 15 17.1211125062 -112.259106043 18 | 16 19 | 17 -37.8691125062 122.259106043 20 | 18 60.2043433677 -110.300341275 21 | 19 22 | 20 23 | 21 86.8804435732 -170.640705659 24 | 22 37.8804435732 -110.640705659 25 | 23 26 | 24 27 | 25 38.2043433677 -114.300341275 28 | 26 29 | 27 30 | 28 61.2043433677 -114.300341275 31 | 29 32 | 30 37.8691125062 -122.259106043 33 | 31 37.6431858915 -121.816156983 34 | 32 37.8652346572 -122.250634008 35 | 33 38.2043433677 -114.300341275 36 | 34 36.7582225593 -118.167916598 37 | 35 33.9774659389 -114.886512278 38 | 36 39.2598884729 -106.804662071 39 | 37 37.8804435732 -122.230147039 40 | 38 41 | 39 9.42761644853 -110.640705659 42 | -------------------------------------------------------------------------------- /examples/geo/generate-data.py: -------------------------------------------------------------------------------- 1 | import pandas as pd 2 | import numpy as np 3 | from scipy import sparse 4 | from scipy.io import mmwrite 5 | 6 | # Load data 7 | graph = pd.read_csv('./graph', header=None, sep='\t') 8 | user_locations = pd.read_csv('./user_locations', header=None, sep='\t') 9 | 10 | # Figure out how to map nodes to sequential integers (0-based) 11 | unodes = np.unique(np.hstack([ 12 | graph[0].values, 13 | graph[1].values, 14 | ])) 15 | num_nodes = unodes.shape[0] 16 | 17 | lookup = dict(zip(unodes, range(len(unodes)))) 18 | 19 | # Convert graph nodes to sequential integers 20 | graph['src'] = graph[0].apply(lookup.get) 21 | graph['dst'] = graph[1].apply(lookup.get) 22 | graph = graph.sort_values(['src', 'dst']).reset_index(drop=True) 23 | 24 | # Convert user_location is to sequential integers 25 | user_locations = user_locations[user_locations[0].isin(unodes)] 26 | user_locations[0] = user_locations[0].apply(lookup.get) 27 | user_locations = user_locations.sort_values(0).reset_index(drop=True) 28 | 29 | # Convert to sparse matrix 30 | row = graph.src.values 31 | col = graph.dst.values 32 | data = graph[2].values 33 | m = sparse.csr_matrix((data, (row, col)), shape=(num_nodes, num_nodes)) 34 | 35 | # Write to .mtx format 36 | mmwrite('instagram', m) 37 | 38 | user_locations[0] = user_locations[0].astype(int) 39 | del user_locations[1] 40 | del user_locations[4] 41 | user_locations.to_csv('./instagram.labels', header=None, sep=' ', index=False) 42 | -------------------------------------------------------------------------------- /examples/geo/run-hive.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #get all execution files in ./bin 4 | files=(./bin/*) 5 | #split file names into arr 6 | arr=$(echo $files | tr " " "\n") 7 | max_ver_num="$" 8 | 9 | exe_file=${arr[0]} 10 | #iterate over all file names to get the largest version number 11 | for x in $arr 12 | do 13 | output=$(grep -o "[0-9]\.[0-9]" <<<"$x") 14 | if [ "$output" \> "$max_ver_num" ]; then 15 | exe_file=$x 16 | fi 17 | done 18 | 19 | DEFAULT="--device=0 --geo-complete=false" 20 | 21 | OPTION[0]=${DEFAULT}" --geo-iter=3 --spatial-iter=1000" 22 | OPTION[1]=${DEFAULT}" --geo-iter=3 --spatial-iter=1000" 23 | OPTION[2]=${DEFAULT}" --geo-iter=3 --spatial-iter=1000" 24 | OPTION[3]=${DEFAULT}" --geo-iter=3 --spatial-iter=1000 --quick --quiet" 25 | 26 | EXCUTION=$exe_file 27 | DATADIR="./_data/" 28 | 29 | NAME[0]="sample" 30 | NAME[1]="instagram-sample" 31 | NAME[2]="instagram" 32 | NAME[3]="twitter" # runs out of memory 33 | 34 | for k in {0..2} 35 | do 36 | SUFFIX="ubuntu16.04_TitanV" 37 | mkdir -p eval/$SUFFIX 38 | 39 | echo $EXCUTION market $DATADIR/${NAME[$k]}/graph/${NAME[$k]}.mtx --labels-file=$DATADIR/${NAME[$k]}/graph/${NAME[$k]}.labels ${OPTION[$k]} "> eval/$SUFFIX/${NAME[$k]}_$SUFFIX.txt" 40 | $EXCUTION market $DATADIR/${NAME[$k]}/graph/${NAME[$k]}.mtx --labels-file=$DATADIR/${NAME[$k]}/graph/${NAME[$k]}.labels ${OPTION[$k]} > eval/$SUFFIX/${NAME[$k]}_$SUFFIX.txt 41 | sleep 1 42 | done 43 | 44 | -------------------------------------------------------------------------------- /examples/geo/run.sh: -------------------------------------------------------------------------------- 1 | ./bin/test_geo_10.0_x86_64 --graph-type=market --graph-file=./_data/sample/geolocation.mtx --labels-file=./_data/sample/locations.labels --geo-iter=2 --geo-complete=false 2 | -------------------------------------------------------------------------------- /examples/gtc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------ 2 | # Gunrock: Sub-Project GPU TECH CONF. TUTORIAL (SSSP) 3 | # ------------------------------------------------------------------------ 4 | project(gtc) 5 | message("-- Project Added: ${PROJECT_NAME}") 6 | include(${CMAKE_SOURCE_DIR}/cmake/SetSubProject.cmake) 7 | -------------------------------------------------------------------------------- /examples/gtc/Makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------- 2 | # Gunrock -- Fast and Efficient GPU Graph Library 3 | # ---------------------------------------------------------------- 4 | # This source code is distributed under the terms of LICENSE.TXT 5 | # in the root directory of this source distribution. 6 | # ---------------------------------------------------------------- 7 | 8 | #------------------------------------------------------------------------------- 9 | # (make test) Test driver for ALGO 10 | #------------------------------------------------------------------------------- 11 | 12 | include ../BaseMakefile.mk 13 | ALGO = gtc 14 | EXEC = bin/test_$(ALGO)_$(NVCC_VERSION)_$(ARCH_SUFFIX) 15 | 16 | test: $(EXEC) 17 | 18 | $(EXEC) : test_$(ALGO).cu $(DEPS) 19 | mkdir -p bin 20 | $(NVCC) $(DEFINES) $(SM_TARGETS) -o $(EXEC) test_$(ALGO).cu $(EXTRA_SOURCE) $(NVCCFLAGS) $(ARCH) $(INC) -O3 21 | 22 | a : test_$(ALGO).cu $(DEPS) 23 | mkdir -p bin 24 | rm -f $(EXEC) 25 | $(NVCC) $(DEFINES) $(SM_TARGETS) -o $(EXEC) test_$(ALGO).cu $(EXTRA_SOURCE) $(NVCCFLAGS) $(ARCH) $(INC) -O3 > a.txt 2>&1 || true 26 | grep rror: a.txt; grep arn a.txt 27 | 28 | .DEFAULT_GOAL := test 29 | -------------------------------------------------------------------------------- /examples/gtf/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------ 2 | # Gunrock: Sub-Project Graph Trend Filtering 3 | # ------------------------------------------------------------------------ 4 | project(gtf) 5 | message("-- Project Added: ${PROJECT_NAME}") 6 | include(${CMAKE_SOURCE_DIR}/cmake/SetSubProject.cmake) 7 | -------------------------------------------------------------------------------- /examples/gtf/Makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------- 2 | # Gunrock -- Fast and Efficient GPU Graph Library 3 | # ---------------------------------------------------------------- 4 | # This source code is distributed under the terms of LICENSE.TXT 5 | # in the root directory of this source distribution. 6 | # ---------------------------------------------------------------- 7 | 8 | #------------------------------------------------------------------------------- 9 | # (make test) Test driver for ALGO 10 | #------------------------------------------------------------------------------- 11 | 12 | include ../BaseMakefile.mk 13 | ALGO = gtf 14 | EXEC = bin/test_$(ALGO)_$(NVCC_VERSION)_$(ARCH_SUFFIX) 15 | 16 | test: $(EXEC) 17 | 18 | $(EXEC) : test_$(ALGO).cu $(DEPS) 19 | mkdir -p bin 20 | $(NVCC) $(DEFINES) $(SM_TARGETS) -o $(EXEC) test_$(ALGO).cu $(EXTRA_SOURCE) $(NVCCFLAGS) $(ARCH) $(INC) -O3 21 | 22 | a : test_$(ALGO).cu $(DEPS) 23 | mkdir -p bin 24 | rm -f $(EXEC) 25 | $(NVCC) $(DEFINES) $(SM_TARGETS) -o $(EXEC) test_$(ALGO).cu $(EXTRA_SOURCE) $(NVCCFLAGS) $(ARCH) $(INC) -O3 > a.txt 2>&1 || true 26 | grep rror: a.txt; grep arn a.txt 27 | 28 | .DEFAULT_GOAL := test 29 | -------------------------------------------------------------------------------- /examples/gtf/_data/agnes.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | np.set_printoptions(threshold=np.nan) 3 | nodes = np.loadtxt('n') 4 | edges = np.loadtxt('e') 5 | print(nodes, edges) 6 | 7 | lambda1 = 6 8 | 9 | num_nodes, num_edges = edges[0, :].astype(np.int).tolist() 10 | edges = edges[1:] 11 | 12 | lambda1 = np.ones((num_edges, 1), dtype='float')*lambda1 13 | 14 | print(lambda1.shape, edges.shape) 15 | edges = np.concatenate([edges, lambda1], 1) 16 | print(edges) 17 | 18 | 19 | index = np.array([i for i in range(0, num_nodes)]) 20 | source = np.zeros((num_nodes, 3)) 21 | sink = np.zeros((num_nodes, 3)) 22 | 23 | source[:, 0] = num_nodes # from source: index num_nodes+1 24 | source[:, 1] = index # to all nodes (exclusing sink) 25 | source[:, 2] += (nodes > 0)*nodes 26 | 27 | sink[:, 0] = index # from all nodes 28 | sink[:, 1] = num_nodes+1 # to sink (excluding source) 29 | sink[:, 2] -= (nodes < 0)*nodes 30 | 31 | temp1 = np.zeros((num_nodes,3)) #duplicate for later usage, these are all 0 32 | temp1[:,0] = index # connect from all nodes 33 | temp1[:,1] = num_nodes # to source 34 | 35 | temp2 = np.zeros((num_nodes,3)) #duplicate for later usage, these are all 0 36 | temp2[:,0] = num_nodes+1 # connect from sink 37 | temp2[:,1] = index # to all nodes 38 | 39 | 40 | edges_list = np.concatenate([edges, source, sink, temp1, temp2], 0).tolist() 41 | edges = sorted(edges_list,key=lambda x: (x[0],x[1])) 42 | 43 | with open('std_added.mtx', 'w') as f: 44 | f.write("%d %d %d\n" % (num_nodes+2,num_nodes+2,num_edges+4*num_nodes)) 45 | for (u,v,w) in edges: 46 | f.write("%d %d %.3f\n" % (u+1, v+1, w)) 47 | -------------------------------------------------------------------------------- /examples/gtf/_data/generate_graph.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | np.set_printoptions(threshold=np.nan) 3 | nodes = np.loadtxt('./n') 4 | edges = np.loadtxt('./e') 5 | 6 | lambda1 = 6 7 | 8 | num_nodes, num_edges = edges[0, :].astype(np.int).tolist() 9 | num_edges = 2*num_edges 10 | edges = edges[1:] 11 | 12 | rows, cols = edges.transpose(1,0).tolist() 13 | 14 | rows_tem = rows + cols 15 | cols = cols + rows 16 | rows = rows_tem 17 | a = np.stack([rows, cols], axis=1).tolist() 18 | a = sorted(a,key=lambda x: (x[0],x[1])) 19 | edges = np.stack([rows, cols], axis=1) 20 | 21 | lambda1 = np.ones((num_edges, 1), dtype='float')*lambda1 22 | 23 | print(lambda1.shape, edges.shape) 24 | edges = np.concatenate([edges, lambda1], 1) 25 | 26 | 27 | index = np.array([i for i in range(0, num_nodes)]) 28 | source = np.zeros((num_nodes, 3)) 29 | sink = np.zeros((num_nodes, 3)) 30 | 31 | source[:, 0] = num_nodes # from source: index num_nodes+1 32 | source[:, 1] = index # to all nodes (exclusing sink) 33 | source[:, 2] += (nodes > 0)*nodes 34 | 35 | sink[:, 0] = index # from all nodes 36 | sink[:, 1] = num_nodes+1 # to sink (excluding source) 37 | sink[:, 2] -= (nodes < 0)*nodes 38 | 39 | temp1 = np.zeros((num_nodes,3)) #duplicate for later usage, these are all 0 40 | temp1[:,0] = index # connect from all nodes 41 | temp1[:,1] = num_nodes # to source 42 | 43 | temp2 = np.zeros((num_nodes,3)) #duplicate for later usage, these are all 0 44 | temp2[:,0] = num_nodes+1 # connect from sink 45 | temp2[:,1] = index # to all nodes 46 | 47 | 48 | edges_list = np.concatenate([edges, source, sink, temp1, temp2], 0).tolist() 49 | edges = sorted(edges_list,key=lambda x: (x[0],x[1])) 50 | 51 | with open('./std_added.mtx', 'w') as f: 52 | f.write("%d %d %d\n" % (num_nodes+2,num_nodes+2,num_edges+4*num_nodes)) 53 | for (u,v,w) in edges: 54 | f.write("%d %d %.3f\n" % (u+1, v+1, w)) 55 | -------------------------------------------------------------------------------- /examples/gtf/_data/gengraph.py: -------------------------------------------------------------------------------- 1 | from igraph import * 2 | import numpy as np 3 | g=Graph() 4 | n = 1000 #nodes 5 | m = 2000 # edges 6 | 7 | a = Graph.Erdos_Renyi(n=n, m=m, directed=False) 8 | rows, cols = zip(*a.get_edgelist()) 9 | 10 | c = np.stack([rows, cols], axis=1).tolist() 11 | c = sorted(c,key=lambda x: (x[0],x[1])) 12 | 13 | with open('e_mine', 'w') as f: # not gunrock usage edge file 14 | f.write("%d %d\n" % (n,m)) 15 | for (u,v) in c: 16 | f.write("%d %d\n" % (u, v)) 17 | 18 | rows_tem = rows + cols 19 | cols = cols + rows 20 | rows = rows_tem 21 | a = np.stack([rows, cols], axis=1).tolist() 22 | a = sorted(a,key=lambda x: (x[0],x[1])) 23 | 24 | b = np.random.uniform(-15, 15, size=(n)).tolist() 25 | with open('n', 'w') as f: 26 | for item in b: 27 | f.write("%.3f\n" % item) 28 | 29 | with open('e', 'w') as f: # gunrock usage edge file, needs to call agnes.py too. 30 | f.write("%d %d\n" % (n,m*2)) 31 | for (u,v) in a: 32 | f.write("%d %d\n" % (u, v)) 33 | -------------------------------------------------------------------------------- /examples/hello/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------ 2 | # Gunrock: Sub-Project Hello World Tutorial (Gunrock) 3 | # ------------------------------------------------------------------------ 4 | project(hello) 5 | message("-- Project Added: ${PROJECT_NAME}") 6 | include(${CMAKE_SOURCE_DIR}/cmake/SetSubProject.cmake) 7 | -------------------------------------------------------------------------------- /examples/hello/Makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------- 2 | # Gunrock -- Fast and Efficient GPU Graph Library 3 | # ---------------------------------------------------------------- 4 | # This source code is distributed under the terms of LICENSE.TXT 5 | # in the root directory of this source distribution. 6 | # ---------------------------------------------------------------- 7 | 8 | #------------------------------------------------------------------------------- 9 | # (make test) Test driver for ALGO 10 | #------------------------------------------------------------------------------- 11 | 12 | include ../BaseMakefile.mk 13 | ALGO = hello 14 | EXEC = bin/test_$(ALGO)_$(NVCC_VERSION)_$(ARCH_SUFFIX) 15 | 16 | test: $(EXEC) 17 | 18 | $(EXEC) : test_$(ALGO).cu $(DEPS) 19 | mkdir -p bin 20 | $(NVCC) -w $(DEFINES) $(SM_TARGETS) -o $(EXEC) test_$(ALGO).cu $(EXTRA_SOURCE) $(NVCCFLAGS) $(ARCH) $(INC) -O3 21 | 22 | a : test_$(ALGO).cu $(DEPS) 23 | mkdir -p bin 24 | rm -f $(EXEC) 25 | $(NVCC) $(DEFINES) $(SM_TARGETS) -o $(EXEC) test_$(ALGO).cu $(EXTRA_SOURCE) $(NVCCFLAGS) $(ARCH) $(INC) -O3 > a.txt 2>&1 || true 26 | grep rror: a.txt; grep arn a.txt 27 | 28 | .DEFAULT_GOAL := test 29 | -------------------------------------------------------------------------------- /examples/hits/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------ 2 | # Gunrock: Sub-Project HITS 3 | # ------------------------------------------------------------------------ 4 | project(hits) 5 | message("-- Project Added: ${PROJECT_NAME}") 6 | include(${CMAKE_SOURCE_DIR}/cmake/SetSubProject.cmake) 7 | 8 | add_test(NAME TEST_HITS COMMAND hits market 9 | ${gunrock_INCLUDE_DIRS}/dataset/small/bips98_606.mtx) 10 | set_tests_properties(TEST_HITS PROPERTIES FAIL_REGULAR_EXPRESSION "INCORRECT") 11 | -------------------------------------------------------------------------------- /examples/hits/Makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------- 2 | # Gunrock -- Fast and Efficient GPU Graph Library 3 | # ---------------------------------------------------------------- 4 | # This source code is distributed under the terms of LICENSE.TXT 5 | # in the root directory of this source distribution. 6 | # ---------------------------------------------------------------- 7 | 8 | #------------------------------------------------------------------------------- 9 | # (make test) Test driver for ALGO 10 | #------------------------------------------------------------------------------- 11 | 12 | include ../BaseMakefile.mk 13 | ALGO = hits 14 | EXEC = bin/test_$(ALGO)_$(NVCC_VERSION)_$(ARCH_SUFFIX) 15 | NVCCFLAGS += -lcurand 16 | 17 | test: $(EXEC) 18 | 19 | $(EXEC) : test_$(ALGO).cu $(DEPS) 20 | mkdir -p bin 21 | $(NVCC) $(DEFINES) $(SM_TARGETS) -o $(EXEC) test_$(ALGO).cu $(EXTRA_SOURCE) $(NVCCFLAGS) $(ARCH) $(INC) -O3 22 | 23 | a : test_$(ALGO).cu $(DEPS) 24 | mkdir -p bin 25 | rm -f $(EXEC) 26 | $(NVCC) $(DEFINES) $(SM_TARGETS) -o $(EXEC) test_$(ALGO).cu $(EXTRA_SOURCE) $(NVCCFLAGS) $(ARCH) $(INC) -O3 > a.txt 2>&1 || true 27 | grep rror: a.txt; grep arn a.txt 28 | 29 | .DEFAULT_GOAL := test 30 | -------------------------------------------------------------------------------- /examples/hits/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | OPTION[0]="--max-iter=100 --tol=0.000001" 4 | 5 | MARK[0]="" 6 | 7 | #get all execution files in ./bin 8 | files=(./bin/*) 9 | #split file names into arr 10 | arr=$(echo $files | tr " " "\n") 11 | max_ver_num="$" 12 | exe_file=${arr[0]} 13 | #iterate over all file names to get the largest version number 14 | for x in $arr 15 | do 16 | output=$(grep -o "[0-9]\.[0-9]" <<<"$x") 17 | if [ "$output" \> "$max_ver_num" ]; then 18 | exe_file=$x 19 | fi 20 | done 21 | 22 | #put OS and Device type here 23 | SUFFIX="ubuntu16.04_GTX1060" 24 | EXECUTION=$exe_file 25 | DATADIR="../../dataset/small" 26 | 27 | mkdir -p eval/$SUFFIX 28 | 29 | for i in test_hits test_pr chesapeake 30 | do 31 | for j in 0 32 | do 33 | echo $EXECUTION market $DATADIR/$i.mtx ${OPTION[$j]} "> eval/$SUFFIX/$i.$SUFFIX${MARK[$j]}.txt" 34 | $EXECUTION market $DATADIR/$i.mtx ${OPTION[$j]} > eval/$SUFFIX/$i.$SUFFIX${MARK[$j]}.txt 35 | sleep 1 36 | done 37 | done 38 | -------------------------------------------------------------------------------- /examples/knn/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------ 2 | # Gunrock: Sub-Project k-Nearest Neighbor (& Shared Nearest Neighbor) 3 | # ------------------------------------------------------------------------ 4 | project(knn) 5 | message("-- Project Added: ${PROJECT_NAME}") 6 | include(${CMAKE_SOURCE_DIR}/cmake/SetSubProject.cmake) 7 | 8 | add_test(NAME TEST_KNN COMMAND knn market 9 | ${gunrock_INCLUDE_DIRS}/dataset/small/chesapeake.mtx --k=5) 10 | set_tests_properties(TEST_KNN PROPERTIES PASS_REGULAR_EXPRESSION "PASSED KNN") 11 | -------------------------------------------------------------------------------- /examples/knn/Makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------- 2 | # Gunrock -- Fast and Efficient GPU Graph Library 3 | # ---------------------------------------------------------------- 4 | # This source code is distributed under the terms of LICENSE.TXT 5 | # in the root directory of this source distribution. 6 | # ---------------------------------------------------------------- 7 | 8 | #------------------------------------------------------------------------------- 9 | # (make test) Test driver for KNN 10 | #------------------------------------------------------------------------------- 11 | 12 | include ../BaseMakefile.mk 13 | ALGO = knn 14 | EXEC = bin/test_$(ALGO)_$(NVCC_VERSION)_$(ARCH_SUFFIX) 15 | 16 | test: $(EXEC) 17 | 18 | $(EXEC) : test_$(ALGO).cu $(DEPS) 19 | mkdir -p bin 20 | $(NVCC) -w $(DEFINES) $(SM_TARGETS) -o $(EXEC) test_$(ALGO).cu $(EXTRA_SOURCE) $(NVCCFLAGS) $(ARCH) $(INC) -O3 21 | 22 | a : test_$(ALGO).cu $(DEPS) 23 | mkdir -p bin 24 | rm -f $(EXEC) 25 | $(NVCC) $(DEFINES) $(SM_TARGETS) -o $(EXEC) test_$(ALGO).cu $(EXTRA_SOURCE) $(NVCCFLAGS) $(ARCH) $(INC) -O3 > a.txt 2>&1 || true 26 | grep rror: a.txt; grep arn a.txt 27 | 28 | .DEFAULT_GOAL := test 29 | -------------------------------------------------------------------------------- /examples/knn/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # get all execution files in ./bin 4 | files=(./bin/*) 5 | # split file names into arr 6 | arr=$(echo $files | tr " " "\n") 7 | max_ver_num="$" 8 | 9 | exe_file=${arr[0]} 10 | # iterate over all file names to get the largest version number 11 | for x in $arr 12 | do 13 | output=$(grep -o "[0-9]\.[0-9]" <<<"$x") 14 | if [ "$output" \> "$max_ver_num" ]; then 15 | exe_file=$x 16 | fi 17 | done 18 | 19 | EXECUTION=$exe_file 20 | 21 | # addresses 22 | DATADIR="/data/gunrock_dataset/large" 23 | 24 | # graphs 25 | NAME[0]="soc-LiveJournal1" && K[0]="10" && EPS[0]="5" && MINPTS[0]="7" 26 | NAME[1]="soc-orkut" && K[1]="10" && EPS[1]="5" && MINPTS[1]="7" 27 | NAME[2]="hollywood-2009" && K[2]="10" && EPS[2]="5" && MINPTS[2]="7" 28 | NAME[3]="indochina-2004" && K[3]="2" && EPS[3]="1" && MINPTS[3]="1" 29 | NAME[4]="road_usa" && K[4]="2" && EPS[4]="1" && MINPTS[4]="1" 30 | 31 | # network graphs 32 | 33 | GRAPH[0]="market $DATADIR/${NAME[0]}/${NAME[0]}.mtx" 34 | GRAPH[1]="market $DATADIR/${NAME[1]}/${NAME[1]}.mtx" 35 | GRAPH[2]="market $DATADIR/${NAME[2]}/${NAME[2]}.mtx" 36 | GRAPH[3]="market $DATADIR/${NAME[3]}/${NAME[3]}.mtx" 37 | GRAPH[4]="market $DATADIR/${NAME[4]}/${NAME[4]}.mtx" 38 | 39 | # parameters 40 | OPTIONS="--undirected --snn=true --quick --tag=Gunrock/SNN_GRAPL19" 41 | 42 | for i in {0..4} 43 | do 44 | SUFFIX="V100_Ubuntu_18-04" 45 | mkdir -p eval/$SUFFIX 46 | DEVICE="2" 47 | 48 | echo $EXECUTION ${GRAPH[$i]} --k=${K[$i]} --eps=${EPS[$i]} --min-pts=${MINPTS[$i]} $OPTIONS --device=$DEVICE --jsondir=./eval/$SUFFIX "> ./eval/$SUFFIX/${NAME[$i]}.txt" 49 | $EXECUTION ${GRAPH[$i]} --k=${K[$i]} --eps=${EPS[$i]} --min-pts=${MINPTS[$i]} $OPTIONS --device=$DEVICE --jsondir=./eval/$SUFFIX > ./eval/$SUFFIX/${NAME[$i]}.txt 50 | sleep 1 51 | done 52 | -------------------------------------------------------------------------------- /examples/louvain/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------ 2 | # Gunrock: Sub-Project Louvain Community Detection 3 | # ------------------------------------------------------------------------ 4 | project(louvain) 5 | message("-- Project Added: ${PROJECT_NAME}") 6 | include(${CMAKE_SOURCE_DIR}/cmake/SetSubProject.cmake) 7 | 8 | add_test(NAME TEST_LOUVAIN COMMAND louvain market 9 | ${gunrock_INCLUDE_DIRS}/dataset/small/chesapeake.mtx 10 | --omp-threads=32 --advance-mode=ALL_EDGES --unify-segments=true) 11 | set_tests_properties(TEST_LOUVAIN PROPERTIES PASS_REGULAR_EXPRESSION "PASS") 12 | 13 | -------------------------------------------------------------------------------- /examples/louvain/Makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------- 2 | # Gunrock -- Fast and Efficient GPU Graph Library 3 | # ---------------------------------------------------------------- 4 | # This source code is distributed under the terms of LICENSE.TXT 5 | # in the root directory of this source distribution. 6 | # ---------------------------------------------------------------- 7 | 8 | #------------------------------------------------------------------------------- 9 | # (make test) Test driver for ALGO 10 | #------------------------------------------------------------------------------- 11 | 12 | include ../BaseMakefile.mk 13 | ALGO = louvain 14 | EXEC = bin/$(ALGO)_main_$(NVCC_VERSION)_$(ARCH_SUFFIX) 15 | SRC = $(ALGO)_main.cu 16 | 17 | test: $(EXEC) 18 | 19 | $(EXEC) : $(SRC) $(DEPS) 20 | mkdir -p bin 21 | $(NVCC) $(DEFINES) $(SM_TARGETS) -o $(EXEC) $(SRC) $(EXTRA_SOURCE) $(NVCCFLAGS) $(ARCH) $(INC) -O3 22 | 23 | a : $(SRC) $(DEPS) 24 | mkdir -p bin 25 | rm -f $(EXEC) 26 | $(NVCC) $(DEFINES) $(SM_TARGETS) -o $(EXEC) $(SRC) $(EXTRA_SOURCE) $(NVCCFLAGS) $(ARCH) $(INC) -O3 > a.txt 2>&1 || true 27 | grep rror: a.txt; grep arn a.txt 28 | 29 | .DEFAULT_GOAL := test 30 | -------------------------------------------------------------------------------- /examples/mf/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------ 2 | # Gunrock: Sub-Project MaxFlow 3 | # ------------------------------------------------------------------------ 4 | project(mf) 5 | message("-- Project Added: ${PROJECT_NAME}") 6 | include(${CMAKE_SOURCE_DIR}/cmake/SetSubProject.cmake) 7 | -------------------------------------------------------------------------------- /examples/mf/Makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------- 2 | # Gunrock -- Fast and Efficient GPU Graph Library 3 | # ---------------------------------------------------------------- 4 | # This source code is distributed under the terms of LICENSE.TXT 5 | # in the root directory of this source distribution. 6 | # ---------------------------------------------------------------- 7 | 8 | #------------------------------------------------------------------------------- 9 | # (make test) Test driver for ALGO 10 | #------------------------------------------------------------------------------- 11 | 12 | include ../BaseMakefile.mk 13 | ALGO = mf 14 | EXEC = bin/test_$(ALGO)_$(NVCC_VERSION)_$(ARCH_SUFFIX) 15 | 16 | test: $(EXEC) 17 | 18 | $(EXEC) : test_$(ALGO).cu $(DEPS) 19 | mkdir -p bin 20 | $(NVCC) $(DEFINES) $(SM_TARGETS) -o $(EXEC) test_$(ALGO).cu $(EXTRA_SOURCE) $(NVCCFLAGS) -I. -w $(ARCH) $(INC) -O3 21 | 22 | a : test_$(ALGO).cu $(DEPS) 23 | mkdir -p bin 24 | rm -f $(EXEC) 25 | $(NVCC) $(DEFINES) $(SM_TARGETS) -o $(EXEC) test_$(ALGO).cu $(EXTRA_SOURCE) $(NVCCFLAGS) -I. $(ARCH) $(INC) -O3 > a.txt 2>&1 || true 26 | grep rror: a.txt; grep arn a.txt 27 | 28 | .DEFAULT_GOAL := test 29 | -------------------------------------------------------------------------------- /examples/pr/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------ 2 | # Gunrock: Sub-Project PageRank 3 | # ------------------------------------------------------------------------ 4 | project(pr) 5 | message("-- Project Added: ${PROJECT_NAME}") 6 | include(${CMAKE_SOURCE_DIR}/cmake/SetSubProject.cmake) 7 | 8 | add_test(NAME TEST_PR COMMAND pr market 9 | ${gunrock_INCLUDE_DIRS}/dataset/small/bips98_606.mtx --normalized --compensate --undirected) 10 | set_tests_properties(TEST_PR PROPERTIES FAIL_REGULAR_EXPRESSION "INCORRECT") 11 | 12 | if(GUNROCK_MGPU_TESTS) 13 | add_test(NAME TEST_MGPU_PR COMMAND pr market 14 | ${gunrock_INCLUDE_DIRS}/dataset/small/bips98_606.mtx ${DEVICES} 15 | --normalized --compensate --undirected) 16 | set_tests_properties(TEST_MGPU_PR PROPERTIES FAIL_REGULAR_EXPRESSION "INCORRECT") 17 | endif(GUNROCK_MGPU_TESTS) 18 | -------------------------------------------------------------------------------- /examples/pr/Makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------- 2 | # Gunrock -- Fast and Efficient GPU Graph Library 3 | # ---------------------------------------------------------------- 4 | # This source code is distributed under the terms of LICENSE.TXT 5 | # in the root directory of this source distribution. 6 | # ---------------------------------------------------------------- 7 | 8 | #------------------------------------------------------------------------------- 9 | # (make test) Test driver for ALGO 10 | #------------------------------------------------------------------------------- 11 | 12 | include ../BaseMakefile.mk 13 | ALGO = pr 14 | EXEC = bin/test_$(ALGO)_$(NVCC_VERSION)_$(ARCH_SUFFIX) 15 | 16 | test: $(EXEC) 17 | 18 | $(EXEC) : test_$(ALGO).cu $(DEPS) 19 | mkdir -p bin 20 | $(NVCC) -w $(DEFINES) $(SM_TARGETS) -o $(EXEC) test_$(ALGO).cu $(EXTRA_SOURCE) $(NVCCFLAGS) $(ARCH) $(INC) -O3 21 | 22 | a : test_$(ALGO).cu $(DEPS) 23 | mkdir -p bin 24 | rm -f $(EXEC) 25 | $(NVCC) $(DEFINES) $(SM_TARGETS) -o $(EXEC) test_$(ALGO).cu $(EXTRA_SOURCE) $(NVCCFLAGS) $(ARCH) $(INC) -O3 > a.txt 2>&1 || true 26 | grep rror: a.txt; grep arn a.txt 27 | 28 | .DEFAULT_GOAL := test 29 | -------------------------------------------------------------------------------- /examples/pr/make_summary.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | g++ -Wall make_summary.cpp -o eval/make_summary -std=c++11 4 | cd eval 5 | 6 | DIRS="$(ls -d *K[48]0*)" 7 | 8 | for i in $DIRS 9 | do 10 | if [ -d $i ] ; 11 | then 12 | #echo $i 13 | ./make_summary $i 14 | fi 15 | done 16 | 17 | cd .. 18 | 19 | -------------------------------------------------------------------------------- /examples/pr/run_rmat.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | OPTION="--undirected --quick --normalized --traversal-mode=LB --iteration-num=10" 4 | MARK=".undir.32bitSizeT.nocomp" 5 | EXECUTION="./bin/test_pr_7.5_x86_64" 6 | DATADIR="/data/gunrock_dataset/large" 7 | 8 | cd ~/Projects/gunrock_dev/gunrock/tests/pr 9 | 10 | for d in {1..6} 11 | do 12 | SUFFIX="CentOS6_6.k40cx${d}.rand" 13 | mkdir -p eval/$SUFFIX 14 | DEVICE="0" 15 | for i in {1..8} 16 | do 17 | if [ "$i" -lt "$d" ]; then 18 | DEVICE=$DEVICE",$i" 19 | fi 20 | done 21 | 22 | for i in {20..25} 23 | do 24 | max_j=$(echo "29-${i}" | bc) 25 | for j in {4..9} 26 | do 27 | edge_factor=$(echo "2^${j}" | bc) 28 | if [ "$j" -le $((29-${i})) ]; then 29 | echo $EXECUTION grmat --rmat_scale=${i} --rmat_edgefactor=${edge_factor} $OPTION --device=$DEVICE --jsondir=./eval/$SUFFIX "> ./eval/$SUFFIX/rmat_n${i}_${edge_factor}${MARK}.txt" 30 | $EXECUTION grmat --rmat_scale=${i} --rmat_edgefactor=${edge_factor} $OPTION --device=$DEVICE --jsondir=./eval/$SUFFIX > ./eval/$SUFFIX/rmat_n${i}_${edge_factor}${MARK}.txt 31 | sleep 1 32 | fi 33 | done 34 | done 35 | 36 | if [ "$d" -eq "1" ]; then 37 | for i in {20..25} 38 | do 39 | edge_factor=$(echo "2^( 29 - ${i} )" | bc) 40 | echo $EXECUTION rmat --rmat_scale=${i} --rmat_edgefactor=${edge_factor} $OPTION --device=$DEVICE --jsondir=./eval/$SUFFIX "> ./eval/$SUFFIX/rmat_n${i}_${edge_factor}${MARK}.txt" 41 | $EXECUTION rmat --rmat_scale=${i} --rmat_edgefactor=${edge_factor} $OPTION --device=$DEVICE --jsondir=./eval/$SUFFIX > ./eval/$SUFFIX/rmat_n${i}_${edge_factor}${MARK}.txt 42 | done 43 | fi 44 | done 45 | 46 | 47 | -------------------------------------------------------------------------------- /examples/pr_nibble/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------ 2 | # Gunrock: Sub-Project Local Graph Clustering (PR Nibble) 3 | # ------------------------------------------------------------------------ 4 | project(pr_nibble) 5 | message("-- Project Added: ${PROJECT_NAME}") 6 | include(${CMAKE_SOURCE_DIR}/cmake/SetSubProject.cmake) 7 | 8 | add_test(NAME TEST_PR_NIBBLE COMMAND pr_nibble market 9 | ${gunrock_INCLUDE_DIRS}/dataset/small/chesapeake.mtx) 10 | set_tests_properties(TEST_PR_NIBBLE PROPERTIES PASS_REGULAR_EXPRESSION "PASSED") 11 | -------------------------------------------------------------------------------- /examples/pr_nibble/Makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------- 2 | # Gunrock -- Fast and Efficient GPU Graph Library 3 | # ---------------------------------------------------------------- 4 | # This source code is distributed under the terms of LICENSE.TXT 5 | # in the root directory of this source distribution. 6 | # ---------------------------------------------------------------- 7 | 8 | #------------------------------------------------------------------------------- 9 | # (make test) Test driver for ALGO 10 | #------------------------------------------------------------------------------- 11 | 12 | include ../BaseMakefile.mk 13 | ALGO = pr_nibble 14 | EXEC = bin/test_$(ALGO)_$(NVCC_VERSION)_$(ARCH_SUFFIX) 15 | 16 | test: $(EXEC) 17 | 18 | $(EXEC) : test_$(ALGO).cu $(DEPS) 19 | mkdir -p bin 20 | $(NVCC) -w -g $(DEFINES) $(SM_TARGETS) -o $(EXEC) test_$(ALGO).cu $(EXTRA_SOURCE) $(NVCCFLAGS) $(ARCH) $(INC) # -O3 21 | 22 | a : test_$(ALGO).cu $(DEPS) 23 | mkdir -p bin 24 | rm -f $(EXEC) 25 | $(NVCC) $(DEFINES) $(SM_TARGETS) -o $(EXEC) test_$(ALGO).cu $(EXTRA_SOURCE) $(NVCCFLAGS) $(ARCH) $(INC) -O3 > a.txt 2>&1 || true 26 | grep rror: a.txt; grep arn a.txt 27 | 28 | .DEFAULT_GOAL := test 29 | -------------------------------------------------------------------------------- /examples/pr_nibble/test: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # test.sh 4 | 5 | ./bin/test_pr_nibble* \ 6 | --graph-type market \ 7 | --graph-file ../../dataset/small/chesapeake.mtx \ 8 | --src 0 \ 9 | --max-iter 1 10 | 11 | 12 | ./bin/test_pr_nibble* \ 13 | --graph-type market \ 14 | --graph-file jhu \ 15 | --src 0 \ 16 | --max-iter 20 17 | 18 | -------------------------------------------------------------------------------- /examples/pr_nibble/test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # test.sh 4 | 5 | ./bin/test_pr_nibble* \ 6 | --graph-type market \ 7 | --graph-file ../../dataset/small/chesapeake.mtx \ 8 | --src 0 \ 9 | --max-iter 1 10 | 11 | 12 | ./bin/test_pr_nibble* \ 13 | --graph-type market \ 14 | --graph-file jhu \ 15 | --src 0 \ 16 | --max-iter 20 17 | 18 | -------------------------------------------------------------------------------- /examples/proj/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------ 2 | # Gunrock: Sub-Project Graph Projection 3 | # ------------------------------------------------------------------------ 4 | project(proj) 5 | message("-- Project Added: ${PROJECT_NAME}") 6 | include(${CMAKE_SOURCE_DIR}/cmake/SetSubProject.cmake) 7 | 8 | add_test(NAME TEST_PROJ COMMAND proj market 9 | ${gunrock_INCLUDE_DIRS}/dataset/small/chesapeake.mtx) 10 | set_tests_properties(TEST_PROJ PROPERTIES PASS_REGULAR_EXPRESSION "PASSED") 11 | -------------------------------------------------------------------------------- /examples/proj/Makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------- 2 | # Gunrock -- Fast and Efficient GPU Graph Library 3 | # ---------------------------------------------------------------- 4 | # This source code is distributed under the terms of LICENSE.TXT 5 | # in the root directory of this source distribution. 6 | # ---------------------------------------------------------------- 7 | 8 | #------------------------------------------------------------------------------- 9 | # (make test) Test driver for ALGO 10 | #------------------------------------------------------------------------------- 11 | 12 | include ../BaseMakefile.mk 13 | ALGO = proj 14 | EXEC = bin/test_$(ALGO)_$(NVCC_VERSION)_$(ARCH_SUFFIX) 15 | 16 | test: $(EXEC) 17 | 18 | $(EXEC) : test_$(ALGO).cu $(DEPS) 19 | mkdir -p bin 20 | $(NVCC) -w $(DEFINES) $(SM_TARGETS) -o $(EXEC) test_$(ALGO).cu $(EXTRA_SOURCE) $(NVCCFLAGS) $(ARCH) $(INC) -O3 21 | 22 | a : test_$(ALGO).cu $(DEPS) 23 | mkdir -p bin 24 | rm -f $(EXEC) 25 | $(NVCC) $(DEFINES) $(SM_TARGETS) -o $(EXEC) test_$(ALGO).cu $(EXTRA_SOURCE) $(NVCCFLAGS) $(ARCH) $(INC) -O3 > a.txt 2>&1 || true 26 | grep rror: a.txt; grep arn a.txt 27 | 28 | .DEFAULT_GOAL := test 29 | -------------------------------------------------------------------------------- /examples/proj/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ./bin/test_proj* --graph-type market --graph-file ../../dataset/small/chesapeake.mtx 4 | -------------------------------------------------------------------------------- /examples/rw/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------ 2 | # Gunrock: Sub-Project Random Walk 3 | # ------------------------------------------------------------------------ 4 | project(rw) 5 | message("-- Project Added: ${PROJECT_NAME}") 6 | include(${CMAKE_SOURCE_DIR}/cmake/SetSubProject.cmake) 7 | 8 | add_test(NAME TEST_RW COMMAND rw market 9 | ${gunrock_INCLUDE_DIRS}/dataset/small/chesapeake.mtx) 10 | set_tests_properties(TEST_RW PROPERTIES PASS_REGULAR_EXPRESSION "0 errors occurred") 11 | -------------------------------------------------------------------------------- /examples/rw/Makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------- 2 | # Gunrock -- Fast and Efficient GPU Graph Library 3 | # ---------------------------------------------------------------- 4 | # This source code is distributed under the terms of LICENSE.TXT 5 | # in the root directory of this source distribution. 6 | # ---------------------------------------------------------------- 7 | 8 | #------------------------------------------------------------------------------- 9 | # (make test) Test driver for ALGO 10 | #------------------------------------------------------------------------------- 11 | 12 | include ../BaseMakefile.mk 13 | ALGO = rw 14 | EXEC = bin/test_$(ALGO)_$(NVCC_VERSION)_$(ARCH_SUFFIX) 15 | 16 | NVCCFLAGS += -lcurand 17 | test: $(EXEC) 18 | 19 | $(EXEC) : test_$(ALGO).cu $(DEPS) 20 | mkdir -p bin 21 | $(NVCC) -w $(DEFINES) $(SM_TARGETS) -o $(EXEC) test_$(ALGO).cu $(EXTRA_SOURCE) $(NVCCFLAGS) $(ARCH) $(INC) -O3 22 | 23 | a : test_$(ALGO).cu $(DEPS) 24 | mkdir -p bin 25 | rm -f $(EXEC) 26 | $(NVCC) $(DEFINES) $(SM_TARGETS) -o $(EXEC) test_$(ALGO).cu $(EXTRA_SOURCE) $(NVCCFLAGS) $(ARCH) $(INC) -O3 > a.txt 2>&1 || true 27 | grep rror: a.txt; grep arn a.txt 28 | 29 | .DEFAULT_GOAL := test 30 | -------------------------------------------------------------------------------- /examples/rw/random-values.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | """ 4 | random-values.py 5 | """ 6 | 7 | import sys 8 | import numpy as np 9 | 10 | vals = np.random.uniform(0, 1, int(sys.argv[1])) 11 | np.savetxt(sys.stdout, vals, fmt='%.8f') -------------------------------------------------------------------------------- /examples/rw/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # get all execution files in ./bin 4 | files=./bin/* 5 | # split file names into arr 6 | arr=$(echo $files | tr " " "\n") 7 | max_ver_num="$" 8 | exe_file=${arr[0]} 9 | # iterate over all file names to get the largest version number 10 | for x in $arr 11 | do 12 | output=$(grep -o "[0-9]\.[0-9]" <<< "$x") 13 | if [ "$output" \> "$max_ver_num" ]; then 14 | exe_file=$x 15 | fi 16 | done 17 | 18 | OPTION="--walk_length=10 --undirected --quick" 19 | # put OS and Device type here 20 | SUFFIX="GUNROCK_v0-5-0" 21 | 22 | mkdir -p eval/$SUFFIX 23 | 24 | for i in delaunay_n13 delaunay_n21 delaunay_n24 soc-LiveJournal1 hollywood-2009 indochina-2004 25 | do 26 | echo $exe_file market ../../dataset/large/$i/$i.mtx $OPTION"> ./eval/$SUFFIX/${i}.$SUFFIX${MARKS}.txt" 27 | $exe_file market ../../dataset/large/$i/$i.mtx $OPTION > ./eval/$SUFFIX/${i}.$SUFFIX${MARKS}.txt 28 | sleep 1 29 | done 30 | -------------------------------------------------------------------------------- /examples/sage/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------ 2 | # Gunrock: Sub-Project Graph Sage 3 | # ------------------------------------------------------------------------ 4 | project(sage) 5 | message("-- Project Added: ${PROJECT_NAME}") 6 | include(${CMAKE_SOURCE_DIR}/cmake/SetSubProject.cmake) 7 | 8 | add_test(NAME TEST_SAGE COMMAND sage market 9 | ${gunrock_INCLUDE_DIRS}/dataset/small/chesapeake.mtx) 10 | set_tests_properties(TEST_SAGE PROPERTIES PASS_REGULAR_EXPRESSION "Embedding validation: PASS") 11 | -------------------------------------------------------------------------------- /examples/sage/Makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------- 2 | # Gunrock -- Fast and Efficient GPU Graph Library 3 | # ---------------------------------------------------------------- 4 | # This source code is distributed under the terms of LICENSE.TXT 5 | # in the root directory of this source distribution. 6 | # ---------------------------------------------------------------- 7 | 8 | #------------------------------------------------------------------------------- 9 | # (make test) Test driver for ALGO 10 | #------------------------------------------------------------------------------- 11 | 12 | #maxregisters = 32 13 | include ../BaseMakefile.mk 14 | ALGO = sage 15 | EXEC = bin/test_$(ALGO)_$(NVCC_VERSION)_$(ARCH_SUFFIX) 16 | 17 | test: $(EXEC) 18 | 19 | $(EXEC) : test_$(ALGO).cu $(DEPS) 20 | mkdir -p bin 21 | $(NVCC) $(DEFINES) $(SM_TARGETS) -o $(EXEC) test_$(ALGO).cu $(EXTRA_SOURCE) $(NVCCFLAGS) $(ARCH) $(INC) -O3 22 | 23 | a : test_$(ALGO).cu $(DEPS) 24 | mkdir -p bin 25 | rm -f $(EXEC) 26 | $(NVCC) $(DEFINES) $(SM_TARGETS) -o $(EXEC) test_$(ALGO).cu $(EXTRA_SOURCE) $(NVCCFLAGS) $(ARCH) $(INC) -O3 > a.txt 2>&1 || true 27 | grep rror: a.txt; grep arn a.txt 28 | 29 | .DEFAULT_GOAL := test 30 | -------------------------------------------------------------------------------- /examples/sage/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #get all execution files in ./bin 4 | files=(./bin/*) 5 | #split file names into arr 6 | arr=$(echo $files | tr " " "\n") 7 | max_ver_num="$" 8 | 9 | exe_file=${arr[0]} 10 | #iterate over all file names to get the largest version number 11 | for x in $arr 12 | do 13 | output=$(grep -o "[0-9]\.[0-9]" <<<"$x") 14 | if [ "$output" \> "$max_ver_num" ]; then 15 | exe_file=$x 16 | fi 17 | done 18 | 19 | OPTIONS="--device=2" 20 | OPTIONS="$OPTIONS --omp-threads=32 --num-runs=10" 21 | OPTIONS="$OPTIONS --feature-column=64,128" 22 | OPTIONS="$OPTIONS --num-children-per-source=10,25,100" 23 | OPTIONS="$OPTIONS --batch-size=512,1024,2048,4096,8192,16384" 24 | 25 | OPTION[0]="$OPTIONS" 26 | OPTION[1]="${OPTION[0]} --undirected" #undirected" 27 | 28 | MARK[0]="" 29 | MARK[1]="${MARK[0]}_undir" 30 | 31 | #put OS and Device type here 32 | EXCUTION=$exe_file 33 | DATADIR="/data/hive_datasets" 34 | 35 | NAME[ 0]="pokec" 36 | NAME[ 1]="amazon" 37 | NAME[ 2]="flickr" 38 | NAME[ 3]="twitter" 39 | NAME[ 4]="cit-Patents" 40 | 41 | for k in 0 42 | do 43 | #put OS and Device type here 44 | SUFFIX="ubuntu18.04_V100x1" 45 | LOGDIR=eval/$SUFFIX 46 | mkdir -p $LOGDIR 47 | 48 | for i in {0..4} ##0 1 2 3 4 5 6 9 11 12 13 14 15 16 17 49 | do 50 | for j in 1 #{0..1} 51 | do 52 | echo $EXCUTION market $DATADIR/${NAME[$i]}/${NAME[$i]}.mtx ${OPTION[$j]} --jsondir=$LOGDIR "> $LOGDIR/${NAME[$i]}${MARK[$j]}.txt 2>&1" 53 | $EXCUTION market $DATADIR/${NAME[$i]}/${NAME[$i]}.mtx ${OPTION[$j]} --jsondir=$LOGDIR > $LOGDIR/${NAME[$i]}${MARK[$j]}.txt 2>&1 54 | sleep 10 55 | done 56 | done 57 | done 58 | 59 | -------------------------------------------------------------------------------- /examples/sage/test.sh: -------------------------------------------------------------------------------- 1 | ./bin/test_sage_10.0_x86_64 \ 2 | market ../../gunrock/app/sage/test_edgelist1.txt --undirected \ 3 | --vertex-start-from-zero=true --Wf1 ../../gunrock/app/sage/w1.txt \ 4 | --Wa1 ../../gunrock/app/sage/w1.txt --Wf2 ../../gunrock/app/sage/w2.txt --Wa2 ../../gunrock/app/sage/w2.txt --features ../../gunrock/app/sage/features.txt --num-runs=10 --device=2 \ 5 | --batch-size=128,256,512,1024,2048 \ 6 | --validation=each 7 | -------------------------------------------------------------------------------- /examples/sage/test2.sh: -------------------------------------------------------------------------------- 1 | ./bin/test_sage_10.0_x86_64 \ 2 | market ../../gunrock/app/sage/test_edgelist1.txt --undirected \ 3 | --vertex-start-from-zero=true \ 4 | --num-runs=10 --device=2 \ 5 | --batch-size=128,256,512,1024,2048 \ 6 | --validation=each 7 | -------------------------------------------------------------------------------- /examples/shared_libs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------ 2 | # Gunrock: Sub-Project C Shared Libraries 3 | # ------------------------------------------------------------------------ 4 | add_executable(shared_lib_pr shared_lib_pr.c) 5 | target_link_libraries(shared_lib_pr gunrock) 6 | 7 | add_executable(shared_lib_sm shared_lib_sm.c) 8 | target_link_libraries(shared_lib_sm gunrock) 9 | 10 | add_test(NAME SHARED_LIB_TEST_PAGERANK COMMAND shared_lib_pr) 11 | set_tests_properties(SHARED_LIB_TEST_PAGERANK 12 | PROPERTIES PASS_REGULAR_EXPRESSION "Node_ID.*2.*: Score.*1.2*") 13 | -------------------------------------------------------------------------------- /examples/shared_libs/shared_lib_pr.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief PageRank test for shared library advanced interface 3 | * @file shared_lib_pr.c 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | int main(int argc, char *argv[]) { 10 | //////////////////////////////////////////////////////////////////////////// 11 | 12 | int num_nodes = 7, num_edges = 26; 13 | int row_offsets[8] = {0, 3, 6, 11, 15, 19, 23, 26}; 14 | int col_indices[26] = {1, 2, 3, 0, 2, 4, 0, 1, 3, 4, 5, 0, 2, 15 | 5, 6, 1, 2, 5, 6, 2, 3, 4, 6, 3, 4, 5}; 16 | 17 | int *node_ids = (int *)malloc(sizeof(int) * num_nodes); 18 | float *ranks = (float *)malloc(sizeof(float) * num_nodes); 19 | 20 | // Jonathan's Note: Disabled pagerank here since I was testing only hits and sm in CMakeLists.txt. 21 | double elapsed = pagerank(num_nodes, num_edges, row_offsets, col_indices, 1, 22 | node_ids, ranks); 23 | 24 | 25 | 26 | int node; 27 | for (node = 0; node < num_nodes; ++node) 28 | printf("Node_ID [%d] : Score: [%f]\n", node_ids[node], ranks[node]); 29 | 30 | // HITS 31 | float *hub_ranks = (float *)malloc(sizeof(float) * num_nodes); 32 | float *auth_ranks = (float *)malloc(sizeof(float) * num_nodes); 33 | int num_iter = 10; 34 | // double elapsed_hits = hits(num_nodes, num_edges, row_offsets, col_indices, num_iter, hub_ranks, auth_ranks); 35 | 36 | if (node_ids) free(node_ids); 37 | if (ranks) free(ranks); 38 | if(hub_ranks) free(hub_ranks); 39 | if(auth_ranks) free(auth_ranks); 40 | 41 | return 0; 42 | } 43 | -------------------------------------------------------------------------------- /examples/shared_libs/shared_lib_sm.c: -------------------------------------------------------------------------------- 1 | /* 2 | * @brief Subgraph matching test for shared library advanced interface 3 | * @file shared_lib_sm.c 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | int main(int argc, char *argv[]) { 10 | 11 | int num_data_nodes = 5, num_data_edges = 5; 12 | int data_row_offsets[6] = {0, 2, 6, 7, 9}; 13 | int data_col_indices[5] = {1, 3, 0, 2, 3}; 14 | 15 | int num_query_nodes = 3, num_query_edges = 3; 16 | int query_row_offsets[4] = {0, 2, 4, 6}; 17 | int query_col_indices[3] = {1, 2, 0}; 18 | 19 | int *sm_counts = (int *)malloc(sizeof(int) * num_data_nodes); 20 | 21 | double elapsed = sm(num_data_nodes, num_data_edges, data_row_offsets, 22 | data_col_indices, num_query_nodes, num_query_edges, 23 | query_row_offsets, query_col_indices, 1, sm_counts); 24 | 25 | int node; 26 | for (node = 0; node < num_data_nodes; ++node) { 27 | printf("Node_ID [%d] : Number matched subgraphs: [%d]\n", node, sm_counts[node]); 28 | } 29 | 30 | if (sm_counts) free(sm_counts); 31 | 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /examples/sm/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------ 2 | # Gunrock: Sub-Project Sub-Graph Matching 3 | # ------------------------------------------------------------------------ 4 | project(sm) 5 | message("-- Project Added: ${PROJECT_NAME}") 6 | include(${CMAKE_SOURCE_DIR}/cmake/SetSubProject.cmake) 7 | 8 | add_test(NAME TEST_SM COMMAND sm market 9 | ${gunrock_INCLUDE_DIRS}/dataset/small/tree.mtx --pattern-graph-type=market 10 | --pattern-graph-file=${gunrock_INCLUDE_DIRS}/dataset/small/query_sm.mtx 11 | --undirected=1 --pattern-undirected=1 --num-runs=1 --quiet=false) 12 | set_tests_properties(TEST_SM PROPERTIES PASS_REGULAR_EXPRESSION "PASS") 13 | -------------------------------------------------------------------------------- /examples/sm/Makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------- 2 | # Gunrock -- Fast and Efficient GPU Graph Library 3 | # ---------------------------------------------------------------- 4 | # This source code is distributed under the terms of LICENSE.TXT 5 | # in the root directory of this source distribution. 6 | # ---------------------------------------------------------------- 7 | 8 | #------------------------------------------------------------------------------- 9 | # (make test) Test driver for ALGO 10 | #------------------------------------------------------------------------------- 11 | 12 | include ../BaseMakefile.mk 13 | ALGO = sm 14 | EXEC = bin/$(ALGO)_main_$(NVCC_VERSION)_$(ARCH_SUFFIX) 15 | SRC = $(ALGO)_main.cu 16 | 17 | test: $(EXEC) 18 | 19 | $(EXEC) : $(SRC) $(DEPS) 20 | mkdir -p bin 21 | $(NVCC) -w $(DEFINES) $(SM_TARGETS) -o $(EXEC) $(SRC) $(EXTRA_SOURCE) $(NVCCFLAGS) $(ARCH) $(INC) -O3 22 | 23 | a : $(SRC) $(DEPS) 24 | mkdir -p bin 25 | rm -f $(EXEC) 26 | $(NVCC) $(DEFINES) $(SM_TARGETS) -o $(EXEC) $(SRC) $(EXTRA_SOURCE) $(NVCCFLAGS) $(ARCH) $(INC) -O3 > a.txt 2>&1 || true 27 | grep rror: a.txt; grep arn a.txt 28 | 29 | .DEFAULT_GOAL := test 30 | -------------------------------------------------------------------------------- /examples/sm/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # get all execution files in ./bin 4 | files=./bin/* 5 | # split file names into arr 6 | arr=$(echo $files | tr " " "\n") 7 | max_ver_num="$" 8 | exe_file=${arr[0]} 9 | echo $exe_file market ../../dataset/small/tree.mtx --pattern-graph-type=market --pattern-graph-file=../../dataset/small/query_sm.mtx --undirected=1 --pattern-undirected=1 --num-runs=1 --quiet=False 10 | $exe_file market ../../dataset/small/tree.mtx --pattern-graph-type=market --pattern-graph-file=../../dataset/small/query_sm.mtx --undirected=1 --pattern-undirected=1 --num-runs=1 --quiet=False 11 | 12 | -------------------------------------------------------------------------------- /examples/ss/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------ 2 | # Gunrock: Sub-Project Scan Statistics 3 | # ------------------------------------------------------------------------ 4 | project(ss) 5 | message("-- Project Added: ${PROJECT_NAME}") 6 | include(${CMAKE_SOURCE_DIR}/cmake/SetSubProject.cmake) 7 | 8 | add_test(NAME TEST_SS COMMAND ss market 9 | ${gunrock_INCLUDE_DIRS}/dataset/small/chesapeake.mtx) 10 | set_tests_properties(TEST_SS PROPERTIES PASS_REGULAR_EXPRESSION "PASS") 11 | -------------------------------------------------------------------------------- /examples/ss/Makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------- 2 | # Gunrock -- Fast and Efficient GPU Graph Library 3 | # ---------------------------------------------------------------- 4 | # This source code is distributed under the terms of LICENSE.TXT 5 | # in the root directory of this source distribution. 6 | # ---------------------------------------------------------------- 7 | 8 | #------------------------------------------------------------------------------- 9 | # (make test) Test driver for ALGO 10 | #------------------------------------------------------------------------------- 11 | 12 | include ../BaseMakefile.mk 13 | ALGO = ss 14 | EXEC = bin/$(ALGO)_main_$(NVCC_VERSION)_$(ARCH_SUFFIX) 15 | SRC = $(ALGO)_main.cu 16 | 17 | test: $(EXEC) 18 | 19 | $(EXEC) : $(SRC) $(DEPS) 20 | mkdir -p bin 21 | $(NVCC) -w $(DEFINES) $(SM_TARGETS) -o $(EXEC) $(SRC) $(EXTRA_SOURCE) $(NVCCFLAGS) $(ARCH) $(INC) -O3 22 | 23 | a : $(SRC) $(DEPS) 24 | mkdir -p bin 25 | rm -f $(EXEC) 26 | $(NVCC) $(DEFINES) $(SM_TARGETS) -o $(EXEC) $(SRC) $(EXTRA_SOURCE) $(NVCCFLAGS) $(ARCH) $(INC) -O3 > a.txt 2>&1 || true 27 | grep rror: a.txt; grep arn a.txt 28 | 29 | .DEFAULT_GOAL := test 30 | -------------------------------------------------------------------------------- /examples/ss/run.sh: -------------------------------------------------------------------------------- 1 | ./bin/ss_main_10.0_x86_64 market /data/hive_datasets/enron/enron.mtx --undirected=1 --num-runs=100 2 | -------------------------------------------------------------------------------- /examples/ss/run_all.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | exe_file="./bin/ss_main_10.0_x86_64" 4 | 5 | OPTION="--undirected --num-runs=10" 6 | 7 | #put OS and Device type here 8 | EXCUTION=$exe_file 9 | DATADIR="/data/gunrock_dataset/large" 10 | 11 | for k in 0 12 | do 13 | #put OS and Device type here 14 | SUFFIX="ubuntu16.04_TitanV" 15 | LOGDIR=eval/$SUFFIX 16 | mkdir -p $LOGDIR 17 | 18 | for i in kron_g500-logn21 mouse_gene soc-friendster soc-twitter-2010 enron 19 | do 20 | echo $EXCUTION market $DATADIR/$i/$i.mtx $OPTION --jsondir=$LOGDIR "> $LOGDIR/$i.txt 2>&1" 21 | $EXCUTION market $DATADIR/$i/$i.mtx $OPTION --jsondir=$LOGDIR > $LOGDIR/$i.txt 2>&1 22 | sleep 30 23 | done 24 | done 25 | 26 | -------------------------------------------------------------------------------- /examples/sssp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------ 2 | # Gunrock: Sub-Project Single Source Shortest Path 3 | # ------------------------------------------------------------------------ 4 | project(sssp) 5 | message("-- Project Added: ${PROJECT_NAME}") 6 | include(${CMAKE_SOURCE_DIR}/cmake/SetSubProject.cmake) 7 | 8 | add_test(NAME TEST_SSSP COMMAND sssp market 9 | ${gunrock_INCLUDE_DIRS}/dataset/small/chesapeake.mtx --undirected --src=0) 10 | set_tests_properties(TEST_SSSP PROPERTIES FAIL_REGULAR_EXPRESSION "INCORRECT") 11 | 12 | if(GUNROCK_MGPU_TESTS) 13 | add_test(NAME TEST_MGPU_SSSP COMMAND sssp market 14 | ${gunrock_INCLUDE_DIRS}/dataset/small/chesapeake.mtx ${DEVICES} --undirected --src=0) 15 | set_tests_properties(TEST_SSSP PROPERTIES FAIL_REGULAR_EXPRESSION "INCORRECT") 16 | endif(GUNROCK_MGPU_TESTS) 17 | -------------------------------------------------------------------------------- /examples/sssp/Makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------- 2 | # Gunrock -- Fast and Efficient GPU Graph Library 3 | # ---------------------------------------------------------------- 4 | # This source code is distributed under the terms of LICENSE.TXT 5 | # in the root directory of this source distribution. 6 | # ---------------------------------------------------------------- 7 | 8 | #------------------------------------------------------------------------------- 9 | # (make test) Test driver for ALGO 10 | #------------------------------------------------------------------------------- 11 | 12 | include ../BaseMakefile.mk 13 | ALGO = sssp 14 | EXEC = bin/test_$(ALGO)_$(NVCC_VERSION)_$(ARCH_SUFFIX) 15 | 16 | test: $(EXEC) 17 | 18 | $(EXEC) : test_$(ALGO).cu $(DEPS) 19 | mkdir -p bin 20 | $(NVCC) $(DEFINES) $(SM_TARGETS) -o $(EXEC) test_$(ALGO).cu $(EXTRA_SOURCE) $(NVCCFLAGS) $(ARCH) $(INC) -O3 21 | 22 | a : test_$(ALGO).cu $(DEPS) 23 | mkdir -p bin 24 | rm -f $(EXEC) 25 | $(NVCC) $(DEFINES) $(SM_TARGETS) -o $(EXEC) test_$(ALGO).cu $(EXTRA_SOURCE) $(NVCCFLAGS) $(ARCH) $(INC) -O3 > a.txt 2>&1 || true 26 | grep rror: a.txt; grep arn a.txt 27 | 28 | .DEFAULT_GOAL := test 29 | -------------------------------------------------------------------------------- /examples/sssp/make_summary.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | g++ -Wall make_summary.cpp -o eval/make_summary -std=c++11 4 | cd eval 5 | 6 | DIRS="$(ls -d *K[48]0*)" 7 | 8 | for i in $DIRS 9 | do 10 | if [ -d $i ] ; 11 | then 12 | #echo $i 13 | ./make_summary $i 14 | fi 15 | done 16 | 17 | cd .. 18 | 19 | -------------------------------------------------------------------------------- /examples/sssp/run_rmat.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | OPTION="--undirected --src=largestdegree --traversal-mode=LB_CULL --iteration-num=10" 4 | MARK=".skip_pred.undir.LB_CULL.32bitSizeT" 5 | EXECUTION="./bin/test_sssp_7.5_x86_64" 6 | DATADIR="/data/gunrock_dataset/large" 7 | 8 | cd ~/Projects/gunrock_dev/gunrock/tests/sssp 9 | 10 | for d in 1 #{1..6} 11 | do 12 | SUFFIX="CentOS6_6.k40cx${d}.rand" 13 | mkdir -p eval/$SUFFIX 14 | DEVICE="0" 15 | for i in {1..8} 16 | do 17 | if [ "$i" -lt "$d" ]; then 18 | DEVICE=$DEVICE",$i" 19 | fi 20 | done 21 | 22 | QUEUE_SIZING=$(echo "${d} * 1.21" | bc) 23 | for i in {20..25} 24 | do 25 | max_j=$(echo "29-${i}" | bc) 26 | for j in {4..9} 27 | do 28 | max_j=max_j 29 | #edge_factor=$(echo "2^${j}" | bc) 30 | #if [ "$j" -le $((29-${i})) ]; then 31 | # echo $EXECUTION grmat --rmat_scale=${i} --rmat_edgefactor=${edge_factor} $OPTION --queue-sizing=$QUEUE_SIZING --device=$DEVICE --jsondir=./eval/$SUFFIX "> ./eval/$SUFFIX/rmat_n${i}_${edge_factor}${MARK}.txt" 32 | # $EXECUTION grmat --rmat_scale=${i} --rmat_edgefactor=${edge_factor} $OPTION --queue-sizing=$QUEUE_SIZING --device=$DEVICE --jsondir=./eval/$SUFFIX > ./eval/$SUFFIX/rmat_n${i}_${edge_factor}${MARK}.txt 33 | # sleep 1 34 | #fi 35 | done 36 | done 37 | 38 | if [ "$d" -eq "1" ]; then 39 | for i in {20..25} 40 | do 41 | edge_factor=$(echo "2^( 29 - ${i} )" | bc) 42 | echo $EXECUTION rmat --rmat_scale=${i} --rmat_edgefactor=${edge_factor} $OPTION --queue-sizing=$QUEUE_SIZING --device=$DEVICE --jsondir=./eval/$SUFFIX "> ./eval/$SUFFIX/rmat_n${i}_${edge_factor}${MARK}.txt" 43 | $EXECUTION rmat --rmat_scale=${i} --rmat_edgefactor=${edge_factor} $OPTION --queue-sizing=$QUEUE_SIZING --device=$DEVICE --jsondir=./eval/$SUFFIX > ./eval/$SUFFIX/rmat_n${i}_${edge_factor}${MARK}.txt 44 | done 45 | fi 46 | done 47 | 48 | 49 | -------------------------------------------------------------------------------- /examples/tc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------ 2 | # Gunrock: Sub-Project Triangle Counting 3 | # ------------------------------------------------------------------------ 4 | project(tc) 5 | message("-- Project Added: ${PROJECT_NAME}") 6 | include(${CMAKE_SOURCE_DIR}/cmake/SetSubProject.cmake) 7 | 8 | add_test(NAME TEST_TC COMMAND tc market 9 | ${gunrock_INCLUDE_DIRS}/dataset/small/chesapeake.mtx --sort-csr) 10 | set_tests_properties(TEST_TC PROPERTIES PASS_REGULAR_EXPRESSION "PASS") 11 | -------------------------------------------------------------------------------- /examples/tc/Makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------- 2 | # Gunrock -- Fast and Efficient GPU Graph Library 3 | # ---------------------------------------------------------------- 4 | # This source code is distributed under the terms of LICENSE.TXT 5 | # in the root directory of this source distribution. 6 | # ---------------------------------------------------------------- 7 | 8 | #------------------------------------------------------------------------------- 9 | # (make test) Test driver for ALGO 10 | #------------------------------------------------------------------------------- 11 | 12 | include ../BaseMakefile.mk 13 | ALGO = tc 14 | EXEC = bin/$(ALGO)_main_$(NVCC_VERSION)_$(ARCH_SUFFIX) 15 | SRC = $(ALGO)_main.cu 16 | 17 | test: $(EXEC) 18 | 19 | $(EXEC) : $(SRC) $(DEPS) 20 | mkdir -p bin 21 | $(NVCC) -w $(DEFINES) $(SM_TARGETS) -o $(EXEC) $(SRC) $(EXTRA_SOURCE) $(NVCCFLAGS) $(ARCH) $(INC) -O3 22 | 23 | a : $(SRC) $(DEPS) 24 | mkdir -p bin 25 | rm -f $(EXEC) 26 | $(NVCC) $(DEFINES) $(SM_TARGETS) -o $(EXEC) $(SRC) $(EXTRA_SOURCE) $(NVCCFLAGS) $(ARCH) $(INC) -O3 > a.txt 2>&1 || true 27 | grep rror: a.txt; grep arn a.txt 28 | 29 | .DEFAULT_GOAL := test -------------------------------------------------------------------------------- /examples/tc/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # get all execution files in ./bin 4 | files=./bin/* 5 | # split file names into arr 6 | arr=$(echo $files | tr " " "\n") 7 | max_ver_num="$" 8 | exe_file=${arr[0]} 9 | # iterate over all file names to get the largest version number 10 | for x in $arr 11 | do 12 | output=$(grep -o "[0-9]\.[0-9]" <<< "$x") 13 | if [ "$output" \> "$max_ver_num" ]; then 14 | exe_file=$x 15 | fi 16 | done 17 | 18 | # put OS and Device type here 19 | SUFFIX="GUNROCK_v0-5-0" 20 | 21 | mkdir -p eval/$SUFFIX 22 | 23 | for i in delaunay_n13 delaunay_n21 delaunay_n24 24 | do 25 | echo $exe_file market ../../dataset/large/$i/$i.mtx"> ./eval/$SUFFIX/${i}.$SUFFIX${MARKS}.txt" 26 | $exe_file market ../../dataset/large/$i/$i.mtx > ./eval/$SUFFIX/${i}.$SUFFIX${MARKS}.txt 27 | sleep 1 28 | done 29 | -------------------------------------------------------------------------------- /examples/vn/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------ 2 | # Gunrock: Sub-Project Vertex Nomination 3 | # ------------------------------------------------------------------------ 4 | project(vn) 5 | message("-- Project Added: ${PROJECT_NAME}") 6 | include(${CMAKE_SOURCE_DIR}/cmake/SetSubProject.cmake) 7 | 8 | # add_test(NAME TEST_VN COMMAND vn market 9 | # ${gunrock_INCLUDE_DIRS}/dataset/small/chesapeake.mtx) 10 | # set_tests_properties(TEST_VN PROPERTIES PASS_REGULAR_EXPRESSION "PASS") 11 | -------------------------------------------------------------------------------- /examples/vn/Makefile: -------------------------------------------------------------------------------- 1 | # ---------------------------------------------------------------- 2 | # Gunrock -- Fast and Efficient GPU Graph Library 3 | # ---------------------------------------------------------------- 4 | # This source code is distributed under the terms of LICENSE.TXT 5 | # in the root directory of this source distribution. 6 | # ---------------------------------------------------------------- 7 | 8 | #------------------------------------------------------------------------------- 9 | # (make test) Test driver for ALGO 10 | #------------------------------------------------------------------------------- 11 | 12 | include ../BaseMakefile.mk 13 | ALGO = vn 14 | EXEC = bin/test_$(ALGO)_$(NVCC_VERSION)_$(ARCH_SUFFIX) 15 | 16 | test: $(EXEC) 17 | 18 | $(EXEC) : test_$(ALGO).cu $(DEPS) 19 | mkdir -p bin 20 | $(NVCC) -w $(DEFINES) $(SM_TARGETS) -o $(EXEC) test_$(ALGO).cu $(EXTRA_SOURCE) $(NVCCFLAGS) $(ARCH) $(INC) -O3 21 | 22 | a : test_$(ALGO).cu $(DEPS) 23 | mkdir -p bin 24 | rm -f $(EXEC) 25 | $(NVCC) $(DEFINES) $(SM_TARGETS) -o $(EXEC) test_$(ALGO).cu $(EXTRA_SOURCE) $(NVCCFLAGS) $(ARCH) $(INC) -O3 > a.txt 2>&1 || true 26 | grep rror: a.txt; grep arn a.txt 27 | 28 | .DEFAULT_GOAL := test 29 | -------------------------------------------------------------------------------- /examples/vn/make_summary.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | g++ -Wall make_summary.cpp -o eval/make_summary -std=c++11 4 | cd eval 5 | 6 | DIRS="$(ls -d *K[48]0*)" 7 | 8 | for i in $DIRS 9 | do 10 | if [ -d $i ] ; 11 | then 12 | #echo $i 13 | ./make_summary $i 14 | fi 15 | done 16 | 17 | cd .. 18 | 19 | -------------------------------------------------------------------------------- /examples/vn/run_rmat.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | OPTION="--undirected --src=largestdegree --traversal-mode=LB_CULL --iteration-num=10" 4 | MARK=".skip_pred.undir.LB_CULL.32bitSizeT" 5 | EXECUTION="./bin/test_sssp_7.5_x86_64" 6 | DATADIR="/data/gunrock_dataset/large" 7 | 8 | cd ~/Projects/gunrock_dev/gunrock/tests/sssp 9 | 10 | for d in 1 #{1..6} 11 | do 12 | SUFFIX="CentOS6_6.k40cx${d}.rand" 13 | mkdir -p eval/$SUFFIX 14 | DEVICE="0" 15 | for i in {1..8} 16 | do 17 | if [ "$i" -lt "$d" ]; then 18 | DEVICE=$DEVICE",$i" 19 | fi 20 | done 21 | 22 | QUEUE_SIZING=$(echo "${d} * 1.21" | bc) 23 | for i in {20..25} 24 | do 25 | max_j=$(echo "29-${i}" | bc) 26 | for j in {4..9} 27 | do 28 | max_j=max_j 29 | #edge_factor=$(echo "2^${j}" | bc) 30 | #if [ "$j" -le $((29-${i})) ]; then 31 | # echo $EXECUTION grmat --rmat_scale=${i} --rmat_edgefactor=${edge_factor} $OPTION --queue-sizing=$QUEUE_SIZING --device=$DEVICE --jsondir=./eval/$SUFFIX "> ./eval/$SUFFIX/rmat_n${i}_${edge_factor}${MARK}.txt" 32 | # $EXECUTION grmat --rmat_scale=${i} --rmat_edgefactor=${edge_factor} $OPTION --queue-sizing=$QUEUE_SIZING --device=$DEVICE --jsondir=./eval/$SUFFIX > ./eval/$SUFFIX/rmat_n${i}_${edge_factor}${MARK}.txt 33 | # sleep 1 34 | #fi 35 | done 36 | done 37 | 38 | if [ "$d" -eq "1" ]; then 39 | for i in {20..25} 40 | do 41 | edge_factor=$(echo "2^( 29 - ${i} )" | bc) 42 | echo $EXECUTION rmat --rmat_scale=${i} --rmat_edgefactor=${edge_factor} $OPTION --queue-sizing=$QUEUE_SIZING --device=$DEVICE --jsondir=./eval/$SUFFIX "> ./eval/$SUFFIX/rmat_n${i}_${edge_factor}${MARK}.txt" 43 | $EXECUTION rmat --rmat_scale=${i} --rmat_edgefactor=${edge_factor} $OPTION --queue-sizing=$QUEUE_SIZING --device=$DEVICE --jsondir=./eval/$SUFFIX > ./eval/$SUFFIX/rmat_n${i}_${edge_factor}${MARK}.txt 44 | done 45 | fi 46 | done 47 | 48 | 49 | -------------------------------------------------------------------------------- /gunrock/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------ 2 | # Gunrock: Shared Library CMAKE files 3 | # ------------------------------------------------------------------------ 4 | 5 | if(RAPIDJSON_FOUND) 6 | include_directories(${RAPIDJSON_INCLUDEDIR}) 7 | else() 8 | message(SEND_ERROR "RapidJson include directory not set.") 9 | endif() 10 | 11 | if(mgpu_INCLUDE_DIRS) 12 | include_directories(${mgpu_INCLUDE_DIRS}) 13 | else() 14 | message(SEND_ERROR "Modern GPU include directory not set.") 15 | endif() 16 | 17 | if(cub_INCLUDE_DIRS) 18 | include_directories(${cub_INCLUDE_DIRS}) 19 | else() 20 | message(SEND_ERROR "CUB library include directory not set.") 21 | endif() 22 | 23 | set (mgpu_SOURCE_FILES 24 | ${mgpu_SOURCE_DIRS}/mgpucontext.cu 25 | ${mgpu_SOURCE_DIRS}/mgpuutil.cpp) 26 | 27 | set(HFILES_PUBLIC 28 | gunrock.h) 29 | 30 | set(CUFILES 31 | # TODO: Add support for remaining primitives 32 | ##app/bfs/bfs_app.cu 33 | #app/bc/bc_app.cu 34 | ##app/cc/cc_app.cu 35 | # app/graphsum/graphsum_app.cu 36 | app/pr/pr_app.cu 37 | app/hits/hits_app.cu 38 | app/sm/sm_app.cu 39 | #app/sssp/sssp_app.cu 40 | #app/louvain/louvain_app.cu 41 | #app/color/color_app.cu 42 | util/test_utils.cu 43 | util/error_utils.cu 44 | util/misc_utils.cu 45 | util/str_to_T.cu 46 | ${mgpu_SOURCE_FILES} 47 | util/gitsha1.c) 48 | 49 | CUDA_ADD_LIBRARY(gunrock ${LIB_TYPE} 50 | ${HFILES} 51 | ${CUHFILES} 52 | ${HFILES_PUBLIC} 53 | ${CUFILES} 54 | OPTIONS ${GENCODE} ${VERBOSE_PTXAS}) 55 | 56 | target_link_libraries(gunrock ${Boost_LIBRARIES}) 57 | if (METIS_LIBRARY) 58 | target_link_libraries(gunrock ${METIS_LIBRARY}) 59 | endif () 60 | -------------------------------------------------------------------------------- /gunrock/app/app.cuh: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Gunrock -- Fast and Efficient GPU Graph Library 3 | // ---------------------------------------------------------------------------- 4 | // This source code is distributed under the terms of LICENSE.TXT 5 | // in the root directory of this source distribution. 6 | // ---------------------------------------------------------------------------- 7 | 8 | /** 9 | * @file app.cuh 10 | * 11 | * @brief includes for _app.cuh files. 12 | */ 13 | 14 | #pragma once 15 | 16 | #include 17 | 18 | // Utilities and correctness-checking 19 | #include 20 | #include 21 | 22 | // Graph definations 23 | #include 24 | #include 25 | #include 26 | 27 | // Leave this at the end of the file 28 | // Local Variables: 29 | // mode:c++ 30 | // c-file-style: "NVIDIA" 31 | // End: 32 | -------------------------------------------------------------------------------- /gunrock/app/gcn/module.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by husong on 5/13/20. 3 | // 4 | 5 | #ifndef GUNROCK_MODULE_H 6 | #define GUNROCK_MODULE_H 7 | 8 | #include 9 | 10 | struct module { 11 | gunrock::util::GpuTimer timer; 12 | virtual ~module() = default; 13 | virtual void forward(bool) = 0; 14 | virtual void backward() = 0; 15 | virtual double GetLoss() { 16 | return 0; 17 | } 18 | }; 19 | 20 | #endif //GUNROCK_MODULE_H 21 | -------------------------------------------------------------------------------- /gunrock/app/gcn/relu/relu.cuh: -------------------------------------------------------------------------------- 1 | // 2 | // Created by husong on 5/13/20. 3 | // 4 | #ifndef RELU_H 5 | #define RELU_H 6 | 7 | #include 8 | #include 9 | 10 | using namespace gunrock; 11 | 12 | template 13 | struct relu : module { 14 | util::Array1D a, a_grad; 15 | util::Array1D keep; 16 | int len; 17 | float *fw_time, *bw_time; 18 | 19 | relu(util::Array1D &_a, util::Array1D &_a_grad, int _len, float *fw, float *bw) : 20 | a(_a), a_grad(_a_grad), len(_len), fw_time(fw), bw_time(bw) { 21 | keep.Allocate (a.GetSize (), util::DEVICE); 22 | }; 23 | 24 | virtual void forward(bool train) override { 25 | timer.Start (); 26 | dofw(train); 27 | timer.Stop (); 28 | *fw_time += timer.ElapsedMillis (); 29 | } 30 | 31 | virtual void backward() override { 32 | timer.Start (); 33 | dobw(); 34 | timer.Stop (); 35 | *bw_time += timer.ElapsedMillis (); 36 | } 37 | 38 | cudaError_t dofw(bool train) { 39 | cudaError_t retval = cudaSuccess; 40 | 41 | GUARD_CU(a.ForEach(keep, 42 | [train]__host__ __device__(ValueT &x, bool &k) { 43 | if (train) k = x > 0; 44 | if (!k) x = 0; 45 | }, a.GetSize (), util::DEVICE)) 46 | 47 | return retval; 48 | } 49 | 50 | cudaError_t dobw() { 51 | cudaError_t retval = cudaSuccess; 52 | 53 | GUARD_CU(a_grad.ForEach(keep, 54 | []__host__ __device__(ValueT &grad, bool &k) { 55 | if (!k) grad = 0; 56 | }, a_grad.GetSize (), util::DEVICE)) 57 | 58 | return retval; 59 | } 60 | }; 61 | 62 | #endif -------------------------------------------------------------------------------- /gunrock/app/hits/hits_app.cu: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------------------- 2 | // Gunrock -- Fast and Efficient GPU Graph Library 3 | // ---------------------------------------------------------------------------- 4 | // This source code is distributed under the terms of LICENSE.TXT 5 | // in the root directory of this source distribution. 6 | // ---------------------------------------------------------------------------- 7 | 8 | /** 9 | * @file hits_app.cu 10 | * 11 | * @brief HITS Gunrock Application 12 | */ 13 | 14 | #include 15 | 16 | namespace gunrock { 17 | namespace app { 18 | namespace hits { 19 | 20 | template 21 | cudaError_t UseParameters(ParametersT ¶meters) { 22 | cudaError_t retval = cudaSuccess; 23 | GUARD_CU(UseParameters_app(parameters)); 24 | GUARD_CU(UseParameters_problem(parameters)); 25 | GUARD_CU(UseParameters_enactor(parameters)); 26 | GUARD_CU(UseParameters_test(parameters)); 27 | 28 | return retval; 29 | } 30 | 31 | } // namespace hits 32 | } // namespace app 33 | } // namespace gunrock 34 | 35 | /* 36 | * @brief Simple interface take in graph as CSR format 37 | * @param[in] num_nodes Number of veritces in the input graph 38 | * @param[in] num_edges Number of edges in the input graph 39 | * @param[in] row_offsets CSR-formatted graph input row offsets 40 | * @param[in] col_indices CSR-formatted graph input column indices 41 | * @param[in] edge_values CSR-formatted graph input edge weights 42 | * @param[in] num_runs Number of runs to perform SM 43 | * @param[out] subgraphs Return number of subgraphs 44 | * \return double Return accumulated elapsed times for all runs 45 | */ 46 | double hits( 47 | const int num_nodes, 48 | const int num_edges, 49 | const int *row_offsets, 50 | const int *col_indices, 51 | const int num_iter, 52 | float *hub_ranks, 53 | float *auth_ranks) 54 | { 55 | return hits(num_nodes, num_edges, row_offsets, col_indices, 56 | num_iter, hub_ranks, auth_ranks); 57 | } 58 | 59 | // Leave this at the end of the file 60 | // Local Variables: 61 | // mode:c++ 62 | // c-file-style: "NVIDIA" 63 | // End: 64 | -------------------------------------------------------------------------------- /gunrock/oprtr/LB_CULL_advance/cta.cuh: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------- 2 | // Gunrock -- Fast and Efficient GPU Graph Library 3 | // ---------------------------------------------------------------- 4 | // This source code is distributed under the terms of LICENSE.TXT 5 | // in the root directory of this source distribution. 6 | // ---------------------------------------------------------------- 7 | 8 | /** 9 | * @file 10 | * cta.cuh 11 | * 12 | * @brief CTA tile-processing abstraction for Load balanced Edge Map 13 | */ 14 | 15 | #pragma once 16 | 17 | namespace gunrock { 18 | namespace oprtr { 19 | namespace LB_CULL {} // namespace LB_CULL 20 | } // namespace oprtr 21 | } // namespace gunrock 22 | 23 | // Leave this at the end of the file 24 | // Local Variables: 25 | // mode:c++ 26 | // c-file-style: "NVIDIA" 27 | // End: 28 | -------------------------------------------------------------------------------- /gunrock/oprtr/LB_advance/cta.cuh: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------- 2 | // Gunrock -- Fast and Efficient GPU Graph Library 3 | // ---------------------------------------------------------------- 4 | // This source code is distributed under the terms of LICENSE.TXT 5 | // in the root directory of this source distribution. 6 | // ---------------------------------------------------------------- 7 | 8 | /** 9 | * @file 10 | * cta.cuh 11 | * 12 | * @brief CTA tile-processing abstraction for Load balanced Edge Map 13 | */ 14 | 15 | #pragma once 16 | 17 | // TODO: use CUB for SOA scan 18 | 19 | namespace gunrock { 20 | namespace oprtr { 21 | namespace LB {} // namespace LB 22 | } // namespace oprtr 23 | } // namespace gunrock 24 | 25 | // Leave this at the end of the file 26 | // Local Variables: 27 | // mode:c++ 28 | // c-file-style: "NVIDIA" 29 | // End: 30 | -------------------------------------------------------------------------------- /gunrock/oprtr/simplified2_filter/cta.cuh: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------- 2 | // Gunrock -- Fast and Efficient GPU Graph Library 3 | // ---------------------------------------------------------------- 4 | // This source code is distributed under the terms of LICENSE.TXT 5 | // in the root directory of this source distribution. 6 | // ---------------------------------------------------------------- 7 | 8 | /** 9 | * @file 10 | * cta.cuh 11 | * 12 | * @brief CTA tile-processing abstraction for simplified filter 13 | */ 14 | 15 | #pragma once 16 | 17 | namespace gunrock { 18 | namespace oprtr { 19 | namespace simplified2_filter {} // namespace simplified2_filter 20 | } // namespace oprtr 21 | } // namespace gunrock 22 | 23 | // Leave this at the end of the file 24 | // Local Variables: 25 | // mode:c++ 26 | // c-file-style: "NVIDIA" 27 | // End 28 | -------------------------------------------------------------------------------- /gunrock/oprtr/simplified2_filter/kernel_policy.cuh: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------- 2 | // Gunrock -- Fast and Efficient GPU Graph Library 3 | // ---------------------------------------------------------------- 4 | // This source code is distributed under the terms of LICENSE.TXT 5 | // in the root directory of this source distribution. 6 | // ---------------------------------------------------------------- 7 | 8 | /** 9 | * @file 10 | * kernel_policy.cuh 11 | * 12 | * @brief Kernel configuration policy for simplified filter 13 | */ 14 | 15 | #pragma once 16 | 17 | // #include 18 | 19 | namespace gunrock { 20 | namespace oprtr { 21 | namespace simplified2_filter { 22 | 23 | template 32 | struct KernelPolicy 33 | : public gunrock::oprtr::cull_filter::KernelPolicy< 34 | _Problem, _SATURATION_QUIT, _DEQUEUE_PROBLEM_SIZE, 35 | _MIN_CTA_OCCUPANCY, _LOG_THREADS, _LOG_LOAD_VEC_SIZE, 36 | _LOG_LOADS_PER_TILE, _LOG_RAKING_THREADS, _END_BITMASK_CULL, 37 | _LOG_SCHEDULE_GRANULARITY, _MODE> { 38 | enum { 39 | MODE = _MODE, 40 | }; 41 | }; 42 | 43 | } // namespace simplified2_filter 44 | } // namespace oprtr 45 | } // namespace gunrock 46 | 47 | // Leave this at the end of the file 48 | // Local Variables: 49 | // mode:c++ 50 | // c-file-style: "NVIDIA" 51 | // End 52 | -------------------------------------------------------------------------------- /gunrock/oprtr/simplified_filter/cta.cuh: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------- 2 | // Gunrock -- Fast and Efficient GPU Graph Library 3 | // ---------------------------------------------------------------- 4 | // This source code is distributed under the terms of LICENSE.TXT 5 | // in the root directory of this source distribution. 6 | // ---------------------------------------------------------------- 7 | 8 | /** 9 | * @file 10 | * cta.cuh 11 | * 12 | * @brief CTA tile-processing abstraction for simplified filter 13 | */ 14 | 15 | #pragma once 16 | 17 | namespace gunrock { 18 | namespace oprtr { 19 | namespace simplified_filter {} // namespace simplified_filter 20 | } // namespace oprtr 21 | } // namespace gunrock 22 | 23 | // Leave this at the end of the file 24 | // Local Variables: 25 | // mode:c++ 26 | // c-file-style: "NVIDIA" 27 | // End 28 | -------------------------------------------------------------------------------- /gunrock/oprtr/simplified_filter/kernel_policy.cuh: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------- 2 | // Gunrock -- Fast and Efficient GPU Graph Library 3 | // ---------------------------------------------------------------- 4 | // This source code is distributed under the terms of LICENSE.TXT 5 | // in the root directory of this source distribution. 6 | // ---------------------------------------------------------------- 7 | 8 | /** 9 | * @file 10 | * kernel_policy.cuh 11 | * 12 | * @brief Kernel configuration policy for simplified filter 13 | */ 14 | 15 | #pragma once 16 | 17 | // #include 18 | 19 | namespace gunrock { 20 | namespace oprtr { 21 | namespace simplified_filter { 22 | 23 | template 32 | struct KernelPolicy 33 | : public gunrock::oprtr::cull_filter::KernelPolicy< 34 | _Problem, _SATURATION_QUIT, _DEQUEUE_PROBLEM_SIZE, 35 | _MIN_CTA_OCCUPANCY, _LOG_THREADS, _LOG_LOAD_VEC_SIZE, 36 | _LOG_LOADS_PER_TILE, _LOG_RAKING_THREADS, _END_BITMASK_CULL, 37 | _LOG_SCHEDULE_GRANULARITY, _MODE> { 38 | enum { 39 | MODE = _MODE, 40 | }; 41 | }; 42 | 43 | } // namespace simplified_filter 44 | } // namespace oprtr 45 | } // namespace gunrock 46 | 47 | // Leave this at the end of the file 48 | // Local Variables: 49 | // mode:c++ 50 | // c-file-style: "NVIDIA" 51 | // End 52 | -------------------------------------------------------------------------------- /gunrock/partitioner/duplicate.cuh: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------- 2 | // Gunrock -- Fast and Efficient GPU Graph Library 3 | // ---------------------------------------------------------------- 4 | // This source code is distributed under the terms of LICENSE.TXT 5 | // in the root directory of this source distribution. 6 | // ---------------------------------------------------------------- 7 | 8 | /** 9 | * @file 10 | * dup_partitioner.cuh 11 | * 12 | * @brief Implementation of random partitioner 13 | */ 14 | 15 | #pragma once 16 | 17 | #include 18 | 19 | namespace gunrock { 20 | namespace partitioner { 21 | namespace duplicate { 22 | 23 | template 24 | cudaError_t Partition(GraphT &org_graph, GraphT *&sub_graphs, 25 | util::Parameters ¶meters, int num_subgraphs = 1, 26 | PartitionFlag flag = PARTITION_NONE, 27 | util::Location target = util::HOST, 28 | float *weitage = NULL) { 29 | typedef typename GraphT::VertexT VertexT; 30 | typedef typename GraphT::SizeT SizeT; 31 | typedef typename GraphT::GpT GpT; 32 | 33 | cudaError_t retval = cudaSuccess; 34 | auto &partition_table = org_graph.partition_table; 35 | 36 | partition_table[0] = 0; 37 | SizeT org_nodes = (org_graph.nodes - 1) / num_subgraphs; 38 | // printf("org_nodes = %lld\n", (long long)org_nodes); 39 | for (int i = 0; i < num_subgraphs; i++) { 40 | VertexT base_v = 1 + org_nodes * i; 41 | for (VertexT org_v = 0; org_v < org_nodes; org_v++) { 42 | partition_table[base_v + org_v] = i; 43 | } 44 | } 45 | 46 | return retval; 47 | } 48 | 49 | } // namespace duplicate 50 | } // namespace partitioner 51 | } // namespace gunrock 52 | 53 | // Leave this at the end of the file 54 | // Local Variables: 55 | // mode:c++ 56 | // c-file-style: "NVIDIA" 57 | // End: 58 | -------------------------------------------------------------------------------- /gunrock/partitioner/static.cuh: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------- 2 | // Gunrock -- Fast and Efficient GPU Graph Library 3 | // ---------------------------------------------------------------- 4 | // This source code is distributed under the terms of LICENSE.TXT 5 | // in the root directory of this source distribution. 6 | // ---------------------------------------------------------------- 7 | 8 | /** 9 | * @file 10 | * rp_partitioner.cuh 11 | * 12 | * @brief Implementation of random partitioner 13 | */ 14 | 15 | #pragma once 16 | 17 | #include 18 | 19 | namespace gunrock { 20 | namespace partitioner { 21 | namespace static_p { 22 | 23 | template 24 | cudaError_t Partition(GraphT &org_graph, GraphT *&sub_graphs, 25 | util::Parameters ¶meters, int num_subgraphs = 1, 26 | PartitionFlag flag = PARTITION_NONE, 27 | util::Location target = util::HOST, 28 | float *weitage = NULL) { 29 | typedef typename GraphT::VertexT VertexT; 30 | typedef typename GraphT::GpT GpT; 31 | 32 | cudaError_t retval = cudaSuccess; 33 | auto &partition_table = org_graph.GpT::partition_table; 34 | 35 | for (VertexT v = 0; v < org_graph.nodes; v++) 36 | partition_table[v] = (v % num_subgraphs); 37 | 38 | return retval; 39 | } 40 | 41 | } // namespace static_p 42 | } // namespace partitioner 43 | } // namespace gunrock 44 | 45 | // Leave this at the end of the file 46 | // Local Variables: 47 | // mode:c++ 48 | // c-file-style: "NVIDIA" 49 | // End: 50 | -------------------------------------------------------------------------------- /gunrock/priority_queue/kernel_policy.cuh: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------- 2 | // Gunrock -- Fast and Efficient GPU Graph Library 3 | // ---------------------------------------------------------------- 4 | // This source code is distributed under the terms of LICENSE.TXT 5 | // in the root directory of this source distribution. 6 | // ---------------------------------------------------------------- 7 | 8 | /** 9 | * @file 10 | * kernel_policy.cuh 11 | * 12 | * @brief Kernel configuration policy for Priority Queue Kernel 13 | */ 14 | 15 | #pragma once 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | #include 27 | 28 | namespace gunrock { 29 | namespace priority_queue { 30 | 31 | template 33 | 34 | struct KernelPolicy { 35 | typedef _ProblemData ProblemData; 36 | typedef typename ProblemData::VertexId VertexId; 37 | typedef typename ProblemData::SizeT SizeT; 38 | 39 | enum { 40 | 41 | CUDA_ARCH = _CUDA_ARCH, 42 | INSTRUMENT = _INSTRUMENT, 43 | 44 | LOG_THREADS = _LOG_THREADS, 45 | THREADS = 1 << LOG_THREADS, 46 | LOG_BLOCKS = _LOG_BLOCKS, 47 | BLOCKS = 1 << LOG_BLOCKS, 48 | }; 49 | }; 50 | 51 | } // namespace priority_queue 52 | } // namespace gunrock 53 | 54 | // Leave this at the end of the file 55 | // Local Variables: 56 | // mode:c++ 57 | // c-file-style: "NVIDIA" 58 | // End: 59 | -------------------------------------------------------------------------------- /gunrock/util/gitsha1.c.in: -------------------------------------------------------------------------------- 1 | #define GIT_SHA1 "@GIT_SHA1@" 2 | const char g_GIT_SHA1[] = GIT_SHA1; 3 | -------------------------------------------------------------------------------- /gunrock/util/gitsha1.h: -------------------------------------------------------------------------------- 1 | extern const char g_GIT_SHA1[]; 2 | -------------------------------------------------------------------------------- /gunrock/util/gitsha1make.c: -------------------------------------------------------------------------------- 1 | #ifndef GIT_SHA1 2 | #define GIT_SHA1 "GIT-SHA-NOT-FOUND" 3 | #endif 4 | 5 | const char g_GIT_SHA1[] = GIT_SHA1; 6 | -------------------------------------------------------------------------------- /gunrock/util/io/cub_io.cuh: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------- 2 | // Gunrock -- Fast and Efficient GPU Graph Library 3 | // ---------------------------------------------------------------- 4 | // This source code is distributed under the terms of LICENSE.TXT 5 | // in the root directory of this source distribution. 6 | // ---------------------------------------------------------------- 7 | 8 | /** 9 | * @file 10 | * cub_io.cuh 11 | * 12 | * @brief Warpers to use cub io functions 13 | */ 14 | 15 | #pragma once 16 | 17 | #include 18 | 19 | namespace gunrock { 20 | 21 | template < 22 | cub::CacheLoadModifier MODIFIER = cub::CacheLoadModifier::LOAD_DEFAULT, 23 | typename T> 24 | __device__ __host__ __forceinline__ T Load(T* ptr) { 25 | #ifdef __CUDA_ARCH__ 26 | return cub::ThreadLoad(ptr); 27 | #else 28 | return *ptr; 29 | #endif 30 | } 31 | 32 | template < 33 | cub::CacheStoreModifier MODIFIER = cub::CacheStoreModifier::STORE_DEFAULT, 34 | typename T> 35 | __device__ __host__ __forceinline__ void Store(T* ptr, const T& val) { 36 | #ifdef __CUDA_ARCH__ 37 | cub::ThreadStore(ptr, val); 38 | #else 39 | *ptr = val; 40 | #endif 41 | } 42 | 43 | } // namespace gunrock 44 | 45 | // Leave this at the end of the file 46 | // Local Variables: 47 | // mode:c++ 48 | // c-file-style: "NVIDIA" 49 | // End: 50 | -------------------------------------------------------------------------------- /gunrock/util/json_spirit_writer_options.h: -------------------------------------------------------------------------------- 1 | #ifndef JSON_SPIRIT_WRITER_OPTIONS 2 | #define JSON_SPIRIT_WRITER_OPTIONS 3 | 4 | // Copyright John W. Wilkinson 2007 - 2014 5 | // Distributed under the MIT License, see accompanying file LICENSE.txt 6 | 7 | // json spirit version 4.08 8 | 9 | #if defined(_MSC_VER) && (_MSC_VER >= 1020) 10 | #pragma once 11 | #endif 12 | 13 | namespace json_spirit { 14 | enum Output_options { 15 | none = 0, // default options 16 | 17 | pretty_print = 0x01, // Add whitespace to format the output nicely. 18 | 19 | raw_utf8 = 0x02, // This prevents non-printable characters from being 20 | // escapted using "\uNNNN" notation. Note, this is an 21 | // extension to the JSON standard. It disables the escaping 22 | // of non-printable characters allowing UTF-8 sequences held 23 | // in 8 bit char strings to pass through unaltered. 24 | 25 | remove_trailing_zeros = 0x04, 26 | // no longer used kept for backwards compatibility 27 | single_line_arrays = 0x08, 28 | // pretty printing except that arrays printed on single lines unless they 29 | // contain composite elements, i.e. objects or arrays 30 | always_escape_nonascii = 0x10, 31 | // all unicode wide characters are escaped, i.e. outputed as "\uXXXX", even if 32 | // they are printable under the current locale, ascii printable chars are not 33 | // escaped 34 | }; 35 | } 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /gunrock/util/misc_utils.cu: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------- 2 | // Gunrock -- Fast and Efficient GPU Graph Library 3 | // ---------------------------------------------------------------- 4 | // This source code is distributed under the terms of LICENSE.TXT 5 | // in the root directory of this source distribution. 6 | // ---------------------------------------------------------------- 7 | 8 | /** 9 | * @file 10 | * misc_utils.cu 11 | * 12 | * @brief Misc. Utility Routines (source) 13 | */ 14 | #include "misc_utils.cuh" 15 | 16 | #ifdef __clang__ 17 | #ifdef __APPLE__ 18 | int pthread_barrier_init(pthread_barrier_t *barrier, 19 | const pthread_barrierattr_t *attr, 20 | unsigned int count) { 21 | if (count == 0) { 22 | errno = EINVAL; 23 | return -1; 24 | } 25 | if (pthread_mutex_init(&barrier->mutex, 0) < 0) { 26 | return -1; 27 | } 28 | if (pthread_cond_init(&barrier->cond, 0) < 0) { 29 | pthread_mutex_destroy(&barrier->mutex); 30 | return -1; 31 | } 32 | barrier->tripCount = count; 33 | barrier->count = 0; 34 | 35 | return 0; 36 | } 37 | 38 | int pthread_barrier_destroy(pthread_barrier_t *barrier) { 39 | pthread_cond_destroy(&barrier->cond); 40 | pthread_mutex_destroy(&barrier->mutex); 41 | return 0; 42 | } 43 | 44 | int pthread_barrier_wait(pthread_barrier_t *barrier) { 45 | pthread_mutex_lock(&barrier->mutex); 46 | ++(barrier->count); 47 | if (barrier->count >= barrier->tripCount) { 48 | barrier->count = 0; 49 | pthread_cond_broadcast(&barrier->cond); 50 | pthread_mutex_unlock(&barrier->mutex); 51 | return 1; 52 | } else { 53 | pthread_cond_wait(&barrier->cond, &(barrier->mutex)); 54 | pthread_mutex_unlock(&barrier->mutex); 55 | return 0; 56 | } 57 | } 58 | #endif 59 | #endif 60 | -------------------------------------------------------------------------------- /gunrock/util/misc_utils.cuh: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------- 2 | // Gunrock -- Fast and Efficient GPU Graph Library 3 | // ---------------------------------------------------------------- 4 | // This source code is distributed under the terms of LICENSE.TXT 5 | // in the root directory of this source distribution. 6 | // ---------------------------------------------------------------- 7 | 8 | /** 9 | * @file 10 | * misc_utils.cuh 11 | * 12 | * @brief Misc. Utility Routines (header) 13 | */ 14 | 15 | #ifndef MISC_UTILS_H 16 | #define MISC_UTILS_H 17 | 18 | // Pthread code based on: 19 | // http://blog.albertarmea.com/post/47089939939/using-pthread-barrier-on-mac-os-x 20 | // Apple/clang does not support these pthread calls. Thus they will 21 | // only be included and linked if it's Apple/clang. 22 | 23 | #include 24 | #include 25 | 26 | #ifdef __APPLE__ 27 | #ifdef __clang__ 28 | typedef int pthread_barrierattr_t; 29 | typedef struct { 30 | pthread_mutex_t mutex; 31 | pthread_cond_t cond; 32 | int count; 33 | int tripCount; 34 | } pthread_barrier_t; 35 | 36 | int pthread_barrier_init(pthread_barrier_t *barrier, 37 | const pthread_barrierattr_t *attr, unsigned int count); 38 | int pthread_barrier_destroy(pthread_barrier_t *barrier); 39 | int pthread_barrier_wait(pthread_barrier_t *barrier); 40 | #endif 41 | #endif 42 | 43 | #endif // MISC_UTILS_H 44 | -------------------------------------------------------------------------------- /gunrock/util/numeric_traits.cuh: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------- 2 | // Gunrock -- Fast and Efficient GPU Graph Library 3 | // ---------------------------------------------------------------- 4 | // This source code is distributed under the terms of LICENSE.TXT 5 | // in the root directory of this source distribution. 6 | // ---------------------------------------------------------------- 7 | 8 | /** 9 | * @file 10 | * numeric_traits.cuh 11 | * 12 | * @brief Type traits for numeric types 13 | */ 14 | 15 | #pragma once 16 | 17 | namespace gunrock { 18 | namespace util { 19 | 20 | enum Representation { 21 | NOT_A_NUMBER, 22 | SIGNED_INTEGER, 23 | UNSIGNED_INTEGER, 24 | FLOATING_POINT 25 | }; 26 | 27 | template 28 | struct BaseTraits { 29 | static const Representation REPRESENTATION = R; 30 | }; 31 | 32 | // Default, non-numeric types 33 | template 34 | struct NumericTraits : BaseTraits {}; 35 | 36 | template <> 37 | struct NumericTraits : BaseTraits {}; 38 | template <> 39 | struct NumericTraits : BaseTraits {}; 40 | template <> 41 | struct NumericTraits : BaseTraits {}; 42 | template <> 43 | struct NumericTraits : BaseTraits {}; 44 | template <> 45 | struct NumericTraits : BaseTraits {}; 46 | template <> 47 | struct NumericTraits : BaseTraits {}; 48 | 49 | template <> 50 | struct NumericTraits : BaseTraits {}; 51 | template <> 52 | struct NumericTraits : BaseTraits {}; 53 | template <> 54 | struct NumericTraits : BaseTraits {}; 55 | template <> 56 | struct NumericTraits : BaseTraits {}; 57 | template <> 58 | struct NumericTraits : BaseTraits {}; 59 | 60 | template <> 61 | struct NumericTraits : BaseTraits {}; 62 | template <> 63 | struct NumericTraits : BaseTraits {}; 64 | 65 | } // namespace util 66 | } // namespace gunrock 67 | -------------------------------------------------------------------------------- /gunrock/util/operators.cuh: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------- 2 | // Gunrock -- Fast and Efficient GPU Graph Library 3 | // ---------------------------------------------------------------- 4 | // This source code is distributed under the terms of LICENSE.TXT 5 | // in the root directory of this source distribution. 6 | // ---------------------------------------------------------------- 7 | 8 | /** 9 | * @file 10 | * opearators.cuh 11 | * 12 | * @brief Simple Reduction Operators 13 | */ 14 | 15 | #pragma once 16 | 17 | namespace gunrock { 18 | namespace util { 19 | 20 | /** 21 | * Static operator wrapping structure. 22 | * 23 | * (N.B. due to an NVCC/cudafe 4.0 regression, we can't specify static templated 24 | * functions inside other types...) 25 | */ 26 | template 27 | struct Operators { 28 | // Empty default transform function 29 | static __device__ __forceinline__ void NopTransform(T &val) {} 30 | }; 31 | 32 | /** 33 | * Default equality functor 34 | */ 35 | template 36 | struct Equality { 37 | __host__ __device__ __forceinline__ bool operator()(const T &a, const T &b) { 38 | return a == b; 39 | } 40 | }; 41 | 42 | /** 43 | * Default sum functor 44 | */ 45 | template 46 | struct Sum { 47 | // Binary reduction 48 | __host__ __device__ __forceinline__ T operator()(const T &a, const T &b) { 49 | return a + b; 50 | } 51 | 52 | // Identity 53 | __host__ __device__ __forceinline__ T operator()() { return (T)0; } 54 | }; 55 | 56 | } // namespace util 57 | } // namespace gunrock 58 | -------------------------------------------------------------------------------- /gunrock/util/scan_device.cuh: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------- 2 | // Gunrock -- Fast and Efficient GPU Graph Library 3 | // ---------------------------------------------------------------- 4 | // This source code is distributed under the terms of LICENSE.TXT 5 | // in the root directory of this source distribution. 6 | // ---------------------------------------------------------------- 7 | 8 | /** 9 | * @file 10 | * scan_utils.cuh 11 | * 12 | * @brief kenel utils used for a device scan. 13 | */ 14 | 15 | #pragma once 16 | #include 17 | #include 18 | 19 | namespace gunrock { 20 | namespace util { 21 | 22 | /** 23 | * \addtogroup PublicInterface 24 | * @{ 25 | */ 26 | 27 | //--------------------------------------------------------------------- 28 | // Globals, constants and typedefs 29 | //--------------------------------------------------------------------- 30 | 31 | template 32 | cudaError_t cubInclusiveSum(util::Array1D &cub_temp_space, 33 | util::Array1D &d_in, 34 | util::Array1D &d_out, 35 | SizeT num_items, cudaStream_t stream = 0, 36 | bool debug_synchronous = false) { 37 | cudaError_t retval = cudaSuccess; 38 | size_t request_bytes = 0; 39 | 40 | retval = cub::DeviceScan::InclusiveSum( 41 | NULL, request_bytes, d_in.GetPointer(util::DEVICE), 42 | d_out.GetPointer(util::DEVICE), num_items, stream, debug_synchronous); 43 | 44 | if (retval) return retval; 45 | 46 | retval = cub_temp_space.EnsureSize_(request_bytes, util::DEVICE); 47 | if (retval) return retval; 48 | 49 | retval = cub::DeviceScan::InclusiveSum( 50 | cub_temp_space.GetPointer(util::DEVICE), request_bytes, 51 | d_in.GetPointer(util::DEVICE), d_out.GetPointer(util::DEVICE), num_items, 52 | stream, debug_synchronous); 53 | 54 | if (retval) return retval; 55 | 56 | return retval; 57 | } 58 | 59 | /** @} */ 60 | 61 | } // namespace util 62 | } // namespace gunrock 63 | 64 | // Leave this at the end of the file 65 | // Local Variables: 66 | // mode:c++ 67 | // c-file-style: "NVIDIA" 68 | // End: 69 | -------------------------------------------------------------------------------- /gunrock/util/test_utils.cu: -------------------------------------------------------------------------------- 1 | // ---------------------------------------------------------------- 2 | // Gunrock -- Fast and Efficient GPU Graph Library 3 | // ---------------------------------------------------------------- 4 | // This source code is distributed under the terms of LICENSE.TXT 5 | // in the root directory of this source distribution. 6 | // ---------------------------------------------------------------- 7 | 8 | /** 9 | * @file 10 | * test_utils.cu 11 | * 12 | * @brief Utility Routines for Tests 13 | */ 14 | #include 15 | #include 16 | 17 | namespace gunrock { 18 | namespace util { 19 | 20 | /****************************************************************************** 21 | * Device initialization 22 | ******************************************************************************/ 23 | 24 | void DeviceInit(CommandLineArgs &args) { 25 | int deviceCount; 26 | cudaGetDeviceCount(&deviceCount); 27 | if (deviceCount == 0) { 28 | fprintf(stderr, "No devices supporting CUDA.\n"); 29 | exit(1); 30 | } 31 | std::vector devs; 32 | args.GetCmdLineArguments("device", devs); 33 | if (devs.size() == 0) 34 | for (int i = 0; i < deviceCount; i++) devs.push_back(i); 35 | else if (devs.size() == 1) { 36 | if (devs[0] < 0) { 37 | devs[0] = 0; 38 | } 39 | if (devs[0] > deviceCount - 1) { 40 | devs[0] = deviceCount - 1; 41 | } 42 | } 43 | for (unsigned long i = 0; i < devs.size(); i++) { 44 | cudaDeviceProp deviceProp; 45 | cudaGetDeviceProperties(&deviceProp, devs[i]); 46 | if (deviceProp.major < 1) { 47 | fprintf(stderr, "Device does not support CUDA.\n"); 48 | exit(1); 49 | } 50 | if (!args.CheckCmdLineFlag("quiet")) { 51 | printf("Using device %d: %s\n", devs[i], deviceProp.name); 52 | } 53 | } 54 | cudaSetDevice(devs[0]); 55 | } 56 | 57 | cudaError_t SetDevice(int dev) { 58 | return util::GRError(cudaSetDevice(dev), "cudaSetDevice failed.", __FILE__, 59 | __LINE__); 60 | } 61 | 62 | } // namespace util 63 | } // namespace gunrock 64 | -------------------------------------------------------------------------------- /python/pagerank.py: -------------------------------------------------------------------------------- 1 | ### sample python interface - pagerank 2 | 3 | from ctypes import * 4 | 5 | ### load gunrock shared library - libgunrock 6 | gunrock = cdll.LoadLibrary('../build/lib/libgunrock.so') 7 | ### read in input CSR arrays from files 8 | row_list = [int(x.strip()) for x in open('toy_graph/row.txt')] 9 | col_list = [int(x.strip()) for x in open('toy_graph/col.txt')] 10 | print 'set pointers' 11 | ### convert CSR graph inputs for gunrock input 12 | row = pointer((c_int * len(row_list))(*row_list)) 13 | col = pointer((c_int * len(col_list))(*col_list)) 14 | nodes = len(row_list) - 1 15 | edges = len(col_list) 16 | 17 | ### output array 18 | node = pointer((c_int * nodes)()) 19 | rank = pointer((c_float * nodes)()) 20 | 21 | normalize = 1 22 | print 'run gunrock' 23 | ### call gunrock function on device 24 | elapsed = gunrock.pagerank(nodes, edges, row, col, normalize, node, rank) 25 | 26 | ### sample results 27 | print 'elapsed: ' + str(elapsed) 28 | print 'top page rank:' 29 | for idx in range(nodes): 30 | print node[0][idx], 31 | print rank[0][idx] 32 | -------------------------------------------------------------------------------- /python/toy_graph/col.txt: -------------------------------------------------------------------------------- 1 | 1 2 | 2 3 | 3 4 | 0 5 | 2 6 | 4 7 | 0 8 | 1 9 | 3 10 | 4 11 | 5 12 | 0 13 | 2 14 | 5 15 | 6 16 | 1 17 | 2 18 | 5 19 | 6 20 | 2 21 | 3 22 | 4 23 | 6 24 | 3 25 | 4 26 | 5 27 | -------------------------------------------------------------------------------- /python/toy_graph/row.txt: -------------------------------------------------------------------------------- 1 | 0 2 | 3 3 | 6 4 | 11 5 | 15 6 | 19 7 | 23 8 | 26 9 | -------------------------------------------------------------------------------- /python/toy_graph/val.txt: -------------------------------------------------------------------------------- 1 | 3 2 | 4 3 | 5 4 | 3 5 | 5 6 | 7 7 | 4 8 | 5 9 | 7 10 | 8 11 | 9 12 | 5 13 | 7 14 | 10 15 | 11 16 | 7 17 | 8 18 | 11 19 | 12 20 | 9 21 | 10 22 | 11 23 | 13 24 | 11 25 | 12 26 | 13 27 | -------------------------------------------------------------------------------- /scripts/v0.5.x/ipdps17/Makefile: -------------------------------------------------------------------------------- 1 | ALGOS = bfs sssp bc cc pr 2 | 3 | all : 4 | for algo in $(ALGOS); do cd ../../../tests/$$algo; $(MAKE); cd ../../dataset/test-scripts/ipdps17; done 5 | 6 | .DEFAULT_GOAL := all 7 | -------------------------------------------------------------------------------- /scripts/v0.5.x/ipdps17/run_fig2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | NVCC="$(which nvcc)" 4 | NVCC_VERSION=$($NVCC --version | grep release | sed 's/.*release //' | sed 's/,.*//') 5 | GPU="k40c" 6 | 7 | FIGURE="fig2" 8 | GUNROCK_DIR="../../.." 9 | DATADIR="$GUNROCK_DIR/dataset/large" 10 | PARTITIONERS="random biasrandom metis" 11 | LOGDIR="eval_$FIGURE" 12 | BASEOPTION="--undirected --iteration-num=16 --tag=ipdps17_$FIGURE --jsondir=$LOGDIR" 13 | BASEFLAG=".undir.32bitSizeT" 14 | 15 | ALGO[0]="bfs" 16 | OPTION[0]="--idempotence --direction-optimized --src=largestdegree --traversal-mode=LB_CULL --queue-sizing=6.5 --in-sizing=4" 17 | FLAG[0]=".skip_pred.idempotence.LB_CULL.do" 18 | 19 | ALGO[1]="bfs" 20 | OPTION[1]="--idempotence --src=largestdegree --traversal-mode=LB_CULL --queue-sizing=6.5 --in-sizing=4" 21 | FLAG[1]=".skip_pred.idempotence.LB_CULL.fw" 22 | 23 | ALGO[2]="pr" 24 | OPTION[2]="--normalized --quick --traversal-mode=LB" 25 | FLAG[2]=".normalized.nocomp" 26 | 27 | for k in {0..2} 28 | do 29 | EXECUTION[k]="$GUNROCK_DIR/tests/${ALGO[k]}/bin/test_${ALGO[k]}_${NVCC_VERSION}_x86_64" 30 | done 31 | 32 | NAME[0]="kron_g500-logn21" && DO_A[0]="0.00001" && DO_B[0]="0.1" 33 | NAME[1]="soc-orkut" && DO_A[1]="0.012" && DO_B[1]="0.1" 34 | NAME[2]="uk-2002" && DO_A[2]="16" && DO_B[2]="100" 35 | 36 | for i in {0..2} 37 | do 38 | GRAPH[$i]="market $DATADIR/${NAME[$i]}/${NAME[$i]}.mtx" 39 | done 40 | 41 | mkdir -p $LOGDIR 42 | 43 | for k in {0..2}; do for partitioner in $PARTITIONERS; do for i in {0..2}; do for d in 1 4; do 44 | DEVICE="0" 45 | for j in {1..8} 46 | do 47 | if [ "$j" -lt "$d" ]; then 48 | DEVICE=$DEVICE",$j" 49 | fi 50 | done 51 | 52 | Comm="${EXECUTION[$k]} ${GRAPH[$i]} $BASEOPTION ${OPTION[$k]} --partition-method=$partitioner --device=$DEVICE --do_a=${DO_A[$i]} --do_b=${DO_B[$i]} " 53 | LogFile="$LOGDIR/${ALGO[$k]}.${GPU}x$d.${NAME[$i]}${BASEFLAG}${FLAG[$k]}.$partitioner.txt" 54 | echo ${Comm} "> $LogFile 2>&1" 55 | ${Comm} > $LogFile 2>&1 56 | 57 | done;done;done;done 58 | -------------------------------------------------------------------------------- /scripts/v0.5.x/ipdps17/run_fig3.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | NVCC="$(which nvcc)" 4 | NVCC_VERSION=$($NVCC --version | grep release | sed 's/.*release //' | sed 's/,.*//') 5 | GPU="k40c" 6 | 7 | ALGO="bfs" 8 | FIGURE="fig3" 9 | GUNROCK_DIR="../../.." 10 | DATADIR="$GUNROCK_DIR/dataset/large" 11 | EXECUTION="$GUNROCK_DIR/tests/${ALGO}/bin/test_${ALGO}_${NVCC_VERSION}_x86_64" 12 | LOGDIR="eval_$FIGURE" 13 | BASEOPTION="--undirected --iteration-num=16 --tag=ipdps17_$FIGURE --jsondir=$LOGDIR --idempotence --src=largestdegree" 14 | BASEFLAG=".undir.32bitSizeT.skip_pred.idempotence" 15 | 16 | OPTION[0]="--traversal-mode=LB --queue-sizing=0 --in-sizing=0" 17 | FLAG[0]=".LB.just-enough" 18 | 19 | OPTION[1]="--traversal-mode=LB" 20 | FLAG[1]=".LB.fixed" 21 | 22 | OPTION[2]="--traversal-mode=LB --in-sizing=4" 23 | FLAG[2]=".LB.max" 24 | 25 | OPTION[3]="--traversal-mode=LB_CULL --queue-sizing=1.2 --in-sizing=1" 26 | FLAG[3]=".LB_CULL.prealloc" 27 | 28 | NAME[0]="kron_g500-logn21" && DO_A[0]="0.00001" && DO_B[0]="0.1" 29 | NAME[1]="soc-orkut" && DO_A[1]="0.012" && DO_B[1]="0.1" 30 | NAME[2]="uk-2002" && DO_A[2]="16" && DO_B[2]="100" 31 | 32 | Q[0]="75" && Q_IN[0]="1" && MAX_Q[0]="90" 33 | Q[1]="37" && Q_IN[1]="0.4" && MAX_Q[1]="72" 34 | Q[2]="13" && Q_IN[2]="0.5" && MAX_Q[2]="29" 35 | 36 | for i in {0..2} 37 | do 38 | GRAPH[$i]="market $DATADIR/${NAME[$i]}/${NAME[$i]}.mtx" 39 | done 40 | 41 | mkdir -p $LOGDIR 42 | 43 | for k in {0..3}; do for i in {0..2}; do for d in 4; do 44 | DEVICE="0" 45 | for j in {1..8} 46 | do 47 | if [ "$j" -lt "$d" ]; then 48 | DEVICE=$DEVICE",$j" 49 | fi 50 | done 51 | 52 | Comm="${EXECUTION} ${GRAPH[$i]} $BASEOPTION ${OPTION[$k]} --device=$DEVICE" 53 | if [ "$k" -eq "1" ]; then 54 | Comm="$Comm --queue-sizing=${Q[$i]} --in-sizing=${Q_IN[$i]}" 55 | fi 56 | if [ "$k" -eq "2" ]; then 57 | Comm="$Comm --queue-sizing=${MAX_Q[$i]}" 58 | fi 59 | LogFile="$LOGDIR/${ALGO}.${GPU}x$d.${NAME[$i]}${BASEFLAG}${FLAG[$k]}.txt" 60 | 61 | echo ${Comm} "> $LogFile 2>&1" 62 | ${Comm} > $LogFile 2>&1 63 | sleep 1 64 | done;done;done 65 | -------------------------------------------------------------------------------- /scripts/v0.5.x/performance/bc-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | EXEDIR="../../../build/bin" 4 | EXECUTION="bc" 5 | 6 | DATADIR="/data/gunrock_dataset/large" 7 | DATAHUGE="/data/gunrock_dataset/huge" 8 | 9 | SETTING[0]=" --src=0 --iteration-num=10 --traversal-mode=LB_CULL --in-sizing=1.1 --queue-sizing=1.2 --quick" 10 | SETTING[1]=" --src=largestdegree --iteration-num=10 --traversal-mode=LB_CULL --in-sizing=1.1 --queue-sizing=1.2 --quick" 11 | 12 | NAME[0]="cit-Patents" 13 | NAME[1]="soc-LiveJournal1" 14 | NAME[2]="soc-twitter-2010" 15 | NAME[3]="uk-2002" 16 | NAME[4]="uk-2005" 17 | NAME[5]="kron_g500-logn21" 18 | NAME[6]="twitter_rv.net" 19 | NAME[7]="rmat_n24_e16" 20 | 21 | GRAPH[0]="market $DATADIR/${NAME[0]}/${NAME[0]}.mtx" 22 | GRAPH[1]="market $DATADIR/${NAME[1]}/${NAME[1]}.mtx" 23 | GRAPH[2]="market $DATADIR/${NAME[2]}/${NAME[2]}.mtx" 24 | GRAPH[3]="market $DATADIR/${NAME[3]}/${NAME[3]}.mtx" 25 | GRAPH[4]="market $DATADIR/${NAME[4]}/${NAME[4]}.mtx" 26 | GRAPH[5]="market $DATADIR/${NAME[5]}/${NAME[5]}.mtx" 27 | GRAPH[6]="market $DATAHUGE/${NAME[6]}/${NAME[6]}.mtx --64bit-SizeT" 28 | GRAPH[7]="grmat --rmat_scale=24 --rmat_edgefactor=16" 29 | 30 | mkdir -p eval 31 | DEVICE="0" 32 | for j in {0..1} 33 | do 34 | for i in {0..8} 35 | do 36 | echo $EXECUTION ${GRAPH[$i]} ${SETTING[$j]} --device=$DEVICE --jsondir=./eval/ 37 | $EXEDIR/$EXECUTION ${GRAPH[$i]} ${SETTING[$j]} --device=$DEVICE --jsondir=./eval/ > ./eval/${NAME[$i]}.$EXECUTION.output.txt 38 | sleep 1 39 | done 40 | done 41 | -------------------------------------------------------------------------------- /scripts/v0.5.x/performance/bfs-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | EXEDIR="../../../build/bin" 4 | EXECUTION="bfs" 5 | 6 | DATADIR="/data/gunrock_dataset/large" 7 | DATAHUGE="/data/gunrock_dataset/huge" 8 | 9 | SETTING[0]=" --src=0 --undirected --idempotence --queue-sizing=6.5 --in-sizing=4 --iteration-num=10 --direction-optimized" 10 | SETTING[1]=" --src=0 --idempotence --queue-sizing=6.5 --in-sizing=4 --iteration-num=10 --direction-optimized" 11 | 12 | 13 | NAME[0]="cit-Patents" && DO_A[0]="2" && DO_B[0]="0.00005" && T_MODE[0]="LB_CULL" && DEVICE[0]="0" 14 | NAME[1]="soc-LiveJournal1" && DO_A[1]="0.200" && DO_B[1]="0.1" && T_MODE[1]="LB_CULL" && DEVICE[1]="0" 15 | NAME[2]="soc-twitter-2010" && DO_A[2]="0.005" && DO_B[2]="0.1" && T_MODE[2]="LB_CULL" && DEVICE[2]="0" 16 | NAME[3]="uk-2002" && DO_A[3]="16" && DO_B[3]="100" && T_MODE[3]="LB_CULL" && DEVICE[3]="0" 17 | NAME[4]="uk-2005" && DO_A[4]="10" && DO_B[4]="20" && T_MODE[4]="LB_CULL" && DEVICE[4]="0" 18 | NAME[5]="kron_g500-logn21" && DO_A[5]="0.00001" && DO_B[5]="0.1" && T_MODE[5]="LB_CULL" && DEVICE[5]="0" 19 | NAME[6]="twitter_rv.net" && DO_A[6]="0.005" && DO_B[6]="0.1" && T_MODE[6]="LB_CULL" && DEVICE[6]="0" 20 | NAME[7]="rmat_n24_e16" && DO_A[7]="0.00001" && DO_B[7]="0.1" && T_MODE[7]="LB_CULL" && DEVICE[7]="0" 21 | 22 | GRAPH[0]="market $DATADIR/${NAME[0]}/${NAME[0]}.mtx" 23 | GRAPH[1]="market $DATADIR/${NAME[1]}/${NAME[1]}.mtx" 24 | GRAPH[2]="market $DATADIR/${NAME[2]}/${NAME[2]}.mtx" 25 | GRAPH[3]="market $DATADIR/${NAME[3]}/${NAME[3]}.mtx" 26 | GRAPH[4]="market $DATADIR/${NAME[4]}/${NAME[4]}.mtx" 27 | GRAPH[5]="market $DATADIR/${NAME[5]}/${NAME[5]}.mtx" 28 | GRAPH[6]="market $DATAHUGE/${NAME[6]}/${NAME[6]}.mtx --64bit-SizeT" 29 | GRAPH[7]="grmat --rmat_scale=24 --rmat_edgefactor=16" 30 | 31 | mkdir -p eval 32 | 33 | for j in {0..1} 34 | do 35 | for i in {0..7} 36 | do 37 | echo $EXECUTION ${GRAPH[$i]} ${SETTING[$j]} --device=${DEVICE[$i]} --traversal-mode=${T_MODE[$i]} --do_a=${DO_A[$i]} --do_b=${DO_B[$i]} --jsondir=./eval/ 38 | $EXEDIR/$EXECUTION ${GRAPH[$i]} ${SETTING[$j]} --device=${DEVICE[$i]} --traversal-mode=${T_MODE[$i]} --do_a=${DO_A[$i]} --do_b=${DO_B[$i]} --jsondir=./eval/ > ./eval/${NAME[$i]}.$EXECUTION.output.txt 39 | sleep 1 40 | done 41 | done 42 | -------------------------------------------------------------------------------- /scripts/v0.5.x/performance/cc-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | EXEDIR="../../../build/bin" 4 | EXECUTION="cc" 5 | 6 | DATADIR="/data/gunrock_dataset/large" 7 | DATAHUGE="/data/gunrock_dataset/huge" 8 | 9 | SETTING[0]="--iteration-num=10 --in-sizing=1.1 --quick" 10 | 11 | NAME[0]="cit-Patents" 12 | NAME[1]="soc-LiveJournal1" 13 | NAME[2]="soc-twitter-2010" 14 | NAME[3]="uk-2002" 15 | NAME[4]="uk-2005" 16 | NAME[5]="kron_g500-logn21" 17 | NAME[6]="twitter_rv.net" 18 | NAME[7]="rmat_n24_e16" 19 | 20 | GRAPH[0]="market $DATADIR/${NAME[0]}/${NAME[0]}.mtx" 21 | GRAPH[1]="market $DATADIR/${NAME[1]}/${NAME[1]}.mtx" 22 | GRAPH[2]="market $DATADIR/${NAME[2]}/${NAME[2]}.mtx" 23 | GRAPH[3]="market $DATADIR/${NAME[3]}/${NAME[3]}.mtx" 24 | GRAPH[4]="market $DATADIR/${NAME[4]}/${NAME[4]}.mtx" 25 | GRAPH[5]="market $DATADIR/${NAME[5]}/${NAME[5]}.mtx" 26 | GRAPH[6]="market $DATAHUGE/${NAME[6]}/${NAME[6]}.mtx --64bit-SizeT" 27 | GRAPH[7]="grmat --rmat_scale=24 --rmat_edgefactor=16" 28 | 29 | mkdir -p eval 30 | DEVICE="0" 31 | for j in {0..0} 32 | do 33 | for i in {0..8} 34 | do 35 | echo $EXECUTION ${GRAPH[$i]} ${SETTING[$j]} --device=$DEVICE --jsondir=./eval/ 36 | $EXEDIR/$EXECUTION ${GRAPH[$i]} ${SETTING[$j]} --device=$DEVICE --jsondir=./eval/ > ./eval/${NAME[$i]}.$EXECUTION.output.txt 37 | sleep 1 38 | done 39 | done 40 | -------------------------------------------------------------------------------- /scripts/v0.5.x/performance/grapl19-test.sh: -------------------------------------------------------------------------------- 1 | ./bfs-test.sh && ./sssp-test.sh && ./pr-test.sh 2 | -------------------------------------------------------------------------------- /scripts/v0.5.x/performance/pr-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | EXEDIR="../../../build/bin" 4 | EXECUTION="pr" 5 | 6 | DATADIR="/data/gunrock_dataset/large" 7 | DATAHUGE="/data/gunrock_dataset/huge" 8 | 9 | SETTING[0]=" --iteration-num=10 --undirected --normalized --quick --traversal-mode=LB" 10 | SETTING[1]=" --iteration-num=10 --normalized --quick --traversal-mode=LB" 11 | 12 | NAME[0]="cit-Patents" 13 | NAME[1]="soc-LiveJournal1" 14 | NAME[2]="soc-twitter-2010" 15 | NAME[3]="uk-2002" 16 | NAME[4]="uk-2005" 17 | NAME[5]="kron_g500-logn21" 18 | NAME[6]="twitter_rv.net" 19 | NAME[7]="rmat_n24_e16" 20 | 21 | GRAPH[0]="market $DATADIR/${NAME[0]}/${NAME[0]}.mtx" 22 | GRAPH[1]="market $DATADIR/${NAME[1]}/${NAME[1]}.mtx" 23 | GRAPH[2]="market $DATADIR/${NAME[2]}/${NAME[2]}.mtx" 24 | GRAPH[3]="market $DATADIR/${NAME[3]}/${NAME[3]}.mtx" 25 | GRAPH[4]="market $DATADIR/${NAME[4]}/${NAME[4]}.mtx" 26 | GRAPH[5]="market $DATADIR/${NAME[5]}/${NAME[5]}.mtx" 27 | GRAPH[6]="market $DATAHUGE/${NAME[6]}/${NAME[6]}.mtx --64bit-SizeT" 28 | GRAPH[7]="grmat --rmat_scale=24 --rmat_edgefactor=16" 29 | 30 | mkdir -p eval 31 | DEVICE="2" 32 | 33 | for j in {0..1} 34 | do 35 | for i in {0..8} 36 | do 37 | echo $EXECUTION ${GRAPH[$i]} ${SETTING[$j]} --device=$DEVICE --jsondir=./eval/ 38 | $EXEDIR/$EXECUTION ${GRAPH[$i]} ${SETTING[$j]} --device=$DEVICE --jsondir=./eval/ > ./eval/${NAME[$i]}.$EXECUTION.output.txt 39 | sleep 1 40 | done 41 | done 42 | -------------------------------------------------------------------------------- /scripts/v0.5.x/performance/sssp-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | EXEDIR="../../../build/bin" 4 | EXECUTION="sssp" 5 | 6 | DATADIR="/data/gunrock_dataset/large" 7 | DATAHUGE="/data/gunrock_dataset/huge" 8 | 9 | SETTING[0]=" --src=0 --iteration-num=10 --queue-sizing=1 --in-sizing=1 --traversal-mode=LB --quick" 10 | SETTING[1]=" --src=largestdegree --iteration-num=10 --queue-sizing=1 --in-sizing=1 --traversal-mode=LB --quick" 11 | 12 | NAME[0]="cit-Patents" 13 | NAME[1]="soc-LiveJournal1" 14 | NAME[2]="soc-twitter-2010" 15 | NAME[3]="uk-2002" 16 | NAME[4]="uk-2005" 17 | NAME[5]="kron_g500-logn21" 18 | NAME[6]="twitter_rv.net" 19 | NAME[7]="rmat_n24_e16" 20 | 21 | GRAPH[0]="market $DATADIR/${NAME[0]}/${NAME[0]}.mtx" 22 | GRAPH[1]="market $DATADIR/${NAME[1]}/${NAME[1]}.mtx" 23 | GRAPH[2]="market $DATADIR/${NAME[2]}/${NAME[2]}.mtx" 24 | GRAPH[3]="market $DATADIR/${NAME[3]}/${NAME[3]}.mtx" 25 | GRAPH[4]="market $DATADIR/${NAME[4]}/${NAME[4]}.mtx" 26 | GRAPH[5]="market $DATADIR/${NAME[5]}/${NAME[5]}.mtx" 27 | GRAPH[6]="market $DATAHUGE/${NAME[6]}/${NAME[6]}.mtx --64bit-SizeT" 28 | GRAPH[7]="grmat --rmat_scale=24 --rmat_edgefactor=16" 29 | 30 | mkdir -p eval 31 | DEVICE="0" 32 | for j in {0..1} 33 | do 34 | for i in {0..8} 35 | do 36 | echo $EXECUTION ${GRAPH[$i]} ${SETTING[$j]} --device=$DEVICE --jsondir=./eval/ 37 | $EXEDIR/$EXECUTION ${GRAPH[$i]} ${SETTING[$j]} --device=$DEVICE --jsondir=./eval/ > ./eval/${NAME[$i]}.$EXECUTION.output.txt 38 | sleep 1 39 | done 40 | done 41 | -------------------------------------------------------------------------------- /scripts/v0.5.x/ppopp16/bc-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | EXEDIR="../../../gunrock_build/bin" 4 | EXECUTION="bc" 5 | DATADIR="../large" 6 | SETTING=" --src=0 --iteration-num=10" 7 | NAME[0]="soc-orkut" 8 | NAME[1]="hollywood-2009" 9 | NAME[2]="indochina-2004" 10 | NAME[3]="kron_g500-logn21" 11 | NAME[4]="roadNet-CA" 12 | 13 | mkdir -p eval 14 | DEVICE="0" 15 | for i in {0..4} 16 | do 17 | echo $EXECUTION ${NAME[$i]} $SETTING 18 | $EXEDIR/$EXECUTION market $DATADIR/${NAME[$i]}/${NAME[$i]}.mtx $SETTING --device=$DEVICE --jsondir=./eval/ > ./eval/${NAME[$i]}.$EXECUTION.output.txt 19 | sleep 1 20 | done 21 | echo $EXECUTION rgg_24 $SETTING 22 | $EXEDIR/$EXECUTION rgg --rgg_scale=24 $SETTING --device=$DEVICE --jsondir=./eval/ > ./eval/rgg_24.$EXECUTION.output.txt 23 | -------------------------------------------------------------------------------- /scripts/v0.5.x/ppopp16/bfs-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | EXEDIR="../../../gunrock_build/bin" 4 | EXECUTION="bfs" 5 | DATADIR="../large" 6 | SETTING=" --src=0 --undirected --idempotence --queue-sizing=6.5 --in-sizing=4 --iteration-num=10 --direction-optimized" 7 | NAME[0]="soc-orkut" && DO_A[0]="0.012" && DO_B[0]="0.1" && T_MODE[0]="LB_CULL" 8 | NAME[1]="hollywood-2009" && DO_A[1]="0.006" && DO_B[1]="0.1" && T_MODE[1]="LB_CULL" 9 | NAME[2]="indochina-2004" && DO_A[2]="100" && DO_B[2]="100" && T_MODE[2]="LB_CULL" 10 | NAME[3]="kron_g500-logn21" && DO_A[3]="0.00001" && DO_B[3]="0.1" && T_MODE[3]="LB_CULL" 11 | NAME[4]="roadNet-CA" && DO_A[4]="1.0" && DO_B[4]="10" && T_MODE[4]="TWC" 12 | 13 | mkdir -p eval 14 | DEVICE="0" 15 | for i in {0..4} 16 | do 17 | echo $EXECUTION ${NAME[$i]} $SETTING 18 | nvprof $EXEDIR/$EXECUTION market $DATADIR/${NAME[$i]}/${NAME[$i]}.mtx $SETTING --device=$DEVICE --traversal-mode=${T_MODE[$i]} --do_a=${DO_A[$i]} --do_b=${DO_B[$i]} --jsondir=./eval/ > ./eval/nvprof.${NAME[$i]}.$EXECUTION.output.txt 19 | sleep 1 20 | done 21 | echo $EXECUTION rgg_24 $SETTING 22 | #$EXEDIR/$EXECUTION rgg --rgg_scale=24 $SETTING --device=$DEVICE --traversal-mode=TWC --do_a=${DO_A[4]} --do_b=${DO_B[4]} --jsondir=./eval/ > ./eval/rgg_24.$EXECUTION.output.txt 23 | 24 | 25 | -------------------------------------------------------------------------------- /scripts/v0.5.x/ppopp16/cc-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | EXEDIR="../../../gunrock_build/bin" 4 | EXECUTION="cc" 5 | DATADIR="../large" 6 | SETTING=" --iteration-num=10" 7 | NAME[0]="soc-orkut" 8 | NAME[1]="hollywood-2009" 9 | NAME[2]="indochina-2004" 10 | NAME[3]="kron_g500-logn21" 11 | NAME[4]="roadNet-CA" 12 | 13 | mkdir -p eval 14 | DEVICE="0" 15 | for i in {0..4} 16 | do 17 | echo $EXECUTION ${NAME[$i]} $SETTING 18 | $EXEDIR/$EXECUTION market $DATADIR/${NAME[$i]}/${NAME[$i]}.mtx $SETTING --device=$DEVICE --jsondir=./eval/ > ./eval/${NAME[$i]}.$EXECUTION.output.txt 19 | sleep 1 20 | done 21 | echo $EXECUTION rgg_24 $SETTING 22 | $EXEDIR/$EXECUTION rgg --rgg_scale=24 $SETTING --device=$DEVICE --jsondir=./eval/ > ./eval/rgg_24.$EXECUTION.output.txt 23 | -------------------------------------------------------------------------------- /scripts/v0.5.x/ppopp16/ppopp16-test.sh: -------------------------------------------------------------------------------- 1 | sh bfs-test.sh && sh sssp-test.sh && sh bc-test.sh && sh pr-test.sh && sh cc-test.sh 2 | -------------------------------------------------------------------------------- /scripts/v0.5.x/ppopp16/pr-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | EXEDIR="../../../gunrock_build/bin" 4 | EXECUTION="pr" 5 | DATADIR="../large" 6 | SETTING=" --quick --iteration-num=10" 7 | NAME[0]="soc-orkut" 8 | NAME[1]="hollywood-2009" 9 | NAME[2]="indochina-2004" 10 | NAME[3]="kron_g500-logn21" 11 | NAME[4]="roadNet-CA" 12 | 13 | mkdir -p eval 14 | DEVICE="0" 15 | for i in {0..4} 16 | do 17 | echo $EXECUTION ${NAME[$i]} $SETTING 18 | $EXEDIR/$EXECUTION market $DATADIR/${NAME[$i]}/${NAME[$i]}.mtx $SETTING --device=$DEVICE --jsondir=./eval/ > ./eval/${NAME[$i]}.$EXECUTION.output.txt 19 | sleep 1 20 | done 21 | echo $EXECUTION rgg_24 $SETTING 22 | $EXEDIR/$EXECUTION rgg --rgg_scale=24 $SETTING --device=$DEVICE --jsondir=./eval/ > ./eval/rgg_24.$EXECUTION.output.txt 23 | -------------------------------------------------------------------------------- /scripts/v0.5.x/ppopp16/sssp-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | EXEDIR="../../../gunrock_build/bin" 4 | EXECUTION="sssp" 5 | DATADIR="../large" 6 | SETTING=" --src=0 --undirected --iteration-num=10" 7 | NAME[0]="soc-orkut" && T_MODE[0]="LB_CULL" 8 | NAME[1]="hollywood-2009" && T_MODE[1]="LB_CULL" 9 | NAME[2]="indochina-2004" && T_MODE[2]="LB_CULL" 10 | NAME[3]="kron_g500-logn21" && T_MODE[3]="LB_CULL" 11 | NAME[4]="roadNet-CA" && T_MODE[4]="TWC" 12 | 13 | mkdir -p eval 14 | DEVICE="0" 15 | for i in {0..4} 16 | do 17 | echo $EXECUTION ${NAME[$i]} $SETTING 18 | $EXEDIR/$EXECUTION market $DATADIR/${NAME[$i]}/${NAME[$i]}.mtx $SETTING --device=$DEVICE --traversal-mode=${T_MODE[$i]} --jsondir=./eval/ > ./eval/${NAME[$i]}.$EXECUTION.output.txt 19 | sleep 1 20 | done 21 | echo $EXECUTION rgg_24 $SETTING 22 | $EXEDIR/$EXECUTION rgg --rgg_scale=24 $SETTING --device=$DEVICE --traversal-mode=TWC --jsondir=./eval/ > ./eval/rgg_24.$EXECUTION.output.txt 23 | -------------------------------------------------------------------------------- /scripts/v0.5.x/standard/README.md: -------------------------------------------------------------------------------- 1 | # Gunrock standard benchmarking scripts 2 | 3 | Make sure you have downloaded the required datasets by: 4 | ```cd /dataset/large && make STANDARD``` 5 | 6 | In case you see errors from wget complaining about certificates, use the following command instead: 7 | ```cd /dataset/large && make WGET="wget --no-check-certificate" STANDARD``` 8 | 9 | Running the benchmarks after that is as simple as: 10 | ```cd /scripts/standard && ./run-tests.sh ``` 11 | 12 | If you have followed the default build commands, the above commandwill be: 13 | ```cd /scripts/standard && ./run-tests.sh ../../../build/bin/ ../../large/``` 14 | 15 | # Notes on test scripts 16 | 17 | These are the scripts we have used repeatedly to test/benchmark Gunrock. We should expand on these as the project evolves, and only create new specialized scripts when needed for specific papers and merge them back into this standard folder. 18 | -------------------------------------------------------------------------------- /scripts/v0.5.x/standard/bc-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | EXEDIR=${1:-"../../build/bin"} 4 | DATADIR=${2:-"/data/gunrock_dataset/large"} 5 | EXECUTION="bc" 6 | SETTING=" --src=0 --iteration-num=10" 7 | DEVICE=${3:-"0"} 8 | TAG=${4:-""} 9 | 10 | NAME[0]="soc-LiveJournal1" && DO_A[0]="0.200" && DO_B[0]="0.1" && T_MODE[0]="LB_CULL" 11 | NAME[1]="soc-orkut" && DO_A[1]="0.012" && DO_B[1]="0.1" && T_MODE[1]="LB_CULL" 12 | NAME[2]="hollywood-2009" && DO_A[2]="0.006" && DO_B[2]="0.1" && T_MODE[2]="LB_CULL" 13 | NAME[3]="indochina-2004" && DO_A[3]="100" && DO_B[3]="100" && T_MODE[3]="LB_CULL" 14 | NAME[4]="rmat_n22_e64" && DO_A[4]="0.00001" && DO_B[4]="0.1" && T_MODE[4]="LB_CULL" 15 | NAME[5]="rmat_n23_e32" && DO_A[5]="0.00001" && DO_B[5]="0.1" && T_MODE[5]="LB_CULL" 16 | NAME[6]="rmat_n24_e16" && DO_A[6]="0.00001" && DO_B[6]="0.1" && T_MODE[6]="LB_CULL" 17 | NAME[7]="road_usa" && DO_A[7]="1.0" && DO_B[7]="10" && T_MODE[7]="TWC" 18 | NAME[8]="rgg_n24_0.000548" && DO_A[8]="1.0" && DO_B[8]="10" && T_MODE[8]="TWC" 19 | 20 | GRAPH[0]="market $DATADIR/${NAME[0]}/${NAME[0]}.mtx" 21 | GRAPH[1]="market $DATADIR/${NAME[1]}/${NAME[1]}.mtx" 22 | GRAPH[2]="market $DATADIR/${NAME[2]}/${NAME[2]}.mtx" 23 | GRAPH[3]="market $DATADIR/${NAME[3]}/${NAME[3]}.mtx" 24 | GRAPH[4]="grmat --rmat_scale=22 --rmat_edgefactor=64" 25 | GRAPH[5]="grmat --rmat_scale=23 --rmat_edgefactor=32" 26 | GRAPH[6]="grmat --rmat_scale=24 --rmat_edgefactor=16" 27 | GRAPH[7]="market $DATADIR/${NAME[7]}/${NAME[7]}.mtx" 28 | GRAPH[8]="rgg --rgg_scale=24 --rgg_threshold=0.000548" 29 | 30 | mkdir -p eval 31 | for i in {0..8} 32 | do 33 | echo $EXEDIR/$EXECUTION ${GRAPH[$i]} $SETTING --tag=$TAG --device=$DEVICE --jsondir=./eval/ "> ./eval/${NAME[$i]}.$EXECUTION.output.txt" 34 | $EXEDIR/$EXECUTION ${GRAPH[$i]} $SETTING --tag=$TAG --device=$DEVICE --jsondir=./eval/ > ./eval/${NAME[$i]}.$EXECUTION.output.txt 35 | sleep 1 36 | done 37 | -------------------------------------------------------------------------------- /scripts/v0.5.x/standard/bfs-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | EXEDIR=${1:-"../../build/bin"} 4 | DATADIR=${2:-"/data/gunrock_dataset/large"} 5 | EXECUTION="bfs" 6 | SETTING=" --src=0 --undirected --idempotence --queue-sizing=6.5 --in-sizing=4 --iteration-num=10 --direction-optimized" 7 | DEVICE=${3:-"0"} 8 | TAG=${4:-""} 9 | 10 | NAME[0]="soc-LiveJournal1" && DO_A[0]="0.200" && DO_B[0]="0.1" && T_MODE[0]="LB_CULL" 11 | NAME[1]="soc-orkut" && DO_A[1]="0.012" && DO_B[1]="0.1" && T_MODE[1]="LB_CULL" 12 | NAME[2]="hollywood-2009" && DO_A[2]="0.006" && DO_B[2]="0.1" && T_MODE[2]="LB_CULL" 13 | NAME[3]="indochina-2004" && DO_A[3]="100" && DO_B[3]="100" && T_MODE[3]="LB_CULL" 14 | NAME[4]="rmat_n22_e64" && DO_A[4]="0.00001" && DO_B[4]="0.1" && T_MODE[4]="LB_CULL" 15 | NAME[5]="rmat_n23_e32" && DO_A[5]="0.00001" && DO_B[5]="0.1" && T_MODE[5]="LB_CULL" 16 | NAME[6]="rmat_n24_e16" && DO_A[6]="0.00001" && DO_B[6]="0.1" && T_MODE[6]="LB_CULL" 17 | NAME[7]="road_usa" && DO_A[7]="1.0" && DO_B[7]="10" && T_MODE[7]="TWC" 18 | NAME[8]="rgg_n24_0.000548" && DO_A[8]="1.0" && DO_B[8]="10" && T_MODE[8]="TWC" 19 | 20 | GRAPH[0]="market $DATADIR/${NAME[0]}/${NAME[0]}.mtx" 21 | GRAPH[1]="market $DATADIR/${NAME[1]}/${NAME[1]}.mtx" 22 | GRAPH[2]="market $DATADIR/${NAME[2]}/${NAME[2]}.mtx" 23 | GRAPH[3]="market $DATADIR/${NAME[3]}/${NAME[3]}.mtx" 24 | GRAPH[4]="grmat --rmat_scale=22 --rmat_edgefactor=64" 25 | GRAPH[5]="grmat --rmat_scale=23 --rmat_edgefactor=32" 26 | GRAPH[6]="grmat --rmat_scale=24 --rmat_edgefactor=16" 27 | GRAPH[7]="market $DATADIR/${NAME[7]}/${NAME[7]}.mtx" 28 | GRAPH[8]="rgg --rgg_scale=24 --rgg_threshold=0.000548" 29 | 30 | mkdir -p eval 31 | for i in {0..8} 32 | do 33 | echo $EXEDIR/$EXECUTION ${GRAPH[$i]} $SETTING --tag=$TAG --device=$DEVICE --traversal-mode=${T_MODE[$i]} --do_a=${DO_A[$i]} --do_b=${DO_B[$i]} --jsondir=./eval/ "> ./eval/${NAME[$i]}.$EXECUTION.output.txt" 34 | $EXEDIR/$EXECUTION ${GRAPH[$i]} $SETTING --tag=$TAG --device=$DEVICE --traversal-mode=${T_MODE[$i]} --do_a=${DO_A[$i]} --do_b=${DO_B[$i]} --jsondir=./eval/ > ./eval/${NAME[$i]}.$EXECUTION.output.txt 35 | sleep 1 36 | done 37 | 38 | 39 | -------------------------------------------------------------------------------- /scripts/v0.5.x/standard/cc-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | EXEDIR=${1:-"../../build/bin"} 4 | DATADIR=${2:-"/data/gunrock_dataset/large"} 5 | EXECUTION="cc" 6 | SETTING=" --iteration-num=10" 7 | DEVICE=${3:-"0"} 8 | TAG=${4:-""} 9 | 10 | NAME[0]="soc-LiveJournal1" && DO_A[0]="0.200" && DO_B[0]="0.1" && T_MODE[0]="LB_CULL" 11 | NAME[1]="soc-orkut" && DO_A[1]="0.012" && DO_B[1]="0.1" && T_MODE[1]="LB_CULL" 12 | NAME[2]="hollywood-2009" && DO_A[2]="0.006" && DO_B[2]="0.1" && T_MODE[2]="LB_CULL" 13 | NAME[3]="indochina-2004" && DO_A[3]="100" && DO_B[3]="100" && T_MODE[3]="LB_CULL" 14 | NAME[4]="rmat_n22_e64" && DO_A[4]="0.00001" && DO_B[4]="0.1" && T_MODE[4]="LB_CULL" 15 | NAME[5]="rmat_n23_e32" && DO_A[5]="0.00001" && DO_B[5]="0.1" && T_MODE[5]="LB_CULL" 16 | NAME[6]="rmat_n24_e16" && DO_A[6]="0.00001" && DO_B[6]="0.1" && T_MODE[6]="LB_CULL" 17 | NAME[7]="road_usa" && DO_A[7]="1.0" && DO_B[7]="10" && T_MODE[7]="TWC" 18 | NAME[8]="rgg_n24_0.000548" && DO_A[8]="1.0" && DO_B[8]="10" && T_MODE[8]="TWC" 19 | 20 | GRAPH[0]="market $DATADIR/${NAME[0]}/${NAME[0]}.mtx" 21 | GRAPH[1]="market $DATADIR/${NAME[1]}/${NAME[1]}.mtx" 22 | GRAPH[2]="market $DATADIR/${NAME[2]}/${NAME[2]}.mtx" 23 | GRAPH[3]="market $DATADIR/${NAME[3]}/${NAME[3]}.mtx" 24 | GRAPH[4]="grmat --rmat_scale=22 --rmat_edgefactor=64" 25 | GRAPH[5]="grmat --rmat_scale=23 --rmat_edgefactor=32" 26 | GRAPH[6]="grmat --rmat_scale=24 --rmat_edgefactor=16" 27 | GRAPH[7]="market $DATADIR/${NAME[7]}/${NAME[7]}.mtx" 28 | GRAPH[8]="rgg --rgg_scale=24 --rgg_threshold=0.000548" 29 | 30 | mkdir -p eval 31 | for i in {0..8} 32 | do 33 | echo $EXEDIR/$EXECUTION ${GRAPH[$i]} $SETTING --tag=$TAG --device=$DEVICE --jsondir=./eval/ "> ./eval/${NAME[$i]}.$EXECUTION.output.txt" 34 | $EXEDIR/$EXECUTION ${GRAPH[$i]} $SETTING --tag=$TAG --device=$DEVICE --jsondir=./eval/ > ./eval/${NAME[$i]}.$EXECUTION.output.txt 35 | sleep 1 36 | done 37 | -------------------------------------------------------------------------------- /scripts/v0.5.x/standard/pr-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | EXEDIR=${1:-"../../build/bin"} 4 | DATADIR=${2:-"/data/gunrock_dataset/large"} 5 | EXECUTION="pr" 6 | SETTING=" --quick --iteration-num=10 --max-iter=1" 7 | DEVICE=${3:-"0"} 8 | TAG=${4:-""} 9 | 10 | NAME[0]="soc-LiveJournal1" && DO_A[0]="0.200" && DO_B[0]="0.1" && T_MODE[0]="LB" 11 | NAME[1]="soc-orkut" && DO_A[1]="0.012" && DO_B[1]="0.1" && T_MODE[1]="LB" 12 | NAME[2]="hollywood-2009" && DO_A[2]="0.006" && DO_B[2]="0.1" && T_MODE[2]="LB" 13 | NAME[3]="indochina-2004" && DO_A[3]="100" && DO_B[3]="100" && T_MODE[3]="LB" 14 | NAME[4]="rmat_n22_e64" && DO_A[4]="0.00001" && DO_B[4]="0.1" && T_MODE[4]="LB" 15 | NAME[5]="rmat_n23_e32" && DO_A[5]="0.00001" && DO_B[5]="0.1" && T_MODE[5]="LB" 16 | NAME[6]="rmat_n24_e16" && DO_A[6]="0.00001" && DO_B[6]="0.1" && T_MODE[6]="LB" 17 | NAME[7]="road_usa" && DO_A[7]="1.0" && DO_B[7]="10" && T_MODE[7]="TWC" 18 | NAME[8]="rgg_n24_0.000548" && DO_A[8]="1.0" && DO_B[8]="10" && T_MODE[8]="TWC" 19 | 20 | GRAPH[0]="market $DATADIR/${NAME[0]}/${NAME[0]}.mtx" 21 | GRAPH[1]="market $DATADIR/${NAME[1]}/${NAME[1]}.mtx" 22 | GRAPH[2]="market $DATADIR/${NAME[2]}/${NAME[2]}.mtx" 23 | GRAPH[3]="market $DATADIR/${NAME[3]}/${NAME[3]}.mtx" 24 | GRAPH[4]="grmat --rmat_scale=22 --rmat_edgefactor=64" 25 | GRAPH[5]="grmat --rmat_scale=23 --rmat_edgefactor=32" 26 | GRAPH[6]="grmat --rmat_scale=24 --rmat_edgefactor=16" 27 | GRAPH[7]="market $DATADIR/${NAME[7]}/${NAME[7]}.mtx" 28 | GRAPH[8]="rgg --rgg_scale=24 --rgg_theshold=0.000548" 29 | 30 | mkdir -p eval 31 | for i in {0..8} 32 | do 33 | echo $EXEDIR/$EXECUTION ${GRAPH[$i]} $SETTING --tag=$TAG --device=$DEVICE --traversal-mode=${T_MODE[$i]} --jsondir=./eval/ "> ./eval/${NAME[$i]}.$EXECUTION.output.txt" 34 | $EXEDIR/$EXECUTION ${GRAPH[$i]} $SETTING --tag=$TAG --device=$DEVICE --traversal-mode=${T_MODE[$i]} --jsondir=./eval/ > ./eval/${NAME[$i]}.$EXECUTION.output.txt 35 | sleep 1 36 | done 37 | -------------------------------------------------------------------------------- /scripts/v0.5.x/standard/run-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | TIMESTAMP=`date '+%Y-%m-%d_%H:%M:%S'` 4 | 5 | EXEDIR=${1:-"../../build/bin"} 6 | DATADIR=${2:-"/data/gunrock_dataset/large"} 7 | DEVICE=${3:-"0"} 8 | TAG=${4:-"$TIMESTAMP"} 9 | 10 | for algo in bfs sssp bc pr cc; do 11 | ./${algo}-test.sh "$EXEDIR" "$DATADIR" "$DEVICE" "$TAG" 12 | done 13 | -------------------------------------------------------------------------------- /scripts/v0.5.x/standard/sssp-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | EXEDIR=${1:-"../../build/bin"} 4 | DATADIR=${2:-"/data/gunrock_dataset/large"} 5 | EXECUTION="sssp" 6 | SETTING=" --src=0 --undirected --iteration-num=10" 7 | DEVICE=${3:-"0"} 8 | TAG=${4:-""} 9 | 10 | NAME[0]="soc-LiveJournal1" && DO_A[0]="0.200" && DO_B[0]="0.1" && T_MODE[0]="LB_CULL" 11 | NAME[1]="soc-orkut" && DO_A[1]="0.012" && DO_B[1]="0.1" && T_MODE[1]="LB_CULL" 12 | NAME[2]="hollywood-2009" && DO_A[2]="0.006" && DO_B[2]="0.1" && T_MODE[2]="LB_CULL" 13 | NAME[3]="indochina-2004" && DO_A[3]="100" && DO_B[3]="100" && T_MODE[3]="LB_CULL" 14 | NAME[4]="rmat_n22_e64" && DO_A[4]="0.00001" && DO_B[4]="0.1" && T_MODE[4]="LB_CULL" 15 | NAME[5]="rmat_n23_e32" && DO_A[5]="0.00001" && DO_B[5]="0.1" && T_MODE[5]="LB_CULL" 16 | NAME[6]="rmat_n24_e16" && DO_A[6]="0.00001" && DO_B[6]="0.1" && T_MODE[6]="LB_CULL" 17 | NAME[7]="road_usa" && DO_A[7]="1.0" && DO_B[7]="10" && T_MODE[7]="TWC" 18 | NAME[8]="rgg_n24_0.000548" && DO_A[8]="1.0" && DO_B[8]="10" && T_MODE[8]="TWC" 19 | 20 | GRAPH[0]="market $DATADIR/${NAME[0]}/${NAME[0]}.mtx" 21 | GRAPH[1]="market $DATADIR/${NAME[1]}/${NAME[1]}.mtx" 22 | GRAPH[2]="market $DATADIR/${NAME[2]}/${NAME[2]}.mtx" 23 | GRAPH[3]="market $DATADIR/${NAME[3]}/${NAME[3]}.mtx" 24 | GRAPH[4]="grmat --rmat_scale=22 --rmat_edgefactor=64" 25 | GRAPH[5]="grmat --rmat_scale=23 --rmat_edgefactor=32" 26 | GRAPH[6]="grmat --rmat_scale=24 --rmat_edgefactor=16" 27 | GRAPH[7]="market $DATADIR/${NAME[7]}/${NAME[7]}.mtx" 28 | GRAPH[8]="rgg --rgg_scale=24 --rgg_theshold=0.000548" 29 | 30 | mkdir -p eval 31 | for i in {0..8} 32 | do 33 | echo $EXEDIR/$EXECUTION ${GRAPH[$i]} $SETTING --tag=$TAG --device=$DEVICE --traversal-mode=${T_MODE[$i]} --jsondir=./eval/ "> ./eval/${NAME[$i]}.$EXECUTION.output.txt" 34 | $EXEDIR/$EXECUTION ${GRAPH[$i]} $SETTING --tag=$TAG --device=$DEVICE --traversal-mode=${T_MODE[$i]} --jsondir=./eval/ > ./eval/${NAME[$i]}.$EXECUTION.output.txt 35 | sleep 1 36 | done 37 | -------------------------------------------------------------------------------- /scripts/v0.5.x/topc/README.md: -------------------------------------------------------------------------------- 1 | TOPC benchmarking scripts 2 | ========================= 3 | Make sure you have downloaded the required datasets by: 4 | ```cd /dataset/large && make TOPC``` 5 | In case you see errors from wget complaining about certificates, use the following command instead: 6 | ```cd /dataset/large && make WGET="wget --no-check-certificate" TOPC``` 7 | 8 | Running the benchmarks after that is as simple as: 9 | ```cd /dataset/test-scripts/topc && ./topc-test.sh ``` 10 | If you have followed the default build commands, the above commandwill be: 11 | ```cd /dataset/test-scripts/topc && ./topc-test.sh ../../../build/bin/ ../../large/``` 12 | -------------------------------------------------------------------------------- /scripts/v0.5.x/topc/bc-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | EXEDIR=${1:-"../../build/bin"} 4 | DATADIR=${2:-"/data/gunrock_dataset/large"} 5 | EXECUTION="bc" 6 | SETTING=" --src=0 --iteration-num=10" 7 | NAME[0]="soc-LiveJournal1" && DO_A[0]="0.200" && DO_B[0]="0.1" && T_MODE[0]="LB_CULL" 8 | NAME[1]="soc-orkut" && DO_A[1]="0.012" && DO_B[1]="0.1" && T_MODE[1]="LB_CULL" 9 | NAME[2]="hollywood-2009" && DO_A[2]="0.006" && DO_B[2]="0.1" && T_MODE[2]="LB_CULL" 10 | NAME[3]="indochina-2004" && DO_A[3]="100" && DO_B[3]="100" && T_MODE[3]="LB_CULL" 11 | NAME[4]="rmat_n22_e64" && DO_A[4]="0.00001" && DO_B[4]="0.1" && T_MODE[4]="LB_CULL" 12 | NAME[5]="rmat_n23_e32" && DO_A[5]="0.00001" && DO_B[5]="0.1" && T_MODE[5]="LB_CULL" 13 | NAME[6]="rmat_n24_e16" && DO_A[6]="0.00001" && DO_B[6]="0.1" && T_MODE[6]="LB_CULL" 14 | NAME[7]="road_usa" && DO_A[7]="1.0" && DO_B[7]="10" && T_MODE[7]="TWC" 15 | NAME[8]="rgg_n24_0.000548" && DO_A[8]="1.0" && DO_B[8]="10" && T_MODE[8]="TWC" 16 | 17 | GRAPH[0]="market $DATADIR/${NAME[0]}/${NAME[0]}.mtx" 18 | GRAPH[1]="market $DATADIR/${NAME[1]}/${NAME[1]}.mtx" 19 | GRAPH[2]="market $DATADIR/${NAME[2]}/${NAME[2]}.mtx" 20 | GRAPH[3]="market $DATADIR/${NAME[3]}/${NAME[3]}.mtx" 21 | GRAPH[4]="grmat --rmat_scale=22 --rmat_edgefactor=64" 22 | GRAPH[5]="grmat --rmat_scale=23 --rmat_edgefactor=32" 23 | GRAPH[6]="grmat --rmat_scale=24 --rmat_edgefactor=16" 24 | GRAPH[7]="market $DATADIR/${NAME[7]}/${NAME[7]}.mtx" 25 | GRAPH[8]="rgg --rgg_scale=24 --rgg_threshold=0.000548" 26 | 27 | mkdir -p eval 28 | DEVICE="0" 29 | for i in {0..8} 30 | do 31 | echo $EXEDIR/$EXECUTION ${GRAPH[$i]} $SETTING --device=$DEVICE --jsondir=./eval/ "> ./eval/${NAME[$i]}.$EXECUTION.output.txt" 32 | $EXEDIR/$EXECUTION ${GRAPH[$i]} $SETTING --device=$DEVICE --jsondir=./eval/ > ./eval/${NAME[$i]}.$EXECUTION.output.txt 33 | sleep 1 34 | done 35 | -------------------------------------------------------------------------------- /scripts/v0.5.x/topc/bfs-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | EXEDIR=${1:-"../../build/bin"} 4 | DATADIR=${2:-"/data/gunrock_dataset/large"} 5 | EXECUTION="bfs" 6 | SETTING=" --src=0 --undirected --idempotence --queue-sizing=6.5 --in-sizing=4 --iteration-num=10 --direction-optimized" 7 | NAME[0]="soc-LiveJournal1" && DO_A[0]="0.200" && DO_B[0]="0.1" && T_MODE[0]="LB_CULL" 8 | NAME[1]="soc-orkut" && DO_A[1]="0.012" && DO_B[1]="0.1" && T_MODE[1]="LB_CULL" 9 | NAME[2]="hollywood-2009" && DO_A[2]="0.006" && DO_B[2]="0.1" && T_MODE[2]="LB_CULL" 10 | NAME[3]="indochina-2004" && DO_A[3]="100" && DO_B[3]="100" && T_MODE[3]="LB_CULL" 11 | NAME[4]="rmat_n22_e64" && DO_A[4]="0.00001" && DO_B[4]="0.1" && T_MODE[4]="LB_CULL" 12 | NAME[5]="rmat_n23_e32" && DO_A[5]="0.00001" && DO_B[5]="0.1" && T_MODE[5]="LB_CULL" 13 | NAME[6]="rmat_n24_e16" && DO_A[6]="0.00001" && DO_B[6]="0.1" && T_MODE[6]="LB_CULL" 14 | NAME[7]="road_usa" && DO_A[7]="1.0" && DO_B[7]="10" && T_MODE[7]="TWC" 15 | NAME[8]="rgg_n24_0.000548" && DO_A[8]="1.0" && DO_B[8]="10" && T_MODE[8]="TWC" 16 | 17 | GRAPH[0]="market $DATADIR/${NAME[0]}/${NAME[0]}.mtx" 18 | GRAPH[1]="market $DATADIR/${NAME[1]}/${NAME[1]}.mtx" 19 | GRAPH[2]="market $DATADIR/${NAME[2]}/${NAME[2]}.mtx" 20 | GRAPH[3]="market $DATADIR/${NAME[3]}/${NAME[3]}.mtx" 21 | GRAPH[4]="grmat --rmat_scale=22 --rmat_edgefactor=64" 22 | GRAPH[5]="grmat --rmat_scale=23 --rmat_edgefactor=32" 23 | GRAPH[6]="grmat --rmat_scale=24 --rmat_edgefactor=16" 24 | GRAPH[7]="market $DATADIR/${NAME[7]}/${NAME[7]}.mtx" 25 | GRAPH[8]="rgg --rgg_scale=24 --rgg_threshold=0.000548" 26 | 27 | mkdir -p eval 28 | DEVICE="0" 29 | for i in {0..8} 30 | do 31 | echo $EXEDIR/$EXECUTION ${GRAPH[$i]} $SETTING --device=$DEVICE --traversal-mode=${T_MODE[$i]} --do_a=${DO_A[$i]} --do_b=${DO_B[$i]} --jsondir=./eval/ "> ./eval/${NAME[$i]}.$EXECUTION.output.txt" 32 | $EXEDIR/$EXECUTION ${GRAPH[$i]} $SETTING --device=$DEVICE --traversal-mode=${T_MODE[$i]} --do_a=${DO_A[$i]} --do_b=${DO_B[$i]} --jsondir=./eval/ > ./eval/${NAME[$i]}.$EXECUTION.output.txt 33 | sleep 1 34 | done 35 | -------------------------------------------------------------------------------- /scripts/v0.5.x/topc/cc-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | EXEDIR=${1:-"../../build/bin"} 4 | DATADIR=${2:-"/data/gunrock_dataset/large"} 5 | EXECUTION="cc" 6 | SETTING=" --iteration-num=10" 7 | NAME[0]="soc-LiveJournal1" && DO_A[0]="0.200" && DO_B[0]="0.1" && T_MODE[0]="LB_CULL" 8 | NAME[1]="soc-orkut" && DO_A[1]="0.012" && DO_B[1]="0.1" && T_MODE[1]="LB_CULL" 9 | NAME[2]="hollywood-2009" && DO_A[2]="0.006" && DO_B[2]="0.1" && T_MODE[2]="LB_CULL" 10 | NAME[3]="indochina-2004" && DO_A[3]="100" && DO_B[3]="100" && T_MODE[3]="LB_CULL" 11 | NAME[4]="rmat_n22_e64" && DO_A[4]="0.00001" && DO_B[4]="0.1" && T_MODE[4]="LB_CULL" 12 | NAME[5]="rmat_n23_e32" && DO_A[5]="0.00001" && DO_B[5]="0.1" && T_MODE[5]="LB_CULL" 13 | NAME[6]="rmat_n24_e16" && DO_A[6]="0.00001" && DO_B[6]="0.1" && T_MODE[6]="LB_CULL" 14 | NAME[7]="road_usa" && DO_A[7]="1.0" && DO_B[7]="10" && T_MODE[7]="TWC" 15 | NAME[8]="rgg_n24_0.000548" && DO_A[8]="1.0" && DO_B[8]="10" && T_MODE[8]="TWC" 16 | 17 | GRAPH[0]="market $DATADIR/${NAME[0]}/${NAME[0]}.mtx" 18 | GRAPH[1]="market $DATADIR/${NAME[1]}/${NAME[1]}.mtx" 19 | GRAPH[2]="market $DATADIR/${NAME[2]}/${NAME[2]}.mtx" 20 | GRAPH[3]="market $DATADIR/${NAME[3]}/${NAME[3]}.mtx" 21 | GRAPH[4]="grmat --rmat_scale=22 --rmat_edgefactor=64" 22 | GRAPH[5]="grmat --rmat_scale=23 --rmat_edgefactor=32" 23 | GRAPH[6]="grmat --rmat_scale=24 --rmat_edgefactor=16" 24 | GRAPH[7]="market $DATADIR/${NAME[7]}/${NAME[7]}.mtx" 25 | GRAPH[8]="rgg --rgg_scale=24 --rgg_threshold=0.000548" 26 | 27 | mkdir -p eval 28 | DEVICE="0" 29 | for i in {0..8} 30 | do 31 | echo $EXEDIR/$EXECUTION ${GRAPH[$i]} $SETTING --device=$DEVICE --jsondir=./eval/ "> ./eval/${NAME[$i]}.$EXECUTION.output.txt" 32 | $EXEDIR/$EXECUTION ${GRAPH[$i]} $SETTING --device=$DEVICE --jsondir=./eval/ > ./eval/${NAME[$i]}.$EXECUTION.output.txt 33 | sleep 1 34 | done 35 | -------------------------------------------------------------------------------- /scripts/v0.5.x/topc/pr-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | EXEDIR=${1:-"../../build/bin"} 4 | DATADIR=${2:-"/data/gunrock_dataset/large"} 5 | EXECUTION="pr" 6 | SETTING=" --quick --iteration-num=10 --max-iter=1" 7 | NAME[0]="soc-LiveJournal1" && DO_A[0]="0.200" && DO_B[0]="0.1" && T_MODE[0]="LB" 8 | NAME[1]="soc-orkut" && DO_A[1]="0.012" && DO_B[1]="0.1" && T_MODE[1]="LB" 9 | NAME[2]="hollywood-2009" && DO_A[2]="0.006" && DO_B[2]="0.1" && T_MODE[2]="LB" 10 | NAME[3]="indochina-2004" && DO_A[3]="100" && DO_B[3]="100" && T_MODE[3]="LB" 11 | NAME[4]="rmat_n22_e64" && DO_A[4]="0.00001" && DO_B[4]="0.1" && T_MODE[4]="LB" 12 | NAME[5]="rmat_n23_e32" && DO_A[5]="0.00001" && DO_B[5]="0.1" && T_MODE[5]="LB" 13 | NAME[6]="rmat_n24_e16" && DO_A[6]="0.00001" && DO_B[6]="0.1" && T_MODE[6]="LB" 14 | NAME[7]="road_usa" && DO_A[7]="1.0" && DO_B[7]="10" && T_MODE[7]="TWC" 15 | NAME[8]="rgg_n24_0.000548" && DO_A[8]="1.0" && DO_B[8]="10" && T_MODE[8]="TWC" 16 | 17 | GRAPH[0]="market $DATADIR/${NAME[0]}/${NAME[0]}.mtx" 18 | GRAPH[1]="market $DATADIR/${NAME[1]}/${NAME[1]}.mtx" 19 | GRAPH[2]="market $DATADIR/${NAME[2]}/${NAME[2]}.mtx" 20 | GRAPH[3]="market $DATADIR/${NAME[3]}/${NAME[3]}.mtx" 21 | GRAPH[4]="grmat --rmat_scale=22 --rmat_edgefactor=64" 22 | GRAPH[5]="grmat --rmat_scale=23 --rmat_edgefactor=32" 23 | GRAPH[6]="grmat --rmat_scale=24 --rmat_edgefactor=16" 24 | GRAPH[7]="market $DATADIR/${NAME[7]}/${NAME[7]}.mtx" 25 | GRAPH[8]="rgg --rgg_scale=24 --rgg_theshold=0.000548" 26 | 27 | mkdir -p eval 28 | DEVICE="0" 29 | for i in {0..8} 30 | do 31 | echo $EXEDIR/$EXECUTION ${GRAPH[$i]} $SETTING --device=$DEVICE --traversal-mode=${T_MODE[$i]} --jsondir=./eval/ "> ./eval/${NAME[$i]}.$EXECUTION.output.txt" 32 | $EXEDIR/$EXECUTION ${GRAPH[$i]} $SETTING --device=$DEVICE --traversal-mode=${T_MODE[$i]} --jsondir=./eval/ > ./eval/${NAME[$i]}.$EXECUTION.output.txt 33 | sleep 1 34 | done 35 | -------------------------------------------------------------------------------- /scripts/v0.5.x/topc/sssp-test.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | EXEDIR=${1:-"../../build/bin"} 4 | DATADIR=${2:-"/data/gunrock_dataset/large"} 5 | EXECUTION="sssp" 6 | SETTING=" --src=0 --undirected --iteration-num=10" 7 | NAME[0]="soc-LiveJournal1" && DO_A[0]="0.200" && DO_B[0]="0.1" && T_MODE[0]="LB_CULL" 8 | NAME[1]="soc-orkut" && DO_A[1]="0.012" && DO_B[1]="0.1" && T_MODE[1]="LB_CULL" 9 | NAME[2]="hollywood-2009" && DO_A[2]="0.006" && DO_B[2]="0.1" && T_MODE[2]="LB_CULL" 10 | NAME[3]="indochina-2004" && DO_A[3]="100" && DO_B[3]="100" && T_MODE[3]="LB_CULL" 11 | NAME[4]="rmat_n22_e64" && DO_A[4]="0.00001" && DO_B[4]="0.1" && T_MODE[4]="LB_CULL" 12 | NAME[5]="rmat_n23_e32" && DO_A[5]="0.00001" && DO_B[5]="0.1" && T_MODE[5]="LB_CULL" 13 | NAME[6]="rmat_n24_e16" && DO_A[6]="0.00001" && DO_B[6]="0.1" && T_MODE[6]="LB_CULL" 14 | NAME[7]="road_usa" && DO_A[7]="1.0" && DO_B[7]="10" && T_MODE[7]="TWC" 15 | NAME[8]="rgg_n24_0.000548" && DO_A[8]="1.0" && DO_B[8]="10" && T_MODE[8]="TWC" 16 | 17 | GRAPH[0]="market $DATADIR/${NAME[0]}/${NAME[0]}.mtx" 18 | GRAPH[1]="market $DATADIR/${NAME[1]}/${NAME[1]}.mtx" 19 | GRAPH[2]="market $DATADIR/${NAME[2]}/${NAME[2]}.mtx" 20 | GRAPH[3]="market $DATADIR/${NAME[3]}/${NAME[3]}.mtx" 21 | GRAPH[4]="grmat --rmat_scale=22 --rmat_edgefactor=64" 22 | GRAPH[5]="grmat --rmat_scale=23 --rmat_edgefactor=32" 23 | GRAPH[6]="grmat --rmat_scale=24 --rmat_edgefactor=16" 24 | GRAPH[7]="market $DATADIR/${NAME[7]}/${NAME[7]}.mtx" 25 | GRAPH[8]="rgg --rgg_scale=24 --rgg_theshold=0.000548" 26 | 27 | mkdir -p eval 28 | DEVICE="0" 29 | for i in {0..8} 30 | do 31 | echo $EXEDIR/$EXECUTION ${GRAPH[$i]} $SETTING --device=$DEVICE --traversal-mode=${T_MODE[$i]} --jsondir=./eval/ "> ./eval/${NAME[$i]}.$EXECUTION.output.txt" 32 | $EXEDIR/$EXECUTION ${GRAPH[$i]} $SETTING --device=$DEVICE --traversal-mode=${T_MODE[$i]} --jsondir=./eval/ > ./eval/${NAME[$i]}.$EXECUTION.output.txt 33 | sleep 1 34 | done 35 | -------------------------------------------------------------------------------- /scripts/v0.5.x/topc/topc-test.sh: -------------------------------------------------------------------------------- 1 | 2 | EXEDIR=${1:-"../../build/bin"} 3 | DATADIR=${2:-"/data/gunrock_dataset/large"} 4 | for algo in bfs sssp bc pr cc; do 5 | ./${algo}-test.sh "$EXEDIR" "$DATADIR" 6 | done 7 | -------------------------------------------------------------------------------- /scripts/v1.x.x/perf/run.sh: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------------------ 2 | # Gunrock (v1.x.x): Performance Testing Script(s) 3 | # ------------------------------------------------------------------------ 4 | 5 | #!/bin/bash 6 | 7 | TIMESTAMP=`date '+%Y-%m-%d_%H:%M:%S'` 8 | EXEDIR="../../../build/bin" 9 | DATADIR="/data/gunrock_dataset/large" 10 | DEVICE="2" 11 | TAG="Gunrock-v1-0-0_TitanXp" 12 | 13 | for algo in bc; do # sssp bc pr cc; do 14 | ./${algo}.sh "$EXEDIR" "$DATADIR" "$DEVICE" "$TAG" 15 | done 16 | -------------------------------------------------------------------------------- /tools/associate_weights.py: -------------------------------------------------------------------------------- 1 | #!usr/bin/python 2 | 3 | """ 4 | Simple python script to generate random weight values for file_name.mtx graph 5 | """ 6 | 7 | import random 8 | import fileinput 9 | import sys 10 | 11 | ### check command line args 12 | if len(sys.argv) != 2: 13 | print 'Usage: python associate_weights.py file_name.mtx' 14 | sys.exit() 15 | 16 | ### Associate random weight (0, 63) values for each edge in the graph 17 | ograph = open(sys.argv[1].split('.')[0] + '.random.weight.mtx', 'w') 18 | is_edge = False 19 | for line in fileinput.input(sys.argv[1]): 20 | if line[0] == '%' or line == '\n': 21 | ograph.write(line) 22 | elif is_edge == False: 23 | is_edge = True 24 | ograph.write(line) 25 | elif is_edge == True: 26 | line = line.split('\n') 27 | new_line = line[0] + ' ' + str(random.randint(1, 63)) + '\n' 28 | ograph.write(new_line) 29 | 30 | ograph.close() 31 | -------------------------------------------------------------------------------- /tools/convert_to_gr/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | EXECUTION=./convert_to_gr_7.0_x86_64 4 | 5 | #put OS and Device type here 6 | DATADIR="/data/gunrock_dataset/large" 7 | OUTDIR="/data-2/galois_dataset" 8 | 9 | NAME[ 0]="soc-orkut" 10 | NAME[ 1]="ljournal-2008" 11 | NAME[ 2]="hollywood-2009" 12 | NAME[ 3]="indochina-2004" 13 | NAME[ 4]="kron_g500-logn21" 14 | NAME[ 5]="kron_g500-logn20" 15 | NAME[ 6]="delaunay_n24" 16 | NAME[ 7]="rgg_n_2_24_s0" 17 | NAME[ 8]="europe_osm" 18 | 19 | for i in {0..8} 20 | do 21 | echo $EXECUTION market $DATADIR/${NAME[$i]}/${NAME[$i]}.mtx --undirected --include-header --keep-num --edge_value --output-filename=$OUTDIR/${NAME[$i]}_ud_ev.mtx 22 | $EXECUTION market $DATADIR/${NAME[$i]}/${NAME[$i]}.mtx --undirected --include-header --keep-num --edge_value --output-filename=$OUTDIR/${NAME[$i]}_ud_ev.mtx 23 | echo /data/Compare/Galois-2.2.1/release/tools/graph-convert/graph-convert -mtx2floatgr $OUTDIR/${NAME[$i]}_ud_ev.mtx $OUTDIR/${NAME[$i]}_ud_ev.gr 24 | /data/Compare/Galois-2.2.1/release/tools/graph-convert/graph-convert -mtx2floatgr $OUTDIR/${NAME[$i]}_ud_ev.mtx $OUTDIR/${NAME[$i]}_ud_ev.gr 25 | done 26 | -------------------------------------------------------------------------------- /tools/gr_to_mtx_general.py: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/python 2 | 3 | """ 4 | Simple python script to convert .gr format graph to .mtx format 5 | """ 6 | 7 | import os 8 | import sys 9 | import string 10 | 11 | ### check command line args 12 | if (len(sys.argv)) != 2: 13 | print ' Usage: python gr_to_mtx_general.py graph.gr' 14 | sys.exit() 15 | 16 | ### gr graph input 17 | file_gr = sys.argv[1] 18 | 19 | ### matrix-market format output file 20 | file_mm = sys.argv[1].split('.')[0] + ".general.mtx" 21 | 22 | line_num = 0; 23 | with open(file_gr, 'r') as gr, open(file_mm, 'w') as mm: 24 | mm.write('%%MatrixMarket matrix coordinate Integer general\n') 25 | for line in gr: 26 | ### skip blank lines and comments 27 | if line.strip() == '' or 'c' in line: 28 | pass 29 | else: 30 | item = line.split(' ') 31 | if item[0] == 'p': 32 | ### write first line -> nodes nodes edges 33 | n = item[2] 34 | e = item[3].split() 35 | e = e[0] 36 | write = str(n) + ' ' + str(n)+ ' ' + str(e) + '\n' 37 | mm.write(write) 38 | if item[0] == 'a': 39 | ### write rest of mtx contents -> dst src wight 40 | v = item[1] 41 | u = item[2] 42 | w = item[3].split() 43 | w = w[0] 44 | write = str(u) + ' ' + str(v) + ' ' + str(w) + '\n' 45 | mm.write(write) 46 | gr.close() 47 | mm.close() 48 | -------------------------------------------------------------------------------- /tools/gr_to_mtx_symmetric.py: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/python 2 | 3 | """ 4 | Simple python script to convert .gr format graph to .mtx format 5 | """ 6 | 7 | import os 8 | import sys 9 | import string 10 | 11 | ### check command line args 12 | if (len(sys.argv)) != 2: 13 | print ' Usage: python gr_to_mtx_symmetric.py graph.gr' 14 | sys.exit() 15 | 16 | ### gr graph input 17 | file_gr = sys.argv[1] 18 | 19 | ### matrix-market format output file 20 | file_mm = sys.argv[1].split('.')[0] + ".symmetric.mtx" 21 | 22 | line_num = 0; 23 | with open(file_gr, 'r') as gr, open(file_mm, 'w') as mm: 24 | mm.write('%%MatrixMarket matrix coordinate Integer symmetric\n') 25 | for line in gr: 26 | ### skip blank lines and comments 27 | if line.strip() == '' or 'c' in line: 28 | pass 29 | else: 30 | item = line.split(' ') 31 | if item[0] == 'p': 32 | ### write first line -> nodes nodes edges 33 | n = item[2] 34 | e = item[3].split() 35 | e = e[0] 36 | write = str(n) + ' ' + str(n)+ ' ' + str(e) + '\n' 37 | mm.write(write) 38 | if item[0] == 'a': 39 | ### write rest of mtx contents -> dst src wight 40 | v = item[1] 41 | u = item[2] 42 | w = item[3].split() 43 | w = w[0] 44 | write = str(u) + ' ' + str(v) + ' ' + str(w) + '\n' 45 | mm.write(write) 46 | gr.close() 47 | mm.close() 48 | -------------------------------------------------------------------------------- /tools/mtx_to_gr.py: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/python 2 | 3 | """ 4 | Simple script to convert matrix-market formatted graph to .gr graph 5 | gr file: [http://www.dis.uniroma1.it/challenge9/format.shtml#graph] 6 | example: [http://www.dis.uniroma1.it/challenge9/samples/sample.gr] 7 | """ 8 | 9 | import os 10 | import sys 11 | import string 12 | 13 | if (len(sys.argv)) != 2: 14 | print ' Usage: python mtx_to_gr.py file_name.mtx' 15 | sys.exit() 16 | 17 | ### matrix-market mtx 18 | file_mm = sys.argv[1] 19 | 20 | ### GTGraph (.gr) format output file 21 | file_gr = sys.argv[1].split('.')[0] + ".gr" 22 | 23 | line_num = 0; 24 | with open(file_mm, 'r') as mm, open(file_gr, 'w') as gr: 25 | for line in mm: 26 | ### skip blank lines and comments 27 | if line.strip() == '' or '%' in line: 28 | pass 29 | else: 30 | if line_num == 0: 31 | ### write first line -> p sp nodes edges 32 | item = line.split(' ') 33 | n = item[0] 34 | e = item[2].split()[0] 35 | write = 'p ' + 'sp ' + str(n) + ' ' + str(e) + '\n' 36 | gr.write(write) 37 | line_num = 1 38 | else: 39 | ### write rest of mtx contents -> a u v w 40 | item = line.split(' ') 41 | v = item[0] 42 | u = item[1].split() 43 | u = u[0] 44 | if len(item) == 2: ### add weight 1 if absent 45 | write = 'a ' + str(u) + ' ' + str(v) + ' 1'+ '\n' 46 | elif len(item) == 3: ### write weight if exist 47 | w = item[2].split()[0] 48 | write = 'a ' + str(u) + ' ' + str(v) + ' ' + str(w) + '\n' 49 | gr.write(write) 50 | mm.close() 51 | gr.close() 52 | -------------------------------------------------------------------------------- /tools/remove_weights.py: -------------------------------------------------------------------------------- 1 | #!usr/bin/python 2 | 3 | """ 4 | simple python script to remove weight values associated with .mtx graph 5 | """ 6 | 7 | import random 8 | import fileinput 9 | import sys 10 | 11 | ### check command line args 12 | if len(sys.argv) != 2: 13 | print 'Usage: python remove_weights.py file_name.mtx' 14 | sys.exit() 15 | 16 | ### output matrix-market format graph 17 | ograph = open(sys.argv[1].split('.')[0] + '.no.weight.mtx', 'w') 18 | is_edge = False 19 | for line in fileinput.input(sys.argv[1]): 20 | if line[0] == '%' or line == '\n': 21 | ograph.write(line) 22 | elif is_edge == False: 23 | is_edge = True 24 | ograph.write(line) 25 | elif is_edge == True: 26 | line = line.split(' ') 27 | new_line = line[0] + ' ' + line[1] + '\n' 28 | ograph.write(new_line) 29 | ograph.close() 30 | -------------------------------------------------------------------------------- /tools/replace_weights.py: -------------------------------------------------------------------------------- 1 | #!usr/bin/python 2 | 3 | """ 4 | simple python script to generate random weight value for .mtx graph 5 | used for replacing original associated weight such as all 1s. 6 | """ 7 | 8 | import random 9 | import fileinput 10 | import sys 11 | 12 | ### check command line args 13 | if len(sys.argv) != 2: 14 | print 'Usage: python replace_weights.py file_name.mtx' 15 | sys.exit() 16 | 17 | ### output matrix-market graph 18 | ograph = open(sys.argv[1].split('.')[0] + '.random.weight.mtx', 'w') 19 | is_edge = False 20 | for line in fileinput.input(sys.argv[1]): 21 | if line[0] == '%' or line == '\n': 22 | ograph.write(line) 23 | elif is_edge == False: 24 | is_edge = True 25 | ograph.write(line) 26 | elif is_edge == True: 27 | line = line.split(' ') 28 | res = line[0] + ' ' + line[1] + ' ' + str(random.randint(1, 63)) + '\n' 29 | ograph.write(res) 30 | ograph.close() 31 | -------------------------------------------------------------------------------- /unittests/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | project(unittests) 3 | message("-- Project Added: ${PROJECT_NAME}") 4 | include(${CMAKE_SOURCE_DIR}/cmake/SetSubProject.cmake) 5 | 6 | ### tests using googletest and googlemock 7 | add_test(NAME UNITTESTS COMMAND unittests) 8 | target_link_libraries(unittests gunrock gtest_main) 9 | set_tests_properties(UNITTESTS PROPERTIES PASS_REGULAR_EXPRESSION "PASSED") 10 | -------------------------------------------------------------------------------- /unittests/test_binarysearch.h: -------------------------------------------------------------------------------- 1 | /* 2 | * @brief Unit test for BinarySearch 3 | * @file test_binarysearch.cuh 4 | */ 5 | 6 | #include 7 | 8 | using namespace gunrock; 9 | 10 | TEST(utils, BinarySearch) { 11 | cudaError_t retval = BinarySearchTest(); 12 | EXPECT_EQ(retval, cudaSuccess); 13 | } 14 | -------------------------------------------------------------------------------- /unittests/test_lib_pr.h: -------------------------------------------------------------------------------- 1 | /* 2 | * @brief PageRank test for shared library advanced interface 3 | * @file test_lib_pr.h 4 | */ 5 | 6 | TEST(sharedlibrary, pagerank) { 7 | 8 | int num_nodes = 7, num_edges = 26; 9 | int row_offsets[8] = {0, 3, 6, 11, 15, 19, 23, 26}; 10 | int col_indices[26] = {1, 2, 3, 0, 2, 4, 0, 1, 3, 4, 5, 0, 2, 11 | 5, 6, 1, 2, 5, 6, 2, 3, 4, 6, 3, 4, 5}; 12 | 13 | int *top_nodes = new int [num_nodes]; 14 | float *top_ranks = new float[num_nodes]; 15 | 16 | double elapsed = pagerank(num_nodes, num_edges, row_offsets, 17 | col_indices, 1, top_nodes, top_ranks); 18 | 19 | double nodes[7] = {2, 3, 4, 5, 0, 1, 6}; 20 | double scores[7] = {0.186179, 0.152261, 0.152261, 0.151711, 21 | 0.119455, 0.119455, 0.118680}; 22 | 23 | for (int node = 0; node < num_nodes; ++node) { 24 | EXPECT_EQ(top_nodes[node], nodes[node]) 25 | << "Node indices differ at node index " << node; 26 | EXPECT_NEAR(top_ranks[node], scores[node], 0.0000005) 27 | << "Scores differ at node index " << node; 28 | } 29 | 30 | delete[] top_nodes; top_nodes = NULL; 31 | delete[] top_ranks; top_ranks = NULL; 32 | 33 | } 34 | -------------------------------------------------------------------------------- /unittests/test_lib_sm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * @brief Subgraph matching test for shared library advanced interface 3 | * @file test_lib_sm.h 4 | */ 5 | 6 | TEST(sharedlibrary, sm) { 7 | 8 | int num_data_nodes = 5, num_data_edges = 5; 9 | int data_row_offsets[6] = {0, 2, 6, 7, 9}; 10 | int data_col_indices[5] = {1, 3, 0, 2, 3}; 11 | 12 | int num_query_nodes = 3, num_query_edges = 3; 13 | int query_row_offsets[4] = {0, 2, 4, 6}; 14 | int query_col_indices[3] = {1, 2, 0}; 15 | 16 | int *sm_counts = new int [num_data_nodes]; 17 | 18 | double elapsed = sm(num_data_nodes, num_data_edges, data_row_offsets, 19 | data_col_indices, num_query_nodes, num_query_edges, 20 | query_row_offsets, query_col_indices, 1, sm_counts); 21 | 22 | double counts[5] = {1, 1, 0, 1, 0}; 23 | 24 | for (int node = 0; node < num_data_nodes; ++node) { 25 | EXPECT_EQ(sm_counts[node], counts[node]) 26 | << "Number of matched subgraphs differ at node index " << node; 27 | } 28 | 29 | delete[] sm_counts; sm_counts = NULL; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /unittests/test_repeatfor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * @brief Unit test for RepeatFor 3 | * @file test_repeatfor.cuh 4 | */ 5 | 6 | #include 7 | 8 | using namespace gunrock; 9 | 10 | TEST(operators, RepeatFor) { 11 | cudaError_t retval = RepeatForTest(); 12 | EXPECT_EQ(retval, cudaSuccess); 13 | } 14 | -------------------------------------------------------------------------------- /unittests/test_segreduce.h: -------------------------------------------------------------------------------- 1 | /* 2 | * @brief Unit test for RepeatFor 3 | * @file test_segreduce.h 4 | */ 5 | 6 | #include 7 | 8 | using namespace gunrock; 9 | 10 | TEST(operators, SegReduce) { 11 | cudaError_t retval = SegReduceTest(); 12 | EXPECT_EQ(retval, cudaSuccess); 13 | } 14 | --------------------------------------------------------------------------------