{"id":18062247,"url":"https://github.com/iximiel/plumedflagship_parallelism","last_synced_at":"2025-07-14T12:42:25.330Z","repository":{"id":178583203,"uuid":"659623859","full_name":"Iximiel/PlumedFlagship_parallelism","owner":"Iximiel","description":"Short and simple introduction to developing parallel CVs in plumed2","archived":false,"fork":false,"pushed_at":"2023-07-06T10:13:50.000Z","size":187,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-02T23:00:05.041Z","etag":null,"topics":["parallelism","plumed-school","plumed2"],"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/Iximiel.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":"2023-06-28T08:12:37.000Z","updated_at":"2023-07-06T10:02:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"c0b8c50d-aea6-4d0f-ae8f-fb9eb14df74d","html_url":"https://github.com/Iximiel/PlumedFlagship_parallelism","commit_stats":null,"previous_names":["iximiel/plumedflagship_parallelism"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Iximiel/PlumedFlagship_parallelism","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Iximiel%2FPlumedFlagship_parallelism","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Iximiel%2FPlumedFlagship_parallelism/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Iximiel%2FPlumedFlagship_parallelism/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Iximiel%2FPlumedFlagship_parallelism/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Iximiel","download_url":"https://codeload.github.com/Iximiel/PlumedFlagship_parallelism/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Iximiel%2FPlumedFlagship_parallelism/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265294787,"owners_count":23742554,"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":["parallelism","plumed-school","plumed2"],"created_at":"2024-10-31T05:06:24.756Z","updated_at":"2025-07-14T12:42:25.259Z","avatar_url":"https://github.com/Iximiel.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Plumed Flagship meeting: Lecture: Parallel and GPUs programming in PLUMED\n\nWe have some simple examples for using parallelism in plumed:\n\n- `SerialCoordination.cpp` is a ~~vandalized~~ simplified version of the cv `Coordination`\n- `OMPCoordination.cpp` is an example on how openMP can be used in Plumed\n- `MPICoordination.cpp` is an example on how MPI can be used in Plumed\n- `CUDACoordination.cpp` is an example on trying to user Cuda for solving this problem (it needs an ad hoc compiler queue and the kernel `CUDACoordinationkernel.cu` )\n\n(The original `Coordination` combines the use of both openMP and MPI)\n\nPlumed helps the developer with some tools for parallelism:\n- `tools/OpenMP.h` contains some function that are useful in working with openMP.\nIn the example we are using `OpenMP::getNumThreads()` to get the number of threads from the environmental variable `PLUMED_NUM_THREADS`\n\n- `tools/Communicator.h` is present as the variable `comm` that is inherited through `PLMD::Action`.\n`PLMD::Communicator` is an interface to some of the functionalities of the C API of `mpi.h`.\nIn the example we are using `PLMD::Communicator::Get_size()` to get the number of the processes spawned by mpirun, \n`PLMD::Communicator::Get_rank()` to get the id of the process, and \n`PLMD::Communicator::Sum()` to sum the result of the coordination and make the correct value avayable for further calculations.\n\n## Intro\n\nThe exercise uses `Base.hpp` to give a very base version of the COORDINATION CV, in this case it is returning the sum of the number of atoms that are within R_0 from each atom. For simplicity it the pbcs will be ignored throught all of the examples.\n`MyCoordinationBase` in `Base.hpp` do not have the calculate method and so the example will have more or less the following structure:\n\n```C++\n#include \"Base.hpp\"\nnamespace PLMD {\nclass MyCoordination : public MyCoordinationBase {\npublic:\n  explicit MyCoordination(const ActionOptions \u0026ao)\n      : Action(ao), MyCoordinationBase(ao) {}\n  ~MyCoordination() = default;\n  // active methods:\n  void calculate() override;\n};\nPLUMED_REGISTER_ACTION(MyCoordination, \"MYCOORDINATION\")\nvoid MyCoordination::calculate() {\n...code goes here...\n}\n} // namespace PLMD\n\n```\nFor automation purposes (see the `Makefile`) we are using the same key `PLUMED_REGISTER_ACTION(MyCoordination, \"MYCOORDINATION\")` for all of the examples.\n### Prerequisites\n- Plumed 2.9.0 configured and installed with `--enable-modules=all` and MPI\n  - in my workstation I am using gcc 9.4.0 and openmpi 4.1.1\n- For the GPU offloading the example is written with Nvdia's Cuda\n  - In my workstation I am using cuda 11.7 with a T1000 card\n\n\n## [The serial code](Readme_Serial.md)\n\n## [Threading: openMP](Readme_OMP.md)\n\n## [Processes: MPI](Readme_MPI.md)\n\n## [EXTRA: GPU offloading with Cuda](Readme_CUDA.md)\n\n## Closing information\n\nThe file in the `Solution` directory give the correct results\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiximiel%2Fplumedflagship_parallelism","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiximiel%2Fplumedflagship_parallelism","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiximiel%2Fplumedflagship_parallelism/lists"}