Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
BioEM
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MPIBP-Hummer
BioEM
Commits
92a9eb72
Commit
92a9eb72
authored
Jul 07, 2014
by
David Rohr
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code cleanup, move fft plan creation to function, remove file name strings from param class
parent
093227f8
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
44 additions
and
55 deletions
+44
-55
bioem.cpp
bioem.cpp
+12
-14
bioem_cuda.cu
bioem_cuda.cu
+1
-1
include/map.h
include/map.h
+1
-1
include/model.h
include/model.h
+1
-3
include/param.h
include/param.h
+4
-12
map.cpp
map.cpp
+7
-7
model.cpp
model.cpp
+1
-1
param.cpp
param.cpp
+17
-16
No files found.
bioem.cpp
View file @
92a9eb72
...
...
@@ -205,20 +205,13 @@ int bioem::configure(int ac, char* av[])
exit
(
1
);
}
// ********************* Reading Parameter Input ***************************
// copying inputfile to param class
param
.
fileinput
=
infile
.
c_str
();
param
.
readParameters
();
param
.
readParameters
(
infile
.
c_str
());
// ********************* Reading Model Input ******************************
// copying modelfile to model class
Model
.
filemodel
=
modelfile
.
c_str
();
Model
.
readModel
();
Model
.
readModel
(
modelfile
.
c_str
());
// ********************* Reading Particle Maps Input **********************
// ********* HERE: PROBLEM if maps dont fit on the memory!! ***************
// copying mapfile to ref map class
param
.
filemap
=
mapfile
.
c_str
();
RefMap
.
readRefMaps
(
param
);
RefMap
.
readRefMaps
(
param
,
mapfile
.
c_str
());
}
#ifdef WITH_MPI
...
...
@@ -227,6 +220,7 @@ int bioem::configure(int ac, char* av[])
if
(
mpi_rank
!=
0
)
return
(
1
);
// ****************** Precalculating Necessary Stuff *********************
param
.
PrepareFFTs
();
precalculate
();
if
(
getenv
(
"BIOEM_DEBUG_BREAK"
))
...
...
@@ -382,10 +376,11 @@ int bioem::run()
// *** Angular Probability ***
// if(param.writeAngles){
ofstream
angProbfile
;
angProbfile
.
open
(
"ANG_PROB_iRefMap"
);
// }
if
(
param
.
writeAngles
)
{
angProbfile
.
open
(
"ANG_PROB"
);
}
ofstream
outputProbFile
;
outputProbFile
.
open
(
"Output_Probabilities"
);
...
...
@@ -423,7 +418,10 @@ int bioem::run()
}
}
angProbfile
.
close
();
if
(
param
.
writeAngles
)
{
angProbfile
.
close
();
}
outputProbFile
.
close
();
return
(
0
);
...
...
bioem_cuda.cu
View file @
92a9eb72
...
...
@@ -343,7 +343,7 @@ int bioem_cuda::deviceInit()
{
deviceExit
();
selectCudaDevice
();
if
(
FFTAlgo
)
GPUAlgo
=
2
;
...
...
include/map.h
View file @
92a9eb72
...
...
@@ -30,7 +30,7 @@ public:
sumsquare_RefMap
=
NULL
;
RefMapsFFT
=
NULL
;
}
int
readRefMaps
(
bioem_param
&
param
);
int
readRefMaps
(
bioem_param
&
param
,
const
char
*
filemap
);
int
precalculate
(
bioem_param
&
param
,
bioem
&
bio
);
int
PreCalculateMapsFFT
(
bioem_param
&
param
);
...
...
include/model.h
View file @
92a9eb72
...
...
@@ -9,7 +9,7 @@ public:
//bioem_model();
//~bioem_model();
int
readModel
();
int
readModel
(
const
char
*
filemodel
);
bool
readPDB
;
...
...
@@ -17,8 +17,6 @@ public:
myfloat_t
getAminoAcidDensity
(
char
*
name
);
myfloat_t
NormDen
;
const
char
*
filemodel
;
int
nPointsModel
;
myfloat3_t
PointsModel
[
BIOEM_MODEL_SIZE
];
myfloat_t
radiusPointsModel
[
BIOEM_MODEL_SIZE
];
...
...
include/param.h
View file @
92a9eb72
...
...
@@ -10,6 +10,7 @@
class
bioem_param_device
{
public:
// Grids in center assuming equidistance from 0,0
int
maxDisplaceCenter
;
int
GridSpaceCenter
;
int
NumberPixels
;
...
...
@@ -25,10 +26,10 @@ public:
bioem_param
();
~
bioem_param
();
int
readParameters
();
int
readParameters
(
const
char
*
fileinput
);
int
CalculateGridsParam
();
int
CalculateRefCTF
();
int
InitializeArray
s
();
void
PrepareFFT
s
();
bioem_param_device
param_device
;
...
...
@@ -37,20 +38,14 @@ public:
mycomplex_t
*
refCTF
;
myfloat3_t
*
CtfParam
;
// File names
const
char
*
fileinput
;
char
logFile
;
// If to write Probabilities of Angles from Model
bool
writeAngles
;
//int NumberPixels; //in device class
myfloat_t
pixelSize
;
// Grid Points in Euler angles, assuming uniform sampling d_alpha=d_gamma (in 2pi) & cos(beta)=-1,1
int
angleGridPointsAlpha
;
int
angleGridPointsBeta
;
// Grids in center assuming equidistance from 0,0
//int maxDisplaceCenter; //in device class
int
numberGridPointsDisplaceCenter
;
//int GridSpaceCenter; //in device class
// Grid sampling for the convolution kernel
//ENVELOPE
myfloat_t
startGridEnvelop
;
...
...
@@ -64,16 +59,13 @@ public:
int
numberGridPointsCTF_amp
;
myfloat_t
gridCTF_amp
;
// Others
//myfloat_t volu;//in device class
myfloat3_t
*
angles
;
int
nTotGridAngles
;
int
nTotCTFs
;
//myfloat_t Ntotpi;//in device class
int
fft_plans_created
;
myfftw_plan
fft_plan_c2c_forward
,
fft_plan_c2c_backward
,
fft_plan_r2c_forward
,
fft_plan_c2r_backward
;
const
char
*
filemap
;
bool
dumpMap
,
loadMap
;
private:
...
...
map.cpp
View file @
92a9eb72
...
...
@@ -21,7 +21,7 @@
using
namespace
std
;
int
bioem_RefMap
::
readRefMaps
(
bioem_param
&
param
)
int
bioem_RefMap
::
readRefMaps
(
bioem_param
&
param
,
const
char
*
filemap
)
{
numPixels
=
param
.
param_device
.
NumberPixels
;
refMapSize
=
param
.
param_device
.
NumberPixels
*
param
.
param_device
.
NumberPixels
;
...
...
@@ -50,11 +50,11 @@ int bioem_RefMap::readRefMaps(bioem_param& param)
if
(
readMultMRC
)
{
ifstream
input
(
param
.
filemap
);
ifstream
input
(
filemap
);
if
(
!
input
.
good
())
{
cout
<<
"Failed to open file contaning MRC names: "
<<
param
.
filemap
<<
"
\n
"
;
cout
<<
"Failed to open file contaning MRC names: "
<<
filemap
<<
"
\n
"
;
exit
(
0
);
}
...
...
@@ -84,13 +84,13 @@ int bioem_RefMap::readRefMaps(bioem_param& param)
}
cout
<<
"
\n
+++++++++++++++++++++++++++++++++++++++++++
\n
"
;
cout
<<
"Particle Maps read from MULTIPLE MRC Files in: "
<<
param
.
filemap
<<
"
\n
"
;
cout
<<
"Particle Maps read from MULTIPLE MRC Files in: "
<<
filemap
<<
"
\n
"
;
}
else
{
read_MRC
(
param
.
filemap
,
param
);
read_MRC
(
filemap
,
param
);
cout
<<
"
\n
++++++++++++++++++++++++++++++++++++++++++
\n
"
;
cout
<<
"Particle Maps read from ONE MRC File: "
<<
param
.
filemap
<<
"
\n
"
;
cout
<<
"Particle Maps read from ONE MRC File: "
<<
filemap
<<
"
\n
"
;
}
}
else
...
...
@@ -98,7 +98,7 @@ int bioem_RefMap::readRefMaps(bioem_param& param)
int
nummap
=
-
1
;
int
lasti
=
0
;
int
lastj
=
0
;
ifstream
input
(
param
.
filemap
);
ifstream
input
(
filemap
);
if
(
!
input
.
good
())
{
cout
<<
"Particle Maps Failed to open file"
<<
endl
;
...
...
model.cpp
View file @
92a9eb72
...
...
@@ -18,7 +18,7 @@
using
namespace
std
;
int
bioem_model
::
readModel
()
int
bioem_model
::
readModel
(
const
char
*
filemodel
)
{
// **************************************************************************************
// ***************Reading reference Models either PDB or x,y,z,r,d format****************
...
...
param.cpp
View file @
92a9eb72
...
...
@@ -45,7 +45,7 @@ bioem_param::bioem_param()
angles
=
NULL
;
}
int
bioem_param
::
readParameters
()
int
bioem_param
::
readParameters
(
const
char
*
fileinput
)
{
// **************************************************************************************
// ***************************** Reading Input Parameters ******************************
...
...
@@ -256,8 +256,23 @@ int bioem_param::readParameters()
}
param_device
.
NumberFFTPixels1D
=
param_device
.
NumberPixels
/
2
+
1
;
FFTMapSize
=
param_device
.
NumberPixels
*
param_device
.
NumberFFTPixels1D
;
//Does currently not work with custom alignment on GPU
/*if (FFTMapSize % Alignment)
{
FFTMapSize += Alignment - FFTMapSize % Alignment;
}
cout << "Using MAP Size " << FFTMapSize << " (Alignment " << Alignment << ", Unaligned Size " << param_device.NumberPixels * param_device.NumberFFTPixels1D << ")\n";*/
cout
<<
" +++++++++++++++++++++++++++++++++++++++++
\n
"
;
return
(
0
);
}
void
bioem_param
::
PrepareFFTs
()
{
cout
<<
"Preparing FFTs
\n
"
;
releaseFFTPlans
();
mycomplex_t
*
tmp_map
,
*
tmp_map2
;
...
...
@@ -278,21 +293,7 @@ int bioem_param::readParameters()
myfftw_free
(
tmp_map
);
myfftw_free
(
tmp_map2
);
fft_plans_created
=
1
;
param_device
.
NumberFFTPixels1D
=
param_device
.
NumberPixels
/
2
+
1
;
FFTMapSize
=
param_device
.
NumberPixels
*
param_device
.
NumberFFTPixels1D
;
//Does currently not work with custom alignment on GPU
/*if (FFTMapSize % Alignment)
{
FFTMapSize += Alignment - FFTMapSize % Alignment;
}
cout << "Using MAP Size " << FFTMapSize << " (Alignment " << Alignment << ", Unaligned Size " << param_device.NumberPixels * param_device.NumberFFTPixels1D << ")\n";*/
cout
<<
" +++++++++++++++++++++++++++++++++++++++++
\n
"
;
return
(
0
);
fft_plans_created
=
1
;
}
void
bioem_param
::
releaseFFTPlans
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment