casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ParallelImagerFactory.h
Go to the documentation of this file.
1 // -*- mode: c++ -*-
2 //# ParallelImagerFactory.h: Factory for ParallelImager instances
3 //# Copyright (C) 2016
4 //# Associated Universities, Inc. Washington DC, USA.
5 //#
6 //# This library is free software; you can redistribute it and/or modify it
7 //# under the terms of the GNU Library General Public License as published by
8 //# the Free Software Foundation; either version 2 of the License, or (at your
9 //# option) any later version.
10 //#
11 //# This library is distributed in the hope that it will be useful, but WITHOUT
12 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
14 //# License for more details.
15 //#
16 //# You should have received a copy of the GNU Library General Public License
17 //# along with this library; if not, write to the Free Software Foundation,
18 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
19 //#
20 //# Correspondence concerning AIPS++ should be addressed as follows:
21 //# Internet email: aips2-request@nrao.edu.
22 //# Postal address: AIPS++ Project Office
23 //# National Radio Astronomy Observatory
24 //# 520 Edgemont Road
25 //# Charlottesville, VA 22903-2475 USA
26 //#
27 #ifndef PARALLEL_IMAGER_FACTORY_H_
28 #define PARALLEL_IMAGER_FACTORY_H_
29 
32 
33 namespace casa {
34 
35 
42 public:
43 
57  static ParallelImager *make(MPI_Comm task_comm,
58  casacore::Record clean_params,
59  casacore::Record selection_params,
60  casacore::Record image_params,
61  casacore::Record grid_params,
62  casacore::Record weight_params,
63  casacore::Record normalization_params,
64  casacore::Record deconvolution_params,
65  casacore::Record iteration_params);
66 
67 private:
68  // Convenience method for creating communicator for normalization
69  // components. Significantly, return the null communicator when 'niter'
70  // value is less than 1, which provides the indication to
71  // SynthesisNormalizerMixin that the normalization component is not
72  // required.
73  static MPI_Comm normalization_comm(MPI_Comm comm, int niter) {
74  MPI_Comm result;
75  if (niter > 0 && comm != MPI_COMM_NULL) MPI_Comm_dup(comm, &result);
76  else result = MPI_COMM_NULL;
77  return result;
78  }
79 
80  // Convenience method for duplicating communicators (incl. MPI_COMM_NULL)
82  MPI_Comm result;
83  if (comm != MPI_COMM_NULL) MPI_Comm_dup(comm, &result);
84  else result = MPI_COMM_NULL;
85  return result;
86  }
87 };
88 
89 } // namespace casa
90 
91 #endif // PARALLEL_IMAGER_FACTORY_H_
#define MPI_COMM_NULL
Definition: MPIGlue.h:67
int MPI_Comm
Definition: MPIGlue.h:59
static MPI_Comm dup_valid_comm(MPI_Comm comm)
Convenience method for duplicating communicators (incl.
static ParallelImager * make(MPI_Comm task_comm, casacore::Record clean_params, casacore::Record selection_params, casacore::Record image_params, casacore::Record grid_params, casacore::Record weight_params, casacore::Record normalization_params, casacore::Record deconvolution_params, casacore::Record iteration_params)
Make a ParallelImager for the given set of parameters.
A hierarchical collection of named fields of various types.
Definition: Record.h:180
static MPI_Comm normalization_comm(MPI_Comm comm, int niter)
Convenience method for creating communicator for normalization components.
High level interface to parallel imaging classes, instances of which are returned from ParallelImager...
Factory class for ParallelImager instances.
#define MPI_Comm_dup(c, cp)
Definition: MPIGlue.h:79