START_PES(3)
π START_PES(3) β the Open MPI glow-up π
okay bestie, sit down, hydrate, because we're talking about shmem_init / start_pes from the Open MPI manual, and it's literally the first thing your SHMEM program does. main character energy only. π
β¨ NAME β¨
shmem_init, start_pes β Allocates a block of memory from the symmetric heap.
yes that's the official one-liner and yes it's giving "humble but essential." π«Ά
πΈ SYNOPSIS πΈ
C or C++:
void shmem_init(void)
void start_pes(int npes)
Fortran:
CALL SHMEM_INIT()
CALL START_PES(npes)
π¦ DESCRIPTION π¦
okay so the tea is: the start_pes routine should be the first statement in a SHMEM parallel program. first. statement. no exceptions, no warm-up, no "let me just declare one more thing first." π¨
The start_pes routine accepts the following argument:
npesβ Unused. Should be set to0. literally a placeholder, it's giving decorative. π
This routine initializes the SHMEM API, which means it must be called before calling any other SHMEM routine. Not "should," must. It's the vibe check your whole program has to pass first.
This routine is responsible inter alia for setting up the symmetric heap on the calling PE, and the creation of the virtual PE numbers. Upon successful return from this routine, the calling PE will be able to communicate with and transfer data to other PEs. so likeβ¦ it unlocks the group chat. ππ¬
Multiple calls to this function are not allowed. one and done, babe. periodt. π«
For an overview of programming with SHMEM communication routines, example SHMEM programs, and instructions for compiling SHMEM programs, see the intro_shmem(3) man page. (it's the syllabus, go read it π)
π₯ EXAMPLES π₯
This is a simple program that calls shmem_integer_put(3):
PROGRAM PUT
INCLUDE "mpp/shmem.fh"
INTEGER TARG, SRC, RECEIVER, BAR
COMMON /T/ TARG
PARAMETER (RECEIVER=1)
CALL SHMEM_INIT()
IF (MY_PE() .EQ. 0) THEN
SRC = 33
CALL SHMEM_INTEGER_PUT(TARG, SRC, 1, RECEIVER)
ENDIF
CALL SHMEM_BARRIER_ALL ! SYNCHRONIZES SENDER AND RECEIVER
IF (MY_PE() .EQ. RECEIVER) THEN
PRINT *,'PE ', MY_PE(),' TARG=',TARG,' (expect 33)'
ENDIF
END
look at that control flow. SHMEM_INIT() first, then the put, then everybody meets at the barrier, then PE 1 prints and expects 33. immaculate. π
β οΈ NOTES β οΈ
If the start_pes call is not the first statement in a program, unexpected results may occur on some architectures. bestie. put it first. i am begging. π
See also: intro_shmem(3) shmem_barrier(3) shmem_barrier_all(3) shmem_put(3) my_pe(3) shmem_n_pes(3)
π Copyright π
2003-2026, The Open MPI Community
and that's the whole page, no cap. π§ this Open MPI classic was written by The Open MPI Community (copyright 2003-2026), and this particular rendering is dated Sep 10, 2026 β mwah, iconic, go call start_pes first. πβπ
π¦ where this page comes from
- ubuntu stonking: openmpi-doc 5.0.10-6 Β· other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms