Xmipp  v3.23.11-Nereus
mpi_reconstruct_fourier.h
Go to the documentation of this file.
1 /***************************************************************************
2  *
3  * Authors: Jose Roman Bilbao (jrbcast@ace.ual.es)
4  * Roberto Marabini (roberto@cnb.csic.es)
5  * Vahid Abrishami (vabrishami@cnb.csic.es)
6  *
7  * Unidad de Bioinformatica of Centro Nacional de Biotecnologia , CSIC
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
22  * 02111-1307 USA
23  *
24  * All comments concerning this program package may be sent to the
25  * e-mail address 'xmipp@cnb.csic.es'
26  ***************************************************************************/
27 #ifndef MPI_RECONSTRUCT_FOURIER_H_
28 #define MPI_RECONSTRUCT_FOURIER_H_
29 
30 #include "xmipp_mpi.h"
31 #include <core/args.h>
33 #include <data/projection.h>
34 #include <cstring>
35 #include <cstdlib>
36 #include <core/xmipp_funcs.h>
37 #include <core/matrix2d.h>
38 #include <sys/time.h>
39 #include <iostream>
40 #include <sstream>
41 #include <fstream>
42 #include <iomanip>
43 
44 constexpr int TAG_WORKFORWORKER = 0;
45 #define TAG_STOP 1
46 constexpr int TAG_TRANSFER = 2;
47 constexpr int TAG_FREEWORKER = 3;
48 constexpr int TAG_COLLECT_FOR_FSC = 4;
49 constexpr int TAG_SETVERBOSE = 5;
50 
51 constexpr int BUFFSIZE = 10000000;
52 
53 //TODO (MARIANA) Please give more documentation and in a good structure e.g. @name
54 
58 
60 {
61 public:
62 
64  long int sizeout;
65 
68 
71  {}
72 
73  /* constructor ------------------------------------------------------- */
74  ProgMPIRecFourier(int argc, char *argv[]);
75 
76  /* constructor providing an MpiNode
77  * this is useful for using this programs from others
78  */
79  ProgMPIRecFourier(const std::shared_ptr<MpiNode> &node);
80 
81  /* Special way of reading to sync all nodes */
82  void read(int argc, char** argv);
83 
84  /* Read parameters --------------------------------------------------------- */
85  void readParams();
86 
88  // ~ProgMPIRecFourier();
89 
90  /* Usage ------------------------------------------------------------------- */
91  void defineParams();
92 
93  /* Pre Run PreRun for all nodes but not for all works */
94  void preRun();
95 
96  /* Run --------------------------------------------------------------------- */
97  void run();
98 
99  int sendDataInChunks( double * pointer, int dest, int totalSize, int buffSize, MPI_Comm comm );
100 
101 };
103 //end of class MPI reconstruct fourier
104 
105 #endif /* MPI_RECONSTRUCT_FOURIER_H_ */
106 
constexpr int TAG_TRANSFER
void read(int argc, char **argv)
constexpr int TAG_FREEWORKER
constexpr int TAG_COLLECT_FOR_FSC
constexpr int BUFFSIZE
int argc
Original command line arguments.
Definition: xmipp_program.h:86
std::shared_ptr< MpiNode > node
Definition: xmipp_mpi.h:164
const char ** argv
Definition: xmipp_program.h:87
constexpr int TAG_WORKFORWORKER
constexpr int TAG_SETVERBOSE
int sendDataInChunks(double *pointer, int dest, int totalSize, int buffSize, MPI_Comm comm)