\_NUM\_PES(3) Open MPI \_NUM\_PES(3)

\_num\_pes, \_num\_pes shmem\_n\_pes &lt;#shmem-n-pes&gt; - Returns the number of processing elements (PEs) used to run the application.

# [SYNOPSIS](#SYNOPSIS)

C or C++:

```
#include <mpp/shmem.h>
int _num_pes (void)
int shmem_n_pes (void)
```

Fortran:

```
include 'mpp/shmem.fh'
I = NUM_PES ()
I = SHMEM_N_PES ()
```

# [DESCRIPTION](#DESCRIPTION)

num\_pes() or shmem\_n\_pes() return the total number of PEs running in an application.

**See also:**

[*intro\_shmem*(3)](/man/enterprise-packages/openmpi-cuda-13.2/intro_shmem.3) [*shmem\_my\_pe*(3)](/man/enterprise-packages/openmpi-cuda-13.2/shmem_my_pe.3) [*shmem\_init*(3)](/man/enterprise-packages/openmpi-cuda-13.2/shmem_init.3)

# [Copyright](#Copyright)

2003-2026, The Open MPI Community

September 11, 2026

---

Document: _num_pes(3) from openmpi-cuda-13.2 5.0.11-r0 (Chainguard OS)
Source: https://github.com/open-mpi/ompi
