dragon.mpbridge.reduction

Dragon’s replacements for Multiprocessings ‘reduction’ module.

To prevent users from sharing file descriptors between child processes, we always raise an exception.

See the documentation ‘Multiprocessing with Dragon’.

raises NotImplementedError

Always raise this.

Functions

dragon_DupFd(fd)

Duplicates a file descriptor for a child process in Multiprocessing.

dragon_recvfds(sock, size)

Receive a list of file descriptors from another process via a socket.

dragon_sendfds(sock, fds)

Send an array of file descriptors to another process via a socket.

dragon_DupFd(fd: int) int

Duplicates a file descriptor for a child process in Multiprocessing.

Dragon does not support sharing file descriptors as it does not generalize to multi-node or federated systems.

See the documentation ‘Multiprocessing with Dragon’.

Parameters

fd (int) – the file descriptor of the parent process to be duplicated

Returns

the duplicated file descriptor

Return type

int

Raises

NotImplementedError – Always raises an exception.

dragon_sendfds(sock: socket, fds: array) None

Send an array of file descriptors to another process via a socket.

Dragon does not support this behaviour as it does not generalize to multi-node or federated systems.

See the documentation ‘Multiprocessing with Dragon’.

Parameters
Raises

NotImplementedError – Always raises an exception.

dragon_recvfds(sock: socket, size: int) list

Receive a list of file descriptors from another process via a socket.

Dragon does not support this behaviour as it does not generalize to multi-node or federated systems.

See the documentation ‘Multiprocessing with Dragon’.

Parameters
  • sock (socket.socket) – the socket to be used for sending

  • size (int) – the number of file descriptor to receive.

Raises

NotImplementedError – Always raises an exception.

Returns

the file descriptors

Return type

list