pymor.parallel.ipython

Module Contents

class pymor.parallel.ipython.IPythonPool(num_engines=None, **kwargs)[source]

Bases: pymor.parallel.basic.WorkerPoolBase

WorkerPool based on the IPython parallel computing features.

Parameters

num_engines

Number of IPython engines to use. If None, all available engines are used.

kwargs

Keyword arguments used to instantiate the IPython cluster client.

class pymor.parallel.ipython.RemoteId[source]

Bases: int

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.__int__(). For floating-point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by ‘+’ or ‘-’ and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal. >>> int(‘0b100’, base=0) 4

class pymor.parallel.ipython.new_ipcluster_pool(profile=None, cluster_id=None, num_engines=None, ipython_dir=None, min_wait=1, timeout=60)[source]

Bases: pymor.core.base.BasicObject

Create a new IPython parallel cluster and connect to it.

This context manager can be used to create an IPythonPool WorkerPool. When entering the context a new IPython cluster is created using the ipcluster script and an IPythonPool is instantiated for the newly created cluster. When leaving the context the cluster is shut down.

Parameters

profile

Passed as --profile parameter to the ipcluster script.

cluster_id

Passed as --cluster-id parameter to the ipcluster script.

nun_engines

Passed as --n parameter to the ipcluster script.

ipython_dir

Passed as --ipython-dir parameter to the ipcluster script.

min_wait

Wait at least this many seconds before trying to connect to the new cluster.

timeout

Wait at most this many seconds for all Ipython cluster engines to become available.