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_thread_mpi

shmem_init_thread_mpi(ctx: DeviceContext, gpus_per_node: Int = -1)

Modular-specific init that enables initializing SHMEM on one GPU per thread.

Arguments: ctx: the DeviceContext to associate with this thread gpus_per_node: the number of devices participating on this node, by default this will use ctx.number_of_devices() to use all available GPUs.

Raises:

If SHMEM initialization fails.