{"id":20048457,"url":"https://github.com/aggstam/triangles_counting","last_synced_at":"2025-10-06T12:18:23.806Z","repository":{"id":155101802,"uuid":"424260329","full_name":"aggstam/triangles_counting","owner":"aggstam","description":"This program implements Scalable Triangle Counting algorithm introduced by S.Acerm, A.Yasar, S.Rajamanickam, M.Wolf and U.Catalyurek.","archived":false,"fork":false,"pushed_at":"2023-05-16T15:33:56.000Z","size":44,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-02T08:24:17.420Z","etag":null,"topics":["c","graph","mpi","triangle-counting"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aggstam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-03T14:38:25.000Z","updated_at":"2023-05-15T06:03:02.000Z","dependencies_parsed_at":"2025-01-12T20:33:19.323Z","dependency_job_id":"c5ed0877-7f57-41f1-9aa1-bc12d88414e1","html_url":"https://github.com/aggstam/triangles_counting","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aggstam/triangles_counting","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aggstam%2Ftriangles_counting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aggstam%2Ftriangles_counting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aggstam%2Ftriangles_counting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aggstam%2Ftriangles_counting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aggstam","download_url":"https://codeload.github.com/aggstam/triangles_counting/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aggstam%2Ftriangles_counting/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278608137,"owners_count":26014911,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","graph","mpi","triangle-counting"],"created_at":"2024-11-13T11:44:12.203Z","updated_at":"2025-10-06T12:18:23.747Z","avatar_url":"https://github.com/aggstam.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# triangles_counting\nThis program implements Scalable Triangle Counting algorithm introduced by S.Acerm, A.Yasar, S.Rajamanickam, M.Wolf and U.Catalyurek [1].\n\u003cbr\u003e\nGraph is read from an input file created by RandomGraph generator by S.Pettie and V.Ramachandran [2].\n\u003cbr\u003e\nTwo implementations are included, one executing the algorithm in serial, and one using the MPI Standard.\n\u003cbr\u003e\nMPI implementation requires *openmpi* package to be installed.\n\u003cbr\u003e\nGraph Matrix is conformally partioned to blocks, based on MPI processes.\n\u003cbr\u003e\nEach process is assigned with a block and calculate a local triangles count.\n\u003cbr\u003e\nIn order to calculate the local triangles count, required blocks are retrieved from other processes, based on the algorithm.\n\n## Usage\nBoth version can be invocted via the Makefile, or by directly compiling and executing.\n\n### Make usage\n#### Normal code\n```\n% make\n```\nTo include a different input file:\n```\n% make FILE={file_path}\n```\n\n#### MPI code\n```\n% make mpi\n```\nTo configure different how many processes to use:\n```\n% make mpi PROCESSES={processes}\n```\nTo include a different input file:\n```\n% make mpi FILE={file_path}\n```\n\n### Direct usage\n#### Normal code\nCompilation:\n```\n% gcc -o triangles_counting triangles_counting.c\n```\nExecution:\n```\n% ./triangles_counting {input_file}\n```\n\n#### MPI code\nCompilation:\n```\n% mpicc -lm -o mpi_triangles_counting mpi_triangles_counting.c\n```\nExecution:\n```\n% mpiexec -np {processes} ./mpi_triangles_counting {input_file}\n```\n\n## Execution examples\n### Normal code\n```\n❯ make\nExecuting normal code...\ngcc -o triangles_counting triangles_counting.c\n./triangles_counting grph_triangles\nCounting Triangles of Graph retrieved from input file: grph_triangles\nNodes count: 1000\nAlgorithm started, please wait...\nGraph contains: 14 triangles\nAlgorithm finished!\nTime spend: 1.403673 secs\nProgram terminates.\n```\n\n### MPI code\n```\n❯ make mpi\nExecuting MPI code...\nmpicc -lm -o mpi_triangles_counting mpi_triangles_counting.c\nmpiexec -np 4 ./mpi_triangles_counting grph_triangles\nCounting Triangles of Graph retrieved from input file: grph_triangles\nNodes count: 1000\nAlgorithm started, please wait...\nGraph contains: 14 triangles\nAlgorithm finished!\nTime spend: 1.029489 secs\n```\n\n## References\n[1] S. Acer, A. Yaşar, S. Rajamanickam, M. Wolf and Ü. V. Catalyürek, \"Scalable Triangle Counting on Distributed-Memory Systems,\" 2019 IEEE High Performance Extreme Computing Conference (HPEC), 2019, pp. 1-5, doi: 10.1109/HPEC.2019.8916302.\n\u003cbr\u003e\n[2] http://www.dis.uniroma1.it/challenge9/code/Randgraph.tar.gz\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faggstam%2Ftriangles_counting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faggstam%2Ftriangles_counting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faggstam%2Ftriangles_counting/lists"}