SHMEM_GLOBAL_EXIT(3)
π SHMEM_GLOBAL_EXIT π
okay so bestie, this is the Open MPI manual page for shmem_global_exit, and it's literally the "nope, we're DONE here" button. One sentence summary: shmem_global_exit β a routine that allows any PE to force termination of an entire program. No cap. One PE decides, everybody goes home. π
β¨ NAME β¨
shmem_global_exit β a routine that allows any PE to force termination of an entire program. That's it, that's the whole vibe. π«Ά
πΈ SYNOPSIS πΈ
C or C++:
#include <mpp/shmem.h>
void shmem_global_exit(int status)
(yes, exactly like that β copy it character for character, don't get cute with it π)
Fortran:
include 'mpp/shmem.fh'
INTEGER STATUS
CALL SHMEM_GLOBAL_EXIT(status)
π¦ DESCRIPTION π¦
So here's the tea: shmem_global_exit() is a non-collective routine, which means the whole squad does not have to agree. Any one PE can just... force termination of an OpenSHMEM program for all PEs, and pass an exit status along to the execution environment on the way out. main character energy fr. π
Important detail, don't miss it: this routine terminates the entire program, not just the OpenSHMEM portion. The whole thing. All of it. Bye. π
The way that it works is: when any PE calls shmem_global_exit, it results in the immediate notification to all PEs to terminate. Like a group chat "we're leaving" text that everyone actually reads for once. π±β¨
shmem_global_exit flushes I/O and releases resources in accordance with C/C++/Fortran language requirements for normal program termination β so it's not messy, it's clean. Iconic behavior.
Now, what if multiple PEs call shmem_global_exit at the same time? (A race, basically β everyone grabbing the mic π€.) In that case, the exit status returned to the environment shall be one of the values passed to shmem_global_exit as the status argument. Just one of them. Not a combo, not a sum, not your fave. Don't count on a specific one, bestie.
And the final plot twist:
There is no return to the caller of shmem_global_exit; control is returned from the OpenSHMEM program to the execution environment for all PEs. So likeβ¦ don't write code after it and expect it to run. It will not. Periodt. π
See also:
go read those next, they're giving lore π§
π Copyright π
2003-2026, The Open MPI Community
aaaand that's the whole page bestie, you ate that π this was the Open MPI SHMEM_GLOBAL_EXIT(3) page, dated Sep 10, 2026 β mwah, go terminate responsibly, ily, bye β¨π
π¦ 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