This documentation is for an old version of IPython. You can find docs for newer versions here.

Module: parallel.util

Some generic utilities for dealing with classes, urls, and serialization.

2 Classes

class IPython.parallel.util.Namespace

Bases: dict

Subclass of dict for attribute access to keys.

class IPython.parallel.util.ReverseDict(*args, **kwargs)

Bases: dict

simple double-keyed subset of dict methods.

__init__(*args, **kwargs)

16 Functions

IPython.parallel.util.log_errors(f, self, *args, **kwargs)

decorator to log unhandled exceptions raised in a method.

For use wrapping on_recv callbacks, so that exceptions do not cause the stream to be closed.


boolean check for whether a string is a zmq url


validate a url for zeromq


validate a potentially nested collection of urls.


split a zmq url (tcp://ip:port) into (‘tcp’,’ip’,’port’).

IPython.parallel.util.disambiguate_ip_address(ip, location=None)

turn multi-ip interfaces ‘’ and ‘*’ into a connectable address

Explicit IP addresses are returned unmodified.


ip : IP address

An IP address, or the special values, or *

location: IP address, optional

A public IP of the target machine. If location is an IP of the current machine, localhost will be returned, otherwise location will be returned.

IPython.parallel.util.disambiguate_url(url, location=None)

turn multi-ip interfaces ‘’ and ‘*’ into connectable ones, based on the location (default interpretation is localhost).

This is for zeromq urls, such as tcp://*:10101.


decorator for making functions appear as interactively defined. This results in the function being linked to the user_ns as globals() instead of the module globals().


Selects and return n random ports that are available.


Relay interupt/term signals to children, for more solid process cleanup.

IPython.parallel.util.connect_logger(logname, context, iface, root='ip', loglevel=10)
IPython.parallel.util.connect_engine_logger(context, iface, engine, loglevel=10)
IPython.parallel.util.local_logger(logname, loglevel=10)
IPython.parallel.util.set_hwm(sock, hwm=0)

set zmq High Water Mark on a socket

in a way that always works for various pyzmq / libzmq versions.