IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).

Mojo function

shmem_init

shmem_init()

A collective operation that allocates and initializes the resources used by the SHMEM library.

shmem_init allocates and initializes resources used by the SHMEM library. It is a collective operation that all PEs must call before any other SHMEM routine may be called, except shmem_query_initialized which checks the current initialized state of the library. In the SHMEM program which it initialized, each call to shmem_init must be matched with a corresponding call to shmem_finalize.

The shmem_init and shmem_init_thread initialization routines may be called multiple times within an SHMEM program. A corresponding call to shmem_finalize must be made for each call to an SHMEM initialization routine. The SHMEM library must not be finalized until after the last call to shmem_finalize and may be re-initialized with a subsequent call to an initialization routine.

Raises:

If SHMEM initialization fails.