Skip to content

Instantly share code, notes, and snippets.

@PeterMinin
Last active June 14, 2017 11:28
Show Gist options
  • Save PeterMinin/c53025d9c800ab0e07529b92a1fc6b0d to your computer and use it in GitHub Desktop.
Save PeterMinin/c53025d9c800ab0e07529b92a1fc6b0d to your computer and use it in GitHub Desktop.
For synchronizing ipyparallel engines with the controller client.
import ipyparallel as ipp
import types
ipp_client = ipp.Client()
ipp_direct = ipp_client[:]
def push_functions():
functions = {name: val
for name, val in globals().items()
if type(val) == types.FunctionType and val.__module__ == '__main__'}
ipp_direct.push(functions, block=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment