This is a minimal wrapper of Python’s native multiprocessing module. It modifies the multiprocessing.Process class to make forking work with OpenMP in the DGL core library.

The API usage is exactly the same as the native module, so DGL does not provide additional documentation.

In addition, if your backend is PyTorch, this module will also be compatible with torch.multiprocessing module.

call_once_and_share(func, shape, dtype[, rank])

Invoke the function in a single process of the PyTorch distributed process group, and share the result with other processes.

shared_tensor(shape[, dtype])

Create a tensor in shared memory accessible by all processes within the same torch.distributed process group.