casa
5.7.0-16
|
#include <ParallelImagerMixin.h>
Public Member Functions | |
ParallelImagerMixin (MPI_Comm worker_comm, MPI_Comm imaging_comm, MPI_Comm normalization_comm, MPI_Comm deconvolution_comm, MPI_Comm iteration_comm, int niter, bool calculate_psf, bool calculate_residual, string save_model, ParallelImagerParams ¶ms) | |
ParallelImagerMixin constructor. More... | |
~ParallelImagerMixin () | |
casacore::Record | clean () |
Top level imaging method. More... | |
Protected Member Functions | |
void | run_major_cycle () |
bool | run_minor_cycle () |
Static Protected Member Functions | |
template<class T1 > | |
static std::vector< T1 > | transformed_by_field (casacore::Record &rec, T1(*fn)(const casacore::Record &), const string &prefix="") |
Convenience function for transforming input parameter casacore::Record fields. More... | |
Protected Attributes | |
int | niter |
bool | calculate_psf |
bool | calculate_residual |
string | save_model |
MPI_Comm | worker_comm |
MPI_Comm | imaging_comm |
MPI_Comm | deconvolution_comm |
MPI_Comm | normalization_comm |
MPI_Comm | iteration_comm |
This class ties together mixin classes for imager, normalizer, deconvolver, iteration control and data partitioning to provide the high level functionality of synthesis imaging. The functionality embodied by this class, together with its parent mixin classes, replaces all of the functionality in task_tclean.py, refimagerhelper.py, synthesisimager_cmpt.cc, synthesisnormalizer_cmpt.cc, synthesisdeconvolver_cmpt.cc (and maybe others). Some rearrangement of the method calls spread across task_tclean.py and refimagerhelper.py was necessary to create a single class embodying only the highest level algorithmic structure common to the three cases of serial, continuum parallel and cube parallel imaging.
Various implementation classes are defined via typedefs at the end of this file. The ParallelImagerMixin implementation classes are all defined using other mixin classes that simply wrap pre-existing, non-mixin imager, normalizer, and deconvolver component instances for use in this framework. [We refer to classes such as SynthesisNormalizer as "component" classes, and the mixin classes that wrap such components as "component mixin" classes]. These component mixin classes are intended to provide a sufficient design that will support changes in the component classes transparently; if this proves insufficient, new implementations of the component mixin classes could be supported with minimal refactoring.
Definition at line 74 of file ParallelImagerMixin.h.
|
inline |
ParallelImagerMixin constructor.
The various MPI communicators passed to the constructor are intended to represent the following process groups:
worker_comm: all processes used for significant computation (likely just excluding a "front-end" or user-facing process).
imaging/normalization/deconvolution_comm: the groups of processes for each of these components. Note that the scope of each of these communicators defines the set of communicating processes that comprise the component; for example, in cube imaging each imaging_comm comprises a single process, whereas in continuum imaging a single imaging_comm comprises all (worker) processes. Such differences are determined by design decisions, and do not reflect inherent features of the framework.
iteration_comm: processes taking part in iteration control, should be those processes in worker_comm with the possible addition of a process for the tclean "front-end".
Note that there may be overlap in the process groups for each of these communicators. The mixin classes in this framework support such usage, although the viability of that support depends on the usage of these communicators by the wrapped components in addition to the mixin classes. The current component classes make no use of these communicators, so overlapping process groups are supported. When component classes are using their respective communicators, it is sufficient for safely calling MPI routines from component code to ensure that concurrent access to a communicator by this framework and any component threads is avoided. [One way this can be achieved is by limiting calls to MPI routines on the provided communicator only to methods directly called by this framework.]
Get parameters for this process
Convert parameters to other formats used by synthesis imaging components, putting them into vectors by field index (not field key as used by the Records).
Configure components
don't initialize iteration control on any rank until all workers have completed initialization (need second barrier for case in which there are processes in iteration_comm that are not in worker_comm)
Definition at line 113 of file ParallelImagerMixin.h.
References casa::ParallelImagerParams::deconvolution, casa::SynthesisParamsSelect::fromRecord(), casa::SynthesisParamsImage::fromRecord(), casa::SynthesisParamsGrid::fromRecord(), casa::SynthesisParamsDeconv::fromRecord(), casa::ParallelImagerParams::grid, casa::ParallelImagerParams::image, casa::ParallelImagerParams::iteration, MPI_Barrier, casa::ParallelImagerParams::normalization, casa::ParallelImagerParams::selection, and casa::ParallelImagerParams::weight.
|
inline |
Definition at line 194 of file ParallelImagerMixin.h.
References casa::ParallelImagerMixin< T >::deconvolution_comm, casa::ParallelImagerMixin< T >::imaging_comm, casa::ParallelImagerMixin< T >::iteration_comm, MPI_Comm_free, MPI_COMM_NULL, MPI_COMM_SELF, MPI_COMM_WORLD, casa::ParallelImagerMixin< T >::normalization_comm, and casa::ParallelImagerMixin< T >::worker_comm.
|
inline |
Top level imaging method.
Note that differences in parallel continuum, parallel cube, and serial imaging are not apparent at this level.
Definition at line 214 of file ParallelImagerMixin.h.
References casa::ParallelImagerMixin< T >::calculate_psf, casa::ParallelImagerMixin< T >::calculate_residual, MPI_Barrier, casa::ParallelImagerMixin< T >::niter, casa::ParallelImagerMixin< T >::run_major_cycle(), casa::ParallelImagerMixin< T >::run_minor_cycle(), casa::ParallelImagerMixin< T >::save_model, and casa::ParallelImagerMixin< T >::worker_comm.
|
inlineprotected |
Definition at line 240 of file ParallelImagerMixin.h.
Referenced by casa::ParallelImagerMixin< T >::clean().
|
inlineprotected |
Definition at line 247 of file ParallelImagerMixin.h.
Referenced by casa::ParallelImagerMixin< T >::clean().
|
inlinestaticprotected |
Convenience function for transforming input parameter casacore::Record fields.
Definition at line 274 of file ParallelImagerMixin.h.
References casa::ParamFieldIterator::begin(), and casa::ParamFieldIterator::end().
|
protected |
Definition at line 256 of file ParallelImagerMixin.h.
Referenced by casa::ParallelImagerMixin< T >::clean().
|
protected |
Definition at line 258 of file ParallelImagerMixin.h.
Referenced by casa::ParallelImagerMixin< T >::clean().
|
protected |
Definition at line 266 of file ParallelImagerMixin.h.
Referenced by casa::ParallelImagerMixin< T >::~ParallelImagerMixin().
|
protected |
Definition at line 264 of file ParallelImagerMixin.h.
Referenced by casa::ParallelImagerMixin< T >::~ParallelImagerMixin().
|
protected |
Definition at line 270 of file ParallelImagerMixin.h.
Referenced by casa::ParallelImagerMixin< T >::~ParallelImagerMixin().
|
protected |
Definition at line 254 of file ParallelImagerMixin.h.
Referenced by casa::ParallelImagerMixin< T >::clean().
|
protected |
Definition at line 268 of file ParallelImagerMixin.h.
Referenced by casa::ParallelImagerMixin< T >::~ParallelImagerMixin().
|
protected |
Definition at line 260 of file ParallelImagerMixin.h.
Referenced by casa::ParallelImagerMixin< T >::clean().
|
protected |
Definition at line 262 of file ParallelImagerMixin.h.
Referenced by casa::ParallelImagerMixin< T >::clean(), and casa::ParallelImagerMixin< T >::~ParallelImagerMixin().