kernel.multienginefc

Module: kernel.multienginefc

Inheritance diagram for IPython.kernel.multienginefc:

Expose the multiengine controller over the Foolscap network protocol.

Classes

FCFullSynchronousMultiEngineClient

class IPython.kernel.multienginefc.FCFullSynchronousMultiEngineClient(remote_reference)

Bases: object

__init__()
adapt_to_blocking_client()
clear_pending_deferreds()
clear_properties()
clear_queue()
del_properties()
execute()
gather()
get_ids()
get_pending_deferred()
get_properties()
get_result()
has_properties()
keys()
kill()
map()

A parallel version of Python’s builtin map function.

This method applies a function to sequences of arguments. It follows the same syntax as the builtin map.

This method creates a mapper objects by calling self.mapper with no arguments and then uses that mapper to do the mapping. See the documentation of mapper for more details.

mapper()

Create a mapper object that has a map method.

This method returns an object that implements the IMapper interface. This method is a factory that is used to control how the map happens.

Parameters :
dist : str

What decomposition to use, ‘b’ is the only one supported currently

targets : str, int, sequence of ints

Which engines to use for the map

block : boolean

Should calls to map block or not

parallel()

A decorator that turns a function into a parallel function.

This can be used as:

@parallel() def f(x, y)

...

f(range(10), range(10))

This causes f(0,0), f(1,1), ... to be called in parallel.

Parameters :
dist : str

What decomposition to use, ‘b’ is the only one supported currently

targets : str, int, sequence of ints

Which engines to use for the map

block : boolean

Should calls to map block or not

pull()
pull_function()
pull_serialized()
push()
push_function()
push_serialized()
queue_status()
raw_map()

A parallelized version of Python’s builtin map.

This has a slightly different syntax than the builtin map. This is needed because we need to have keyword arguments and thus can’t use *args to capture all the sequences. Instead, they must be passed in a list or tuple.

raw_map(func, seqs) -> map(func, seqs[0], seqs[1], ...)

Most users will want to use parallel functions or the mapper and map methods for an API that follows that of the builtin map.

reset()
run()
scatter()
set_properties()
unpackage()
zip_pull()

FCSynchronousMultiEngineFromMultiEngine

class IPython.kernel.multienginefc.FCSynchronousMultiEngineFromMultiEngine(multiengine)

Bases: foolscap.referenceable.Referenceable

Adapt IMultiEngine -> ISynchronousMultiEngine -> IFCSynchronousMultiEngine.

__init__()
addSlash = True
packageFailure()
packageSuccess()
remote_clear_pending_deferreds()
remote_clear_properties()
remote_clear_queue()
remote_del_properties()
remote_execute()
remote_get_client_name()
remote_get_ids()

Get the ids of the registered engines.

This method always blocks.

remote_get_pending_deferred()
remote_get_properties()
remote_get_result()
remote_has_properties()
remote_keys()
remote_kill()
remote_pull()
remote_pull_function()
remote_pull_serialized()
remote_push()
remote_push_function()
remote_push_serialized()
remote_queue_status()
remote_reset()
remote_set_properties()

IFCSynchronousMultiEngine

class IPython.kernel.multienginefc.IFCSynchronousMultiEngine(name, bases=(), attrs=None, __doc__=None, __module__=None)

Bases: zope.interface.Interface

Foolscap interface to ISynchronousMultiEngine.

The methods in this interface are similar to those of ISynchronousMultiEngine, but their arguments and return values are pickled if they are not already simple Python types that can be send over XML-RPC.

See the documentation of ISynchronousMultiEngine and IMultiEngine for documentation about the methods.

Most methods in this interface act like the ISynchronousMultiEngine versions and can be called in blocking or non-blocking mode.

classmethod __init__()
dependents = <WeakKeyDictionary at 174646624>

Function

IPython.kernel.multienginefc.packageResult()