Commit b9140117 authored by Pilar Cossio's avatar Pilar Cossio
Browse files

Merge branch 'devel_drohr' of gitta.rzg.mpg.de:BioEM into devel_drohr

parents 87514487 8c3c729b
...@@ -7,6 +7,14 @@ ...@@ -7,6 +7,14 @@
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
#include <mpi.h>
#define MPI_CHK(expr) \
if (expr != MPI_SUCCESS) \
{ \
fprintf(stderr, "Error in MPI function %s: %d\n", __FILE__, __LINE__); \
}
#include <fstream> #include <fstream>
#include <boost/program_options.hpp> #include <boost/program_options.hpp>
#include <iostream> #include <iostream>
...@@ -215,7 +223,14 @@ int bioem::configure(int ac, char* av[]) ...@@ -215,7 +223,14 @@ int bioem::configure(int ac, char* av[])
} }
#ifdef WITH_MPI #ifdef WITH_MPI
MPI_Bcast(&param, sizeof(param), MPI_BYTE, 0, MPI_COMM_WORLD);
//refCtf, CtfParam, angles automatically filled by precalculare function below
MPI_Bcast(&Model, sizeof(Model), MPI_BYTE, 0, MPI_COMM_WORLD);
Model.points = (bioem_model::bioem_model_point*) mallocchk(sizeof(bioem_model::bioem_model_point) * Model.nPointsModel);
MPI_Bcast(Model.points, sizeof(bioem_model::bioem_model_point) * Model.nPointsModel, MPI_BYTE, 0, MPI_COMM_WORLD);
#endif #endif
if (mpi_rank != 0) return(1); if (mpi_rank != 0) return(1);
......
#ifndef BIOEM_H #ifndef BIOEM_H
#define BIOEM_H #define BIOEM_H
#include <fstream>
#include <iostream>
#include <complex>
#include "defs.h" #include "defs.h"
#include "bioem.h" #include "bioem.h"
......
...@@ -99,15 +99,6 @@ static inline void* reallocchk(void* oldptr, size_t size) ...@@ -99,15 +99,6 @@ static inline void* reallocchk(void* oldptr, size_t size)
#define omp_get_thread_num() 0 #define omp_get_thread_num() 0
#endif #endif
#ifdef WITH_MPI
#include <mpi.h>
#define MPI_CHK(expr) \
if (expr != MPI_SUCCESS) \
{ \
fprintf(stderr, "Error in MPI function %s: %d\n", __FILE__, __LINE__); \
}
#endif
extern int mpi_rank; extern int mpi_rank;
extern int mpi_size; extern int mpi_size;
......
...@@ -39,6 +39,8 @@ public: ...@@ -39,6 +39,8 @@ public:
int Alignment; int Alignment;
mycomplex_t* refCTF; mycomplex_t* refCTF;
myfloat3_t* CtfParam; myfloat3_t* CtfParam;
size_t getRefCtfCount() {return nTotCTFs * FFTMapSize;}
size_t getCtfParamCount() {return nTotCTFs;}
myfloat_t pixelSize; myfloat_t pixelSize;
// Grid Points in Euler angles, assuming uniform sampling d_alpha=d_gamma (in 2pi) & cos(beta)=-1,1 // Grid Points in Euler angles, assuming uniform sampling d_alpha=d_gamma (in 2pi) & cos(beta)=-1,1
......
#include <mpi.h>
#define MPI_CHK(expr) \
if (expr != MPI_SUCCESS) \
{ \
fprintf(stderr, "Error in MPI function %s: %d\n", __FILE__, __LINE__); \
}
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
......
...@@ -375,10 +375,10 @@ int bioem_param::CalculateRefCTF() ...@@ -375,10 +375,10 @@ int bioem_param::CalculateRefCTF()
nTotCTFs = numberGridPointsCTF_amp * numberGridPointsCTF_phase * numberGridPointsEnvelop; nTotCTFs = numberGridPointsCTF_amp * numberGridPointsCTF_phase * numberGridPointsEnvelop;
delete[] refCTF; delete[] refCTF;
refCTF = new mycomplex_t[nTotCTFs * FFTMapSize]; refCTF = new mycomplex_t[getRefCtfCount()];
delete[] CtfParam; delete[] CtfParam;
CtfParam = new myfloat3_t[nTotCTFs]; CtfParam = new myfloat3_t[getCtfParamCount()];
for (int iamp = 0; iamp < numberGridPointsCTF_amp ; iamp++) //Loop over amplitud for (int iamp = 0; iamp < numberGridPointsCTF_amp ; iamp++) //Loop over amplitud
{ {
amp = (myfloat_t) iamp * gridCTF_amp + startGridCTF_amp; amp = (myfloat_t) iamp * gridCTF_amp + startGridCTF_amp;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment