from mpi4casa.MPIInterface import MPIInterface
from MPIEnvironment import MPIEnvironment
class TaskComm (object):
def __init__(self, name, local):
self.__name = name
self.__local = local
return
def __del__(self):
self.free()
return
def free(self):
if self.__local and self.__local != MPIEnvironment.mpi_comm_world:
MPIInterface.odo('if %s: %s.Free()' % (self.__name, self.__name),
MPIEnvironment.mpi_server_rank_list())
self.__local.Free()
self.__name = None
self.__local = None
return
def create_group(self, group, newname):
myrank = self.__local.rank
groupname = newname + '_group'
for p in group:
if p != myrank:
MPIInterface.odo('%s = %s.group.Incl(%s)'
% (groupname, self.__name, group))
MPIInterface.odo('%s = %s.Create_group(%s)'
% (newname, self.__name, groupname))
if myrank not in group:
local_comm = None
else:
local_comm = self.__local.Create_group(self.__local.group.Incl(group))
return TaskComm(newname, local_comm)
The imager components are assigned communicators as follows:
normalization_comm
deconvolution_comm
imaging_comm
iteration_comm
Note that these communicators need not all be distinct.
Assuming that a task communicator is provided (call it task_comm
), the top-level object can create any of the following communicators:
worker_comm
: created from the group of processes doing the computationMPI_COMM_SELF
: pre-defined by MPIMPI_COMM_NULL
: pre-defined by MPIThe current implementation of parclean can implement a variety of use cases by assigning any of these communicators to the component communicators.
CASA built without MPI
Use code alternatives when compiling with or without MPI (work around or avoid MPI calls, set rank to zero).
parallel run using only one CASA engine
Assign MPI_COMM_SELF
to all component communictors.
component communicator | continuum imaging (worker/client) | cube imaging (worker/client) | single process |
---|---|---|---|
normalization_comm | worker/null | self/null | self |
deconvolution_comm | worker/null | self/null | self |
imaging_comm | self/null | self/null | self |
iteration_comm | task/task | task/task | self |
Imager normalization and deconvolution components are not actually parallel, but communicators in continuum imaging use worker_comm
?
worker_comm
.DistSynthesisIterbot
and DistSIIterBot