\_MY\_PE(3) Open MPI \_MY\_PE(3)

shmem\_my\_pe &lt;#shmem-my-pe&gt;, my\_pe, \_my\_pe - Returns the virtual PE number of the calling PE.

# [SYNOPSIS](#SYNOPSIS)

C or C++:

```
#include <mpp/shmem.h>
int shmem_my_pe (void)
int my_pe (void)
```

Fortran:

```
include 'mpp/shmem.fh'
I = SHMEM_MY_PE ()
I = MY_PE ()
```

# [DESCRIPTION](#DESCRIPTION)

my\_pe() or shmem\_my\_pe() return the processing element (PE) number of the calling PE. It accepts no arguments. The result is an integer between 0 and npes - 1, where npes is the total number of PEs executing the current program.

**See also:**

[*intro\_shmem*(3)](/man/enterprise-packages/openmpi-cuda-13.2/intro_shmem.3) [*shmem\_n\_pes*(3)](/man/enterprise-packages/openmpi-cuda-13.2/shmem_n_pes.3) [*shmem\_init*(3)](/man/enterprise-packages/openmpi-cuda-13.2/shmem_init.3)

# [Copyright](#Copyright)

2003-2026, The Open MPI Community

October 9, 2026

---

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