18.2.3. _num_pes — Open MPI 5.0.8 documentation

# 18.2.3. _num_pes

_num_pes, _num_pes shmem_n_pes - Returns the number of processing elements (PEs) used to run the application.

## 18.2.3.1. 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 ()

## 18.2.3.2. DESCRIPTION

num_pes() or shmem_n_pes() return the total number of PEs running in an application.

See also

intro_shmem(3) shmem_my_pe(3) shmem_init(3)