Coordinates the computation and update of the availability matrix
        for Affinity Propagation clustering. 
    
    Parameters
    ----------
    hdf5_file : string or file handle
        Specify access to the hierarchical data format used throughout all the iterations
        of message-passing between data-points involved in Affinity Propagation clustering.
    
    N_columns : int
        The number of samples in the data-set subjected to Affinity Propagation clustering.
    
    damping : float
        The damping parameter of Affinity Propagation clustering, typically set to 0.5.
    
    N_processes : int
        The number of subprocesses involved in the parallel computation and update of the
        matrix of availabitilies.
    
    rows_sum : array of shape (N_columns,)
        A vector containing, for each column entry of the similarities matrix, the sum
        of its rows entries.

def compute_availabilities(hdf5_file, N_columns, damping, N_processes, rows_sum):
    """Coordinates the computation and update of the availability matrix
        for Affinity Propagation clustering. 
    
    Parameters
    ----------
    hdf5_file : string or file handle
        Specify access to the hierarchical data format used throughout all the iterations
        of message-passing between data-points involved in Affinity Propagation clustering.
    
    N_columns : int
        The number of samples in the data-set subjected to Affinity Propagation clustering.
    
    damping : float
        The damping parameter of Affinity Propagation clustering, typically set to 0.5.
    
    N_processes : int
        The number of subprocesses involved in the parallel computation and update of the
        matrix of availabitilies.
    
    rows_sum : array of shape (N_columns,)
        A vector containing, for each column entry of the similarities matrix, the sum
        of its rows entries. 
    """
    
    slice_queue = multiprocessing.JoinableQueue()
    
    pid_list = []
    for i in range(N_processes):
        worker = Availabilities_worker(hdf5_file, '/aff_prop_group',
                   N_columns, damping, slice_queue, rows_sum)
        worker.daemon = True
        worker.start()
        pid_list.append(worker.pid)
        
    for rows_slice in chunk_generator(N_columns, 8 * N_processes):
        slice_queue.put(rows_slice)
        
    slice_queue.join()
    slice_queue.close()
    
    terminate_processes(pid_list)
    gc.collect()