deprecated_code/workflows/mpi/imaging/imaging_mpi.py
def zero_list_mpi_workflow(vis_list,comm=MPI.COMM_WORLD ):
    """ Initialise vis to zero: creates new data holders

    :param vis_list:
    :return: List of vis_lists
   """
    
    def zero(vis):
        if vis is not None:
            zerovis = copy_visibility(vis)
            zerovis.data['vis'][...] = 0.0
            return zerovis
        else:
            return None
    
    rank = comm.Get_rank()
    size = comm.Get_size()
    sub_vis_list= numpy.array_split(vis_list, size)
    sub_vis_list=comm.scatter(sub_vis_list,root=0)
    sub_result = [zero(v) for v in sub_vis_list]
    result=comm.gather(sub_result,root=0)
    if rank==0:
        result=numpy.concatenate(result)
    else:
        result=list()
    return result
 Initialise vis to zero: creates new data holders

    :param vis_list:
    :return: List of vis_lists
   
Initialise vis to zero: creates new data holders
Initialise vis to zero : creates new data holders
def zero_list_mpi_workflow(vis_list,comm=MPI.COMM_WORLD ):
    def zero(vis):
        if vis is not None:
            zerovis = copy_visibility(vis)
            zerovis.data['vis'][...] = 0.0
            return zerovis
        else:
            return None
    rank = comm.Get_rank()
    size = comm.Get_size()
    sub_vis_list= numpy.array_split(vis_list, size)
    sub_vis_list=comm.scatter(sub_vis_list,root=0)
    sub_result = [zero(v) for v in sub_vis_list]
    result=comm.gather(sub_result,root=0)
    if rank==0:
        result=numpy.concatenate(result)
    else:
        result=list()
    return result
def zero_list_mpi_workflow ( vis_list , comm = MPI . COMM_WORLD ) : def zero ( vis ) : if vis is not None : zerovis = copy_visibility ( vis ) zerovis . data [ 'vis' ] [ ... ] = 0.0 return zerovis else : return None rank = comm . Get_rank ( ) size = comm . Get_size ( ) sub_vis_list = numpy . array_split ( vis_list , size ) sub_vis_list = comm . scatter ( sub_vis_list , root = 0 ) sub_result = [ zero ( v ) for v in sub_vis_list ] result = comm . gather ( sub_result , root = 0 ) if rank == 0 : result = numpy . concatenate ( result ) else : result = list ( ) return result
Initialise vis to zero: creates new data holders
Initialise vis to zero : creates new data holders
""" Initialise vis to zero: creates new data holders

    :param vis_list:
    :return: List of vis_lists
   """
List of vis_lists
List of vis_lists
vis_list
None
comm