Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
MPIBP-Hummer
BioEM
Commits
cd4d4d5d
Commit
cd4d4d5d
authored
Jul 06, 2014
by
David Rohr
Browse files
initialize only on mpi rank 0
parent
08528178
Changes
1
Hide whitespace changes
Inline
Side-by-side
bioem.cpp
View file @
cd4d4d5d
...
...
@@ -87,136 +87,144 @@ int bioem::configure(int ac, char* av[])
// ****** And Precalculating necessary grids, map crosscorrelations and kernels ********
// *************************************************************************************
// *** Inizialzing default variables ***
std
::
string
infile
,
modelfile
,
mapfile
;
Model
.
readPDB
=
false
;
param
.
writeAngles
=
false
;
param
.
dumpMap
=
false
;
param
.
loadMap
=
false
;
RefMap
.
readMRC
=
false
;
RefMap
.
readMultMRC
=
false
;
// *************************************************************************************
cout
<<
" ++++++++++++ FROM COMMAND LINE +++++++++++
\n\n
"
;
// *************************************************************************************
if
(
mpi_rank
==
0
)
{
// *** Inizialzing default variables ***
std
::
string
infile
,
modelfile
,
mapfile
;
Model
.
readPDB
=
false
;
param
.
writeAngles
=
false
;
param
.
dumpMap
=
false
;
param
.
loadMap
=
false
;
RefMap
.
readMRC
=
false
;
RefMap
.
readMultMRC
=
false
;
// *************************************************************************************
cout
<<
" ++++++++++++ FROM COMMAND LINE +++++++++++
\n\n
"
;
// *************************************************************************************
// ********************* Command line reading input with BOOST ************************
try
{
po
::
options_description
desc
(
"Command line inputs"
);
desc
.
add_options
()
(
"Inputfile"
,
po
::
value
<
std
::
string
>
(),
"(Mandatory) Name of input parameter file"
)
(
"Modelfile"
,
po
::
value
<
std
::
string
>
()
,
"(Mandatory) Name of model file"
)
(
"Particlesfile"
,
po
::
value
<
std
::
string
>
(),
"(Mandatory) Name of paricles file"
)
(
"ReadPDB"
,
"(Optional) If reading model file in PDB format"
)
(
"ReadMRC"
,
"(Optional) If reading particle file in MRC format"
)
(
"ReadMultipleMRC"
,
"(Optional) If reading Multiple MRCs"
)
(
"DumpMaps"
,
"(Optional) Dump maps after they were red from maps file"
)
(
"LoadMapDump"
,
"(Optional) Read Maps from dump instead of maps file"
)
(
"help"
,
"(Optional) Produce help message"
)
;
po
::
positional_options_description
p
;
p
.
add
(
"Inputfile"
,
-
1
);
p
.
add
(
"Modelfile"
,
-
1
);
p
.
add
(
"Particlesfile"
,
-
1
);
p
.
add
(
"ReadPDB"
,
-
1
);
p
.
add
(
"ReadMRC"
,
-
1
);
p
.
add
(
"ReadMultipleMRC"
,
-
1
);
p
.
add
(
"DumpMaps"
,
-
1
);
p
.
add
(
"LoadMapDump"
,
-
1
);
po
::
variables_map
vm
;
po
::
store
(
po
::
command_line_parser
(
ac
,
av
).
options
(
desc
).
positional
(
p
).
run
(),
vm
);
po
::
notify
(
vm
);
if
((
ac
<
6
))
{
std
::
cout
<<
desc
<<
std
::
endl
;
return
1
;
}
if
(
vm
.
count
(
"help"
))
{
cout
<<
"Usage: options_description [options]
\n
"
;
cout
<<
desc
;
return
1
;
}
// ********************* Command line reading input with BOOST ************************
try
{
po
::
options_description
desc
(
"Command line inputs"
);
desc
.
add_options
()
(
"Inputfile"
,
po
::
value
<
std
::
string
>
(),
"(Mandatory) Name of input parameter file"
)
(
"Modelfile"
,
po
::
value
<
std
::
string
>
()
,
"(Mandatory) Name of model file"
)
(
"Particlesfile"
,
po
::
value
<
std
::
string
>
(),
"(Mandatory) Name of paricles file"
)
(
"ReadPDB"
,
"(Optional) If reading model file in PDB format"
)
(
"ReadMRC"
,
"(Optional) If reading particle file in MRC format"
)
(
"ReadMultipleMRC"
,
"(Optional) If reading Multiple MRCs"
)
(
"DumpMaps"
,
"(Optional) Dump maps after they were red from maps file"
)
(
"LoadMapDump"
,
"(Optional) Read Maps from dump instead of maps file"
)
(
"help"
,
"(Optional) Produce help message"
)
;
po
::
positional_options_description
p
;
p
.
add
(
"Inputfile"
,
-
1
);
p
.
add
(
"Modelfile"
,
-
1
);
p
.
add
(
"Particlesfile"
,
-
1
);
p
.
add
(
"ReadPDB"
,
-
1
);
p
.
add
(
"ReadMRC"
,
-
1
);
p
.
add
(
"ReadMultipleMRC"
,
-
1
);
p
.
add
(
"DumpMaps"
,
-
1
);
p
.
add
(
"LoadMapDump"
,
-
1
);
po
::
variables_map
vm
;
po
::
store
(
po
::
command_line_parser
(
ac
,
av
).
options
(
desc
).
positional
(
p
).
run
(),
vm
);
po
::
notify
(
vm
);
if
((
ac
<
6
))
{
std
::
cout
<<
desc
<<
std
::
endl
;
return
1
;
}
if
(
vm
.
count
(
"help"
))
{
cout
<<
"Usage: options_description [options]
\n
"
;
cout
<<
desc
;
return
1
;
}
if
(
vm
.
count
(
"Inputfile"
))
{
cout
<<
"Input file is: "
;
cout
<<
vm
[
"Inputfile"
].
as
<
std
::
string
>
()
<<
"
\n
"
;
infile
=
vm
[
"Inputfile"
].
as
<
std
::
string
>
();
}
if
(
vm
.
count
(
"Modelfile"
))
{
cout
<<
"Model file is: "
<<
vm
[
"Modelfile"
].
as
<
std
::
string
>
()
<<
"
\n
"
;
modelfile
=
vm
[
"Modelfile"
].
as
<
std
::
string
>
();
}
if
(
vm
.
count
(
"Inputfile"
))
{
cout
<<
"Input file is: "
;
cout
<<
vm
[
"Inputfile"
].
as
<
std
::
string
>
()
<<
"
\n
"
;
infile
=
vm
[
"Inputfile"
].
as
<
std
::
string
>
();
}
if
(
vm
.
count
(
"Modelfile"
))
{
cout
<<
"Model file is: "
<<
vm
[
"Modelfile"
].
as
<
std
::
string
>
()
<<
"
\n
"
;
modelfile
=
vm
[
"Modelfile"
].
as
<
std
::
string
>
();
}
if
(
vm
.
count
(
"ReadPDB"
))
{
cout
<<
"Reading model file in PDB format.
\n
"
;
Model
.
readPDB
=
true
;
}
if
(
vm
.
count
(
"Read
PDB
"
))
{
cout
<<
"Reading
model
file in
PDB
format.
\n
"
;
Model
.
readPDB
=
true
;
}
if
(
vm
.
count
(
"Read
MRC
"
))
{
cout
<<
"Reading
particle
file in
MRC
format.
\n
"
;
RefMap
.
readMRC
=
true
;
}
if
(
vm
.
count
(
"ReadMRC"
))
{
cout
<<
"Reading
par
ti
c
le
file in MRC format
.
\n
"
;
RefMap
.
readMRC
=
true
;
}
if
(
vm
.
count
(
"ReadM
ultipleM
RC"
))
{
cout
<<
"Reading
Mul
ti
p
le
MRCs
.
\n
"
;
RefMap
.
readM
ultM
RC
=
true
;
}
if
(
vm
.
count
(
"
ReadMultipleMRC
"
))
{
cout
<<
"
Reading Multiple MRCs
.
\n
"
;
RefMap
.
readMultMRC
=
true
;
}
if
(
vm
.
count
(
"
DumpMaps
"
))
{
cout
<<
"
Dumping Maps after reading from file
.
\n
"
;
param
.
dumpMap
=
true
;
}
if
(
vm
.
count
(
"Dump
Maps
"
))
{
cout
<<
"
Dump
ing Map
s after reading from file
.
\n
"
;
param
.
dump
Map
=
true
;
}
if
(
vm
.
count
(
"
LoadMap
Dump"
))
{
cout
<<
"
Load
ing Map
dump
.
\n
"
;
param
.
load
Map
=
true
;
}
if
(
vm
.
count
(
"LoadMapDump"
))
{
cout
<<
"Loading Map dump.
\n
"
;
param
.
loadMap
=
true
;
if
(
vm
.
count
(
"Particlesfile"
))
{
cout
<<
"Paricle file is: "
<<
vm
[
"Particlesfile"
].
as
<
std
::
string
>
()
<<
"
\n
"
;
mapfile
=
vm
[
"Particlesfile"
].
as
<
std
::
string
>
();
}
}
if
(
vm
.
count
(
"Particlesfile"
))
catch
(
std
::
exception
&
e
)
{
cout
<<
"Paricle file is: "
<<
vm
[
"Particlesfile"
].
as
<
std
::
string
>
()
<<
"
\n
"
;
mapfile
=
vm
[
"Particlesfile"
].
as
<
std
::
string
>
();
cout
<<
e
.
what
()
<<
"
\n
"
;
return
1
;
}
//check for consitency in multiple MRCs
if
(
RefMap
.
readMultMRC
&&
not
(
RefMap
.
readMRC
)
){
cout
<<
"For Multiple MRCs command --ReadMRC is necesary too"
;
exit
(
1
);
}
// ********************* Reading Parameter Input ***************************
// copying inputfile to param class
param
.
fileinput
=
infile
.
c_str
();
param
.
readParameters
();
// ********************* Reading Model Input ******************************
// copying modelfile to model class
Model
.
filemodel
=
modelfile
.
c_str
();
Model
.
readModel
();
// ********************* 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
);
}
catch
(
std
::
exception
&
e
)
{
cout
<<
e
.
what
()
<<
"
\n
"
;
return
1
;
}
//check for consitency in multiple MRCs
if
(
RefMap
.
readMultMRC
&&
not
(
RefMap
.
readMRC
)
){
cout
<<
"For Multiple MRCs command --ReadMRC is necesary too"
;
exit
(
1
);
}
// ********************* Reading Parameter Input ***************************
// copying inputfile to param class
param
.
fileinput
=
infile
.
c_str
();
param
.
readParameters
();
// ********************* Reading Model Input ******************************
// copying modelfile to model class
Model
.
filemodel
=
modelfile
.
c_str
();
Model
.
readModel
();
// ********************* 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
);
#ifdef WITH_MPI
#endif
if
(
mpi_rank
!=
0
)
return
(
1
);
// ****************** Precalculating Necessary Stuff *********************
precalculate
();
...
...
Write
Preview
Supports
Markdown
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