Xmipp  v3.23.11-Nereus
mpi_reconstruct_wbp.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * Authors: Joaquin Oton (joton@cnb.csic.es)
3  *
4  *
5  * Unidad de Bioinformatica of Centro Nacional de Biotecnologia , CSIC
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
20  * 02111-1307 USA
21  *
22  * All comments concerning this program package may be sent to the
23  * e-mail address 'xmipp@cnb.csic.es'
24  ***************************************************************************/
25 
26 #include "mpi_reconstruct_wbp.h"
27 
28 ProgMPIRecWbp::ProgMPIRecWbp(int argc, char **argv)
29 {
30  this->read(argc, argv);
31 }
32 ProgMPIRecWbp::ProgMPIRecWbp(const std::shared_ptr<MpiNode> &node)
33 {
34  this->setNode(node);
35 }
37 {
40 }
42 {
45 }
46 void ProgMPIRecWbp::read(int argc, char **argv)
47 {
48  MpiMetadataProgram::read(argc,argv);
49  ProgRecWbp::read(argc, (const char **)argv);
50 }
52 {
55 }
57 {
58  if ( verbose > 0 )
59  {
62  }
63 }
65 {
66  size_t tmp;
67  return getTaskToProcess(objId, tmp);
68 }
70 {
73  MPI_Allreduce(MULTIDIM_ARRAY(reconstructedVolume()), MULTIDIM_ARRAY(aux),
74  MULTIDIM_SIZE(aux), MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
75  int iaux;
76  MPI_Allreduce(&count_thr, &iaux, 1, MPI_INT, MPI_SUM, MPI_COMM_WORLD);
77 
78  if (node->isMaster())
79  {
80  reconstructedVolume()=aux;
81  count_thr=iaux;
83  }
84 }
Image< double > reconstructedVolume
Reconstructed volume.
virtual void produceSideInfo()
Fill arrays with relevant transformation matrices.
void produceSideInfo()
Fill arrays with relevant transformation matrices.
virtual void read(int argc, const char **argv, bool reportErrors=true)
#define MULTIDIM_SIZE(v)
void resizeNoCopy(const MultidimArray< T1 > &v)
ProgMPIRecWbp(int argc, char **argv)
#define MULTIDIM_ARRAY(v)
void readParams()
Read arguments from command line.
void defineParams()
Define parameters.
int argc
Original command line arguments.
Definition: xmipp_program.h:86
void read(int argc, char **argv)
Definition: xmipp_mpi.cpp:284
void createTaskDistributor(MetaData &mdIn, size_t blockSize=0)
Definition: xmipp_mpi.cpp:302
void progress_bar(long rlen)
std::shared_ptr< MpiNode > node
Definition: xmipp_mpi.h:164
bool getImageToProcess(size_t &objId) override
Get 1 image to process.
const char ** argv
Definition: xmipp_program.h:87
bool getTaskToProcess(size_t &objId, size_t &objIndex)
Definition: xmipp_mpi.cpp:316
int verbose
Verbosity level.
void read(int argc, char **argv)
size_t time_bar_done
MetaDataVec SF
void setNode(const std::shared_ptr< MpiNode > &node)
Definition: xmipp_mpi.cpp:256
virtual void finishProcessing()