{"id":21437696,"url":"https://github.com/sbstndb/nbody_k","last_synced_at":"2026-05-21T07:43:19.689Z","repository":{"id":252581012,"uuid":"840477658","full_name":"sbstndb/nbody_k","owner":"sbstndb","description":"A simple 3D naïve NBody simulation using Kokkos enabling CUDA or OpenMP backend","archived":false,"fork":false,"pushed_at":"2024-08-10T22:03:08.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-23T09:43:45.625Z","etag":null,"topics":["cuda","kokkos","nbody","openmp","simulation"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sbstndb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-08-09T19:55:13.000Z","updated_at":"2024-08-15T13:12:07.000Z","dependencies_parsed_at":"2024-08-10T23:28:52.364Z","dependency_job_id":null,"html_url":"https://github.com/sbstndb/nbody_k","commit_stats":null,"previous_names":["sbstndb/nbody_kokkos","sbstndb/nbody_k"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbstndb%2Fnbody_k","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbstndb%2Fnbody_k/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbstndb%2Fnbody_k/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbstndb%2Fnbody_k/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sbstndb","download_url":"https://codeload.github.com/sbstndb/nbody_k/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243950792,"owners_count":20373664,"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","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":["cuda","kokkos","nbody","openmp","simulation"],"created_at":"2024-11-23T00:28:28.482Z","updated_at":"2026-05-21T07:43:19.660Z","avatar_url":"https://github.com/sbstndb.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Introduction\n\nHere is a simple NBody simulator. It uses a naive algorithm - in a O(n²) complexity. \nThe aim of this project is to have a first look at the Kokkos library.\n\nFrom the [Kokkos](https://github.com/kokkos) github repo : \n\u003e The Kokkos C++ Performance Portability Ecosystem is a production level solution for writing modern C++ applications in a hardware agnostic way.\nThanks to Kokkos, you can compile this code for multiple backends like OpenMP, CUDA, HIP. \n\n\n**Disclaimer:** Please note that this project is a work in progress and may contain errors or programming oversights due to its experimental nature. Your understanding and feedback are appreciated as we continue to develop and refine this code.\n\n\n# Prerequisites\nThe code use Kokkos as a performance portability library. Then, you must have it to compile the project.\nI suggest you to install it and read the documentation for further understanding. \n\n\n# Compilation\nCompile the code by specifying your kokkos install directory with the following commands : \n```\ncmake -B build -S . -DKokkos_ROOT=/usr/local/lib64/cmake/Kokkos\ncmake --build build/\n```\nI Suggest you to read the Kokkos documentation if you want to compile with a specific backend. \n\n\n# Usage\nYou can currently launch the SOA version named `NBody_SOA` with :\n```\n./build/NBody_3D -N 10240 -nrepeat 100 -f 100 -d 0.001\n```\nWith the following arguments : \n- `-n` particles\n- `-nrepeat` iterations\n- `d` timestep\n- `f` frames - each frame consume `nrepeat` iterations and save the values in the `frames` directory\n\n# Todo \n### To-Do List\n\n- [ ] Refactoring\n- [ ] Hierarchical parallelism with Kokkos\n- [ ] Shared memory kernels with scratch pads\n- [ ] Kokkos::SIMD usage\n- [ ] Barnes-Hut implementation\n- [ ] Fast Multipole Method (FMM) implementation\n- [ ] Add periodic boundary conditions\n- [ ] Python animation generator\n- [x] Set up the CMake build system\n- [x] Test the code on different backends (CUDA, OpenMP, Serial)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbstndb%2Fnbody_k","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsbstndb%2Fnbody_k","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbstndb%2Fnbody_k/lists"}