---
name: "_my_pe"
section: "3"
platform: "linux"
package: "openmpi"
version: "5.0.11-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/_my_pe"
---

# \_my\_pe(3)

*shmem\_my\_pe*, my\_pe, \_my\_pe - Returns the virtual PE number of the calling PE.

## 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

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)](/intro_shmem/3.md) [*shmem\_n\_pes*(3)](/shmem_n_pes/3.md) [*shmem\_init*(3)](/shmem_init/3.md)

## COPYRIGHT

2003-2026, The Open MPI Community
