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

Allocation angles

parent c8567981
8
0.836000 1.369000 2.640000 0.640000
-1.375000 0.400000 3.018000 0.360000
-1.375000 0.400000 3.018000 0.360000
0.836000 1.369000 2.640000 0.640000
0.836000 1.369000 2.640000 0.640000
-1.375000 0.400000 3.018000 0.360000
-1.375000 0.400000 3.018000 0.360000
0.836000 1.369000 2.640000 0.640000
......@@ -298,8 +298,10 @@ int bioem::configure(int ac, char* av[])
if (DebugOutput >= 2 && mpi_rank == 0) timer.ResetStart();
MPI_Bcast(&param, sizeof(param), MPI_BYTE, 0, MPI_COMM_WORLD);
if (mpi_rank != 0)param.angles = (myfloat3_t*) mallocchk(4 * param.nTotGridAngles * sizeof (myfloat_t*));
MPI_Bcast(param.angles, 4 * param.nTotGridAngles * sizeof (myfloat_t*),MPI_BYTE, 0, MPI_COMM_WORLD);
cout << "HERE MPI" << param.nTotGridAngles << " "<< param.nTotGridAngles * sizeof(myfloat3_t*) << "\n";
//if (mpi_rank != 0)param.angles = (myfloat3_t*) mallocchk( 4 * param.nTotGridAngles * sizeof(myfloat_t*));
if (mpi_rank != 0)param.angles = (myfloat3_t*) mallocchk(3 * param.nTotGridAngles * sizeof (myfloat3_t*));
MPI_Bcast(param.angles, 3 * param.nTotGridAngles * sizeof (myfloat3_t*),MPI_BYTE, 0, MPI_COMM_WORLD);
//Allocating memory for prior
// if (mpi_rank != 0){//param.angprior = (myfloat_t*) mallocchk(3* param.nTotGridAngles * sizeof (myfloat_t*));
......@@ -309,7 +311,7 @@ int bioem::configure(int ac, char* av[])
//
//#ifdef PILAR_DEBUG
for(int n=0;n<param.nTotGridAngles;n++){
cout << "CHECK: Angle orient " << mpi_rank << " "<< param.nTotGridAngles << " " << param.angles[n].pos[0] << " " << param.angles[n].pos[1] << " " << param.angles[n].pos[2] << " " << param.angles[n].quat4 << " " << "\n";}
cout << "CHECK: Angle orient " << mpi_rank << " "<< n << " " << param.angles[n].pos[0] << " " << param.angles[n].pos[1] << " " << param.angles[n].pos[2] << " " << param.angles[n].quat4 << " " << "\n";}
//
//#endif
//refCtf, CtfParam, angles automatically filled by precalculare function below
......@@ -326,7 +328,6 @@ int bioem::configure(int ac, char* av[])
}
#endif
// ****************** Precalculating Necessary Stuff *********************
if (DebugOutput >= 2 && mpi_rank == 0) timer.ResetStart();
param.PrepareFFTs();
......
......@@ -729,8 +729,9 @@ int bioem_param::CalculateGridsParam() //TO DO FOR QUATERNIONS
// Euler Angle Array
angles = (myfloat3_t*) mallocchk( angleGridPointsAlpha * angleGridPointsBeta * angleGridPointsAlpha * 4 * sizeof(myfloat_t));
angles = (myfloat3_t*) mallocchk( 3 * angleGridPointsAlpha * angleGridPointsBeta * angleGridPointsAlpha * sizeof(myfloat3_t));
cout << "HERE" << sizeof(myfloat3_t) << " " << sizeof(myfloat_t) << " "<< 4 * angleGridPointsAlpha * angleGridPointsBeta * angleGridPointsAlpha * sizeof(myfloat_t*) << "\n";
for (int ialpha = 0; ialpha < angleGridPointsAlpha; ialpha ++)
{
for (int ibeta = 0; ibeta < angleGridPointsBeta; ibeta ++)
......@@ -745,6 +746,7 @@ int bioem_param::CalculateGridsParam() //TO DO FOR QUATERNIONS
}
}
}
cout << "HERE2 "<< n <<" " << angleGridPointsAlpha * angleGridPointsBeta * angleGridPointsAlpha << "\n";
nTotGridAngles = n;
voluang= grid_alpha * grid_alpha * cos_grid_beta / (2.f * M_PI) / (2.f * M_PI) / 2.f * priorMod;
......@@ -783,7 +785,7 @@ int bioem_param::CalculateGridsParam() //TO DO FOR QUATERNIONS
//elete[] angles;
// angles = new myfloat3_t[]
angles = (myfloat3_t*) mallocchk( (NotUn_angles ) * 4 * sizeof(myfloat_t));
angles = (myfloat3_t*) mallocchk( NotUn_angles * 3 * sizeof(myfloat3_t));
if(yespriorAngles){
delete[] angprior;
......@@ -870,7 +872,7 @@ int bioem_param::CalculateGridsParam() //TO DO FOR QUATERNIONS
nTotGridAngles = n;
angles = (myfloat3_t*) mallocchk( nTotGridAngles * 4 * sizeof(myfloat_t));
angles = (myfloat3_t*) mallocchk( nTotGridAngles * 3 * sizeof(myfloat3_t));
voluang= dgridq * dgridq * dgridq * priorMod;
......@@ -927,9 +929,12 @@ int bioem_param::CalculateGridsParam() //TO DO FOR QUATERNIONS
strncpy (tmpVals, line, 12);
sscanf (tmpVals, "%d", &ntotquat);
if(ntotquat <1){
cout << "Invalid Number of quaternions " << ntotquat << "\n"; exit(1);
}else{
cout << "Number of quaternions " << ntotquat << "\n";
angles = (myfloat3_t*) mallocchk( ntotquat * 4 * sizeof(myfloat_t));
}
angles = (myfloat3_t*) mallocchk( ntotquat * 3 * sizeof(myfloat3_t));
// delete[] angles;
// angles = new myfloat3_t[ ntotquat] ;
......
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