{"id":23207932,"url":"https://github.com/pkestene/ppkmhd","last_synced_at":"2025-08-19T03:30:37.659Z","repository":{"id":86494730,"uuid":"209853926","full_name":"pkestene/ppkMHD","owner":"pkestene","description":"MPI+Kokkos implementation of spectral difference method (SDM) high order schemes","archived":false,"fork":false,"pushed_at":"2024-11-09T13:09:45.000Z","size":2327,"stargazers_count":26,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-09T14:20:14.513Z","etag":null,"topics":["cea","cfd","cpp","cuda","finite-volume","finite-volume-method","finite-volumes","gpu","gpu-computing","hpc","hydrodynamics","kokkos","magnetohydrodynamics","mpi","parallel-computing","performance-portability"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pkestene.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":"2019-09-20T18:14:23.000Z","updated_at":"2024-11-09T13:09:50.000Z","dependencies_parsed_at":null,"dependency_job_id":"38cded7a-4009-4cf5-9071-74bd65df36d2","html_url":"https://github.com/pkestene/ppkMHD","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pkestene%2FppkMHD","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pkestene%2FppkMHD/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pkestene%2FppkMHD/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pkestene%2FppkMHD/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pkestene","download_url":"https://codeload.github.com/pkestene/ppkMHD/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230312448,"owners_count":18206858,"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":["cea","cfd","cpp","cuda","finite-volume","finite-volume-method","finite-volumes","gpu","gpu-computing","hpc","hydrodynamics","kokkos","magnetohydrodynamics","mpi","parallel-computing","performance-portability"],"created_at":"2024-12-18T17:26:38.208Z","updated_at":"2025-08-19T03:30:37.589Z","avatar_url":"https://github.com/pkestene.png","language":"C++","readme":"[![DOI](https://zenodo.org/badge/209853926.svg)](https://zenodo.org/badge/latestdoi/209853926) ![C/C++ CI](https://github.com/pkestene/ppkMHD/workflows/C/C++%20CI/badge.svg)\n\n# ppkMHD\n\n## What is it ?\n\nppkMHD stands for Performance Portable Kokkos for Magneto-HydroDynamics (MHD) solvers.\n\nHere a small list of numerical schemes implementations:\n\n- second order MUSCL-HANCOCK scheme for hydrodynamics and MHD\n- high-order MOOD (hydrodynamics only)\n- high-order Spectral Difference Method schemes: hydrodynamics only\n\nAll scheme are available in 2D and 3D using Kokkos+MPI implementation, and support at least the OpenMP and CUDA kokkos backends (other backends may be used, but not tested).\n\n## Dependencies\n\n* [Kokkos](https://github.com/kokkos/kokkos) library will either be built by ppkMHD by using cmake option `-DPPKMHD_BUILD_KOKKOS=ON`, either be detected if you already have it installed.\n* [cmake](https://cmake.org/) with version \u003e= 3.X (3.X is chosen to meet Kokkos own requirement for cmake; i.e. it might increase in the future)\n\n\nFor beginner user, wu suggest that you build ppkMHD with `-DPPKMHD_BUILD_KOKKOS=ON` so that Kokkos is built together, with the same flags as the main application.\n\n## Build\n\nA few example builds, with minimal configuration options.\n\n### If you already have Kokkos installed\n\nIf you build kokkos yourself, we advise you to always active HWLOC TPLS.\n\nJust make sure that your env variable `CMAKE_PREFIX_PATH` point to the location where Kokkos where installed. More precisely if Kokkos is installed in `KOKKOS_ROOT`, you add `$KOKKOS_ROOT/lib/cmake` to your `CMAKE_PREFIX_PATH`; this way kokkos will be found automagically by cmake, and the right Kokkos hardware backend will be selected.\n\n```shell\n# cd into ppkMHD toplevel sources\ncmake -S . -B _build/default -DPPKMHD_BUILD_KOKKOS=OFF\ncmake --build _build/default -j 6\n```\n\n### Build ppkMHD and kokkos without MPI activated for Kokkos-openmp backend\n\n* Create a build directory, configure and make\n\n```shell\n# cd into ppkMHD toplevel sources\ncmake -S . -B _build/openmp -DPPKMHD_BUILD_KOKKOS=ON -DPPKMHD_USE_MPI=OFF -DPPKMHD_BACKEND=OpenMP -DKokkos_ENABLE_HWLOC=ON\ncmake --build _build/openmp -j 6\n```\n\nAdd variable CXX on the cmake command line to change the compiler (clang++, icpc, pgcc, ....).\n\n### Build ppkMHD and kokkos without MPI activated for Kokkos-cuda backend\n\n* Create a build directory, configure and make\n\n```shell\n# cd into ppkMHD toplevel sources\ncmake -S . -B _build/cuda -DPPKMHD_BUILD_KOKKOS=ON -DPPKMHD_USE_MPI=OFF -DPPKMHD_BACKEND=Cuda\n# note: GPU architecture will be detected when building on a host with a GPU; if you're building on a host, and running on another machine\n# you'll need to tell kokkos what is the target architecture, e.g. add flag like '-DKokkos_ARCH_TURING75=ON' on the cmake configure line\ncmake --build _build/cuda -j 6\n```\n\n### Build ppkMHD with MPI activated for Kokkos-cuda backend\n\nPlease make sure to use a **CUDA-aware MPI implementation** (OpenMPI or MVAPICH2) built with the proper flags for activating CUDA support.\n\nIt may happen that eventhough your MPI implementation is actually cuda-aware, cmake MPI detection (through a call to `find_package(MPI)` macro) may fails to detect if your MPI implementation is cuda aware. In that case, you can enforce cuda awareness by turning option `PPKMHD_USE_MPI_CUDA_AWARE_ENFORCED` to ON.\n\nYou don't need to use mpi compiler wrapper mpicxx, cmake *should* be able to correctly populate `MPI_CXX_INCLUDE_PATH`, `MPI_CXX_LIBRARIES` which are passed to all final targets by using the alias library `MPI::MPI_CXX`.\n\n* Create a build directory, configure and make\n\n```shell\nmkdir build; cd build\ncmake -DPPKMHD_USE_MPI=ON -DPPKMHD_BACKEND=Cuda -DKokkos_ARCH_TURING75=ON ..\nmake -j 4\n```\n\nExample command line to run the application (1 GPU used per MPI task)\n\n```shell\nmpirun -np 4 ./ppkMHD ./test_implode_2D_mpi.ini\n```\n\n### Additional features\n\nIn order to activate building SDM (Spectral Difference Method) schemes, use cmake option `-DPPKMHD_USE_SDM=ON`.\n\nThe MOOD numerical scheme require some linear algebra (QR decomposition) on the host (not device). This is done using a Blas/Lapack implementation using the C language interface named [Lapacke](https://netlib.org/lapack/lapacke.html).\n\nPlease note that Atlas doesn't provide Lapackage.\nCurrently (March 2017), on Ubuntu 16.04, package libatlas-dev is not compatible with package Lapacke (generate errors at link time). So please either [Netlib/Lapack](https://netlib.org/lapack/) or [OpenBLAS](https://www.openblas.net/) implementation.\n\nIf you want to enforce the use of OpenBLAS, just use a recent cmake (\u003e=3.6) and add `-DBLA_VENDOR` on the cmake command line. This will tell the cmake build system (through the call to find_package(BLAS) ) to only look for the OpenBLAS implementation.\n\nOn a recent Ubuntu, if atlas is not installed, but OpenBLAS is, you don't need to have a bleeding edge cmake, current cmake will find OpenBLAS.\n\n## See also\n\n* [ppkMHD Wiki](https://github.com/pkestene/ppkMHD/wiki)\n* [Implementing Spectral Difference Methods (SDM) for Compressible Euler flow simulations using performance portable library kokkos](https://www.researchgate.net/publication/326400645_Implementing_Spectral_Difference_Methods_SDM_for_Compressible_Euler_flow_simulations_using_performance_portable_library_kokkos)\n* [Implementing Spectral Difference Methods (SDM) for Compressible Euler flow simulations using performance portable library kokkos (astrosim 2018)](https://www.researchgate.net/publication/328175816_Implementing_Spectral_Difference_Methods_SDM_for_Compressible_Euler_flow_simulations_using_performance_portable_library_kokkos)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpkestene%2Fppkmhd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpkestene%2Fppkmhd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpkestene%2Fppkmhd/lists"}