|
109 | 109 | {
|
110 | 110 | "id": "7bc073aa-6036-48e7-9696-37af050d438a",
|
111 | 111 | "cell_type": "markdown",
|
112 |
| - "source": "## Communication\nThe key functionality of the `executorlib` package is the up-scaling of python functions with thread based parallelism, MPI based parallelism or by assigning GPUs to individual python functions. In the background this is realized using a combination of the [zero message queue](https://zeromq.org) and [cloudpickle](https://github.com/cloudpipe/cloudpickle) \nto communicate binary python objects. The `executorlib.standalone.interactive.communication.SocketInterface` is an abstraction of this \ninterface, which is used in the other classes inside `executorlib` and might also be helpful for other projects. It comes with a series of utility functions:\n\n* `executorlib.standalone.interactive.communication.interface_bootup()`: To initialize the interface\n* `executorlib.standalone.interactive.communication.interface_connect()`: To connect the interface to another instance\n* `executorlib.standalone.interactive.communication.interface_send()`: To send messages via this interface \n* `executorlib.standalone.interactive.communication.interface_receive()`: To receive messages via this interface \n* `executorlib.standalone.interactive.communication.interface_shutdown()`: To shutdown the interface\n\nWhile `executorlib` was initially designed for up-scaling python functions for HPC, the same functionality can be \nleveraged to up-scale any executable independent of the programming language it is developed in.", |
| 112 | + "source": [ |
| 113 | + "## Communication\n", |
| 114 | + "The key functionality of the executorlib package is the up-scaling of python functions with thread based parallelism, MPI based parallelism or by assigning GPUs to individual python functions. In the background this is realized using a combination of the [zero message queue](https://zeromq.org) and [cloudpickle](https://github.com/cloudpipe/cloudpickle)\n", |
| 115 | + "to communicate binary python objects. The `executorlib.standalone.interactive.communication.SocketInterface` is an abstraction of this \n", |
| 116 | + "interface, which is used in the other classes inside `executorlib` and might also be helpful for other projects. It comes with a series of utility functions:\n", |
| 117 | + "\n", |
| 118 | + "* `executorlib.standalone.interactive.communication.interface_bootup()`: To initialize the interface\n", |
| 119 | + "* `executorlib.standalone.interactive.communication.interface_connect()`: To connect the interface to another instance\n", |
| 120 | + "* `executorlib.standalone.interactive.communication.interface_send()`: To send messages via this interface \n", |
| 121 | + "* `executorlib.standalone.interactive.communication.interface_receive()`: To receive messages via this interface \n", |
| 122 | + "* `executorlib.standalone.interactive.communication.interface_shutdown()`: To shutdown the interface\n", |
| 123 | + "\n", |
| 124 | + "While executorlib was initially designed for up-scaling python functions for HPC, the same functionality can be\n", |
| 125 | + "leveraged to up-scale any executable independent of the programming language it is developed in.\n", |
| 126 | + "\n", |
| 127 | + "## External Libraries\n", |
| 128 | + "For external libraries executorlib provides a standardized interface for a subset of its internal functionality, which is designed to remain stable with minor version updates. Developers can import the following functionality from `executorlib.standalone`:\n", |
| 129 | + "* `cancel_items_in_queue()` - Cancel items which are still waiting in the Python standard library queue - `queue.queue`.\n", |
| 130 | + "* `cloudpickle_register()` - Cloudpickle can either pickle by value or pickle by reference. The functions which are communicated have to be pickled by value rather than by reference, so the module which calls the map function is pickled by value.\n", |
| 131 | + "* `get_command_path()` - Get path of the backend executable script `executorlib.backend`.\n", |
| 132 | + "* `interface_bootup()` - Start interface for ZMQ communication.\n", |
| 133 | + "* `interface_connect()` - Connect to an existing `SocketInterface` instance by providing the hostname and the port as strings.\n", |
| 134 | + "* `interface_receive()` - Receive instructions from a `SocketInterface` instance.\n", |
| 135 | + "* `interface_send()` - Send results to a `SocketInterface` instance.\n", |
| 136 | + "* `interface_shutdown()` - Close the connection to a `SocketInterface` instance.\n", |
| 137 | + "* `MpiExecSpawner` - Subprocess interface to start `mpi4py` parallel process.\n", |
| 138 | + "* `SocketInterface` - The `SocketInterface` is an abstraction layer on top of the zero message queue.\n", |
| 139 | + "* `SubprocessSpawner` - Subprocess interface to start serial Python process.\n", |
| 140 | + "\n", |
| 141 | + "It is not recommended to import components from other parts of executorlib in other libraries, only the interfaces in `executorlib` and `executorlib.standalone` are designed to be stable. All other classes and functions are considered for internal use only." |
| 142 | + ], |
113 | 143 | "metadata": {}
|
114 | 144 | },
|
115 | 145 | {
|
|
0 commit comments