{"id":16863677,"url":"https://github.com/harrism/mini-nbody","last_synced_at":"2025-10-06T10:26:33.715Z","repository":{"id":14299600,"uuid":"17008160","full_name":"harrism/mini-nbody","owner":"harrism","description":"A simple gravitational N-body simulation in less than 100 lines of C code, with CUDA optimizations.","archived":false,"fork":false,"pushed_at":"2014-02-21T02:53:44.000Z","size":134,"stargazers_count":101,"open_issues_count":2,"forks_count":27,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-04T04:41:22.517Z","etag":null,"topics":["astrophysics","benchmark","cuda","nbody"],"latest_commit_sha":null,"homepage":null,"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/harrism.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}},"created_at":"2014-02-20T03:37:14.000Z","updated_at":"2025-03-15T17:29:26.000Z","dependencies_parsed_at":"2022-08-29T17:50:39.053Z","dependency_job_id":null,"html_url":"https://github.com/harrism/mini-nbody","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/harrism/mini-nbody","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harrism%2Fmini-nbody","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harrism%2Fmini-nbody/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harrism%2Fmini-nbody/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harrism%2Fmini-nbody/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/harrism","download_url":"https://codeload.github.com/harrism/mini-nbody/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harrism%2Fmini-nbody/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278593385,"owners_count":26012494,"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":["astrophysics","benchmark","cuda","nbody"],"created_at":"2024-10-13T14:39:18.523Z","updated_at":"2025-10-06T10:26:33.681Z","avatar_url":"https://github.com/harrism.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"mini-nbody: A simple N-body Code\n================================\n\nA simple gravitational N-body simulation in less than 100 lines of C code, with CUDA optimizations.\n\nBenchmarks\n----------\n\nThere are 5 different benchmarks provided for CUDA and MIC platforms.\n\n1. nbody-orig : the original, unoptimized simulation (also for CPU)\n2. nbody-soa  : Conversion from array of structures (AOS) data layout to structure of arrays (SOA) data layout\n3. nbody-flush : Flush denormals to zero (no code changes, just a command line option)\n4. nbody-block : Cache blocking\n5. nbody-unroll / nbody-align : platform specific final optimizations (loop unrolling in CUDA, and data alignment on MIC)\n\nFiles\n-----\n\nnbody.c : simple, unoptimized OpenMP C code\ntimer.h : simple cross-OS timing code\n\nEach directory below includes scripts for building and running a \"shmoo\" of five successive optimizations of the code over a range of data sizes from 1024 to 524,288 bodies.\n\ncuda/ : folder containing CUDA optimized versions of the original C code (in order of performance on Tesla K20c GPU)\n  1. nbody-orig.cu   : a straight port of the code to CUDA (shmoo-cuda-nbody-orig.sh)\n  2. nbody-soa.cu    : conversion to structure of arrays (SOA) data layout (shmoo-cuda-nbody-soa.sh)\n  3. nbody-soa.cu + ftz : Enable flush denorms to zero (shmoo-cuda-nbody-ftz.sh)\n  4. nbody-block.cu  : cache blocking in CUDA shared memory (shmoo-cuda-nbody-block.sh)\n  5. nbody-unroll.cu : addition of \"#pragma unroll\" to inner loop (shmoo-cuda-nbody-unroll.sh)\n\nmic/  : folder containing Intel Xeon Phi (MIC) optimized versions of the original C code (in order of performance on Xeon Phi 7110P)\n  1. ../nbody-orig.cu : original code (shmoo-mic-nbody-orig.sh)\n  2. nbody-soa.c     : conversion to structure of arrays (SOA) data layout (shmoo-mic-nbody-soa.sh)\n  3. nbody-soa.cu + ftz : Enable flush denorms to zero (shmoo-mic-nbody-ftz.sh)\n  4. nbody-block.c   : cache blocking via loop splitting (shmoo-mic-nbody-block.sh)\n  5. nbody-align.c   : aligned memory allocation and vector access (shmoo-mic-nbody-align.sh)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharrism%2Fmini-nbody","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharrism%2Fmini-nbody","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharrism%2Fmini-nbody/lists"}