# GPU parallelization error, ranks not equal to gpu number

**URL:** <https://pyfr.discourse.group/t/gpu-parallelization-error-ranks-not-equal-to-gpu-number/661>\
**Category:** Errors\
**Tags:** cuda, mpi\
**Created:** [1 August 2022 13:43 UTC](https://pyfr.discourse.group/t/gpu-parallelization-error-ranks-not-equal-to-gpu-number/661 "2022-08-01T13:43:41Z")\
**Posts on this page:** 1\
**Showing post:** 20

<div class="post-metadata">

**Author:** ![WillT](https://avatars.discourse-cdn.com/v4/letter/w/bc79bd/32.png) [@WillT](https://pyfr.discourse.group/u/WillT)\
**Post date:** [19 September 2023 09:13 UTC](https://pyfr.discourse.group/t/gpu-parallelization-error-ranks-not-equal-to-gpu-number/661/20 "2023-09-19T09:13:08Z")

</div>

mpi4py is a python wrapper for the functionality implemented in an MPI library ie openMPI, MPICH, spectrum…

In order to run PyFR across multiple ranks, you have to use the launch application with `mpiexec` (some libraries also have `mpirun` but this is not part of the standard), this is the same for any application you wish to use MPI with.

This will launch `n` instances of PyFR and give each a rank ID number. Then, inside pyfr we use the mpi4py package to initialise MPI, detect the rank id, and handle the communication required to run the calculation. For example, send/receive packets of data between ranks.

mpi4py is not independent of the MPI library

---

_[View the full topic](https://pyfr.discourse.group/t/gpu-parallelization-error-ranks-not-equal-to-gpu-number/661)._
