ipc

Handles the communication between the backend<->interface, as well as the MPI communication between different backend processes.

broadcast

Broadcasts the analysed data to be displayed in the interface.

hummingbird.ipc.broadcast.init_data(title, **kwds)[source]

Configures the data broadcast named title. All the keyword=value pairs given will be set in the configuration dictionary for that broadcast, which are then available at the interface.

hummingbird.ipc.broadcast.new_data(title, data_y, mpi_reduce=False, **kwds)[source]

Send a new data item, which will be appended to any existing values at the interface. If mpi_reduce is True data_y will be summed over all the slaves. All keywords pairs given will also be transmitted and available at the interface.

hummingbird.ipc.broadcast.set_current_event(_evt)[source]

Updates the current event, such that it can be accessed easily in analysis code

mpi

Allows the backend and analysis to run in parallel using MPI.

hummingbird.ipc.mpi.checkreload()[source]
hummingbird.ipc.mpi.event_reader_rank()[source]
hummingbird.ipc.mpi.get_source(sources)[source]

Returns source based on a given list of sources and given the rank of the current process. Slaves are distributed equally across available data sources.

hummingbird.ipc.mpi.init_event_reader_comm(slave_event_reader_min_rank)[source]
hummingbird.ipc.mpi.is_event_reader()[source]

Returns True if the process is an event reader.

hummingbird.ipc.mpi.is_main_event_reader()[source]

Returns True if the process has rank == 0 in the reader communicator or if there is only one process.

hummingbird.ipc.mpi.is_main_slave()[source]

Returns True if the process has MPI rank == 1.

hummingbird.ipc.mpi.is_main_worker()[source]

Returns True if the process is the main slave or there is only one process.

hummingbird.ipc.mpi.is_master()[source]

Returns True if the process has MPI rank 0 and there are multiple processes.

hummingbird.ipc.mpi.is_slave()[source]

Returns True if the process has MPI rank > 0.

hummingbird.ipc.mpi.is_worker()[source]

Returns True if the process is a slave or there is only one process.

hummingbird.ipc.mpi.is_zmqserver()[source]

Returns True if the process has MPI rank 0, which is always the worker hosting the zmq server.

hummingbird.ipc.mpi.logical_and(array)[source]

Element-wise logical AND of a numpy array across all the slave processes. The result is only available in the main_worker().

hummingbird.ipc.mpi.logical_or(array)[source]

Element-wise logical OR of a numpy array across all the slave processes. The result is only available in the main_slave (rank 1).

hummingbird.ipc.mpi.master_loop()[source]

Run the main loop on the master process. It retransmits all received messages using its zmqserver and handles any possible reductions.

hummingbird.ipc.mpi.max(array)[source]

Element-wise max of a numpy array across all the slave processes. The result is only available in the main_slave (rank 1).

hummingbird.ipc.mpi.min(array)[source]

Element-wise max of a numpy array across all the slave processes. The result is only available in the main_slave (rank 1).

hummingbird.ipc.mpi.nr_event_readers()[source]

Returns nr. of event readers i.e. processes that run an event loop.

hummingbird.ipc.mpi.nr_slaves()[source]

Returns number of slaves

hummingbird.ipc.mpi.nr_workers()[source]

Returns nr. of available workers.

hummingbird.ipc.mpi.prod(array)[source]

Element-wise product of a numpy array across all the slave processes. The result is only available in the main_slave (rank 1).

hummingbird.ipc.mpi.send(title, data)[source]

Send a list of data items to the master node.

hummingbird.ipc.mpi.send_reduce(title, cmd, data_y, data_x, **kwds)[source]

Reduce data and send it to the master. Not currently used, maybe should be removed.

hummingbird.ipc.mpi.slave_done()[source]
hummingbird.ipc.mpi.slave_rank()[source]
hummingbird.ipc.mpi.sum(cmd, array)[source]

Element-wise sum of a numpy array across all processes of event readers. The result is only available in the main event reader (rank 0 in event reader comm).

hummingbird.ipc.mpi.worker_index()[source]

zmqserver

Implements the server that broadcasts the results from the backend. Analysis users do not need to deal with it.

class hummingbird.ipc.zmqserver.ZmqServer(port)[source]

Implements the server that broadcasts the results from the backend. Analysis users do not need to deal with it.

send(title, data)[source]

Send a list of data items to the broadcast named title

property subscribed
hummingbird.ipc.zmqserver.get_zmq_server()[source]

Returns the ZmqServer for process. If it does not yet exist create one first.