Overview
Last updated
Last updated
burla.remote_parallel_map
:Run an arbitrary python function on many remote computers at the same time.
remote_parallel_map
requires two arguments:
Then remote_parallel_map
can be called like:
When run, remote_parallel_map
will call my_function
, on every object in my_inputs
, at the same time, each on a separate CPU in the cloud (the max #CPUs depends on your cluster settings).
In under 1 second, the three function calls are made, all at the same time:
my_function(1)
, my_function(2)
, my_function(3)
Stdout produced on the remote machines is streamed back to the client (your machine). The return values of each function are also collected and sent back to the client. The following displays in the client's terminal:
In the above example, each function call would have been made inside a separate container, each with their own isolated filesystem.
The func_cpu
and func_ram
arguments can be used to assign more resources to each individual function call, up to max amount your machine type supports.
background
makes remote_parallel_map
exit after having uploaded the function and inputs. After which the job will continue to run independantly on the cluster in the background.
spinner
can be used to turn off the spinner, which also displays status messages from the cluster, like the state of the current job.
max_parallelism
can be used to limit the number of function calls running at the same time.
By default, the cluster will execute as many parallel functions as possible given the resources it has.
remote_parallel_map
has a few optional arguments, see for the full API-doc.
We're always happy to talk face to face.