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.
mpi¶
Allows the backend and analysis to run in parallel using MPI.
- 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.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_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_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.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_reduce(title, cmd, data_y, data_x, **kwds)[source]¶
Reduce data and send it to the master. Not currently used, maybe should be removed.
zmqserver¶
Implements the server that broadcasts the results from the backend. Analysis users do not need to deal with it.