casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
casa::ParallelImagerMixin< T > Class Template Reference

ParallelImagerMixin. More...

#include <ParallelImagerMixin.h>

Inheritance diagram for casa::ParallelImagerMixin< T >:

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 &params)
 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
 

Detailed Description

template<class T>
class casa::ParallelImagerMixin< T >

ParallelImagerMixin.

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.

Constructor & Destructor Documentation

template<class T >
casa::ParallelImagerMixin< T >::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 params 
)
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.

template<class T >
casa::ParallelImagerMixin< T >::~ParallelImagerMixin ( )
inline

Member Function Documentation

template<class T >
casacore::Record casa::ParallelImagerMixin< T >::clean ( )
inline
template<class T >
void casa::ParallelImagerMixin< T >::run_major_cycle ( )
inlineprotected

Definition at line 240 of file ParallelImagerMixin.h.

Referenced by casa::ParallelImagerMixin< T >::clean().

template<class T >
bool casa::ParallelImagerMixin< T >::run_minor_cycle ( )
inlineprotected

Definition at line 247 of file ParallelImagerMixin.h.

Referenced by casa::ParallelImagerMixin< T >::clean().

template<class T >
template<class T1 >
static std::vector<T1> casa::ParallelImagerMixin< T >::transformed_by_field ( casacore::Record rec,
T1(*)(const casacore::Record &)  fn,
const string &  prefix = "" 
)
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().

Member Data Documentation

template<class T >
bool casa::ParallelImagerMixin< T >::calculate_psf
protected

Definition at line 256 of file ParallelImagerMixin.h.

Referenced by casa::ParallelImagerMixin< T >::clean().

template<class T >
bool casa::ParallelImagerMixin< T >::calculate_residual
protected

Definition at line 258 of file ParallelImagerMixin.h.

Referenced by casa::ParallelImagerMixin< T >::clean().

template<class T >
MPI_Comm casa::ParallelImagerMixin< T >::deconvolution_comm
protected
template<class T >
MPI_Comm casa::ParallelImagerMixin< T >::imaging_comm
protected
template<class T >
MPI_Comm casa::ParallelImagerMixin< T >::iteration_comm
protected
template<class T >
int casa::ParallelImagerMixin< T >::niter
protected

Definition at line 254 of file ParallelImagerMixin.h.

Referenced by casa::ParallelImagerMixin< T >::clean().

template<class T >
MPI_Comm casa::ParallelImagerMixin< T >::normalization_comm
protected
template<class T >
string casa::ParallelImagerMixin< T >::save_model
protected

Definition at line 260 of file ParallelImagerMixin.h.

Referenced by casa::ParallelImagerMixin< T >::clean().

template<class T >
MPI_Comm casa::ParallelImagerMixin< T >::worker_comm
protected

The documentation for this class was generated from the following file: