Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dssp
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
dssp
Commits
805bfa2f
Unverified
Commit
805bfa2f
authored
Jun 06, 2023
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert multi-threading
parent
e802a8e1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
43 deletions
+15
-43
include/dssp.hpp
+2
-2
src/dssp.cpp
+10
-30
src/mkdssp.cpp
+3
-11
No files found.
include/dssp.hpp
View file @
805bfa2f
...
...
@@ -97,8 +97,8 @@ class dssp
Gap
};
dssp
(
const
cif
::
datablock
&
db
,
int
model_nr
,
int
min_poly_proline_stretch_length
,
bool
calculateSurfaceAccessibility
,
int
max_thread_count
);
dssp
(
const
cif
::
mm
::
structure
&
s
,
int
min_poly_proline_stretch_length
,
bool
calculateSurfaceAccessibility
,
int
max_thread_count
);
dssp
(
const
cif
::
datablock
&
db
,
int
model_nr
,
int
min_poly_proline_stretch_length
,
bool
calculateSurfaceAccessibility
);
dssp
(
const
cif
::
mm
::
structure
&
s
,
int
min_poly_proline_stretch_length
,
bool
calculateSurfaceAccessibility
);
~
dssp
();
...
...
src/dssp.cpp
View file @
805bfa2f
...
...
@@ -28,7 +28,6 @@
#include "dssp.hpp"
#include <atomic>
#include <deque>
#include <iomanip>
#include <numeric>
...
...
@@ -766,25 +765,18 @@ double CalculateHBondEnergy(residue &inDonor, residue &inAcceptor)
// --------------------------------------------------------------------
void
CalculateHBondEnergies
(
std
::
vector
<
residue
>
&
inResidues
,
int
max_thread_count
)
void
CalculateHBondEnergies
(
std
::
vector
<
residue
>
&
inResidues
)
{
if
(
cif
::
VERBOSE
)
std
::
cerr
<<
"calculating hbond energies"
<<
std
::
endl
;
// Calculate the HBond energies
std
::
vector
<
std
::
thread
>
tg
;
std
::
atomic
<
size_t
>
next
(
0
);
std
::
unique_ptr
<
cif
::
progress_bar
>
progress
;
if
(
cif
::
VERBOSE
==
0
or
cif
::
VERBOSE
==
1
)
if
(
cif
::
VERBOSE
==
0
)
progress
.
reset
(
new
cif
::
progress_bar
((
inResidues
.
size
()
*
(
inResidues
.
size
()
-
1
)
/
2
),
"calculate hbond energies"
));
for
(
int
t
=
0
;
t
<
max_thread_count
;
++
t
)
{
tg
.
emplace_back
([
&
next
,
&
inResidues
,
progress
=
progress
.
get
()]()
{
for
(
uint32_t
i
=
next
++
;
i
<
inResidues
.
size
();
i
=
next
++
)
for
(
uint32_t
i
=
0
;
i
+
1
<
inResidues
.
size
();
++
i
)
{
auto
&
ri
=
inResidues
[
i
];
...
...
@@ -803,11 +795,6 @@ void CalculateHBondEnergies(std::vector<residue> &inResidues, int max_thread_cou
progress
->
consumed
(
1
);
}
}
});
}
for
(
auto
&
t
:
tg
)
t
.
join
();
}
// --------------------------------------------------------------------
...
...
@@ -1378,8 +1365,7 @@ void CalculatePPHelices(std::vector<residue> &inResidues, statistics &stats, int
struct
DSSP_impl
{
DSSP_impl
(
const
cif
::
datablock
&
db
,
int
model_nr
,
int
min_poly_proline_stretch_length
,
int
max_thread_count
);
DSSP_impl
(
const
cif
::
datablock
&
db
,
int
model_nr
,
int
min_poly_proline_stretch_length
);
auto
findRes
(
const
std
::
string
&
asymID
,
int
seqID
)
{
...
...
@@ -1400,22 +1386,16 @@ struct DSSP_impl
std
::
vector
<
std
::
pair
<
residue
*
,
residue
*>>
mSSBonds
;
int
m_min_poly_proline_stretch_length
;
statistics
mStats
=
{};
int
m_max_thread_count
;
};
// --------------------------------------------------------------------
DSSP_impl
::
DSSP_impl
(
const
cif
::
datablock
&
db
,
int
model_nr
,
int
min_poly_proline_stretch_length
,
int
max_thread_count
)
DSSP_impl
::
DSSP_impl
(
const
cif
::
datablock
&
db
,
int
model_nr
,
int
min_poly_proline_stretch_length
)
:
mDB
(
db
)
,
m_min_poly_proline_stretch_length
(
min_poly_proline_stretch_length
)
,
m_max_thread_count
(
max_thread_count
)
{
using
namespace
cif
::
literals
;
if
(
m_max_thread_count
<=
0
)
m_max_thread_count
=
std
::
thread
::
hardware_concurrency
();
if
(
cif
::
VERBOSE
)
std
::
cerr
<<
"loading residues"
<<
std
::
endl
;
...
...
@@ -1577,7 +1557,7 @@ void DSSP_impl::calculateSecondaryStructure()
mSSBonds
.
emplace_back
(
&*
r1
,
&*
r2
);
}
CalculateHBondEnergies
(
mResidues
,
m_max_thread_count
);
CalculateHBondEnergies
(
mResidues
);
CalculateBetaSheets
(
mResidues
,
mStats
);
CalculateAlphaHelices
(
mResidues
,
mStats
);
CalculatePPHelices
(
mResidues
,
mStats
,
m_min_poly_proline_stretch_length
);
...
...
@@ -2156,13 +2136,13 @@ dssp::iterator &dssp::iterator::operator--()
// --------------------------------------------------------------------
dssp
::
dssp
(
const
cif
::
mm
::
structure
&
s
,
int
min_poly_proline_stretch_length
,
bool
calculateSurfaceAccessibility
,
int
max_thread_count
)
:
dssp
(
s
.
get_datablock
(),
static_cast
<
int
>
(
s
.
get_model_nr
()),
min_poly_proline_stretch_length
,
calculateSurfaceAccessibility
,
max_thread_count
)
dssp
::
dssp
(
const
cif
::
mm
::
structure
&
s
,
int
min_poly_proline_stretch_length
,
bool
calculateSurfaceAccessibility
)
:
dssp
(
s
.
get_datablock
(),
static_cast
<
int
>
(
s
.
get_model_nr
()),
min_poly_proline_stretch_length
,
calculateSurfaceAccessibility
)
{
}
dssp
::
dssp
(
const
cif
::
datablock
&
db
,
int
model_nr
,
int
min_poly_proline_stretch
,
bool
calculateSurfaceAccessibility
,
int
max_thread_count
)
:
m_impl
(
new
DSSP_impl
(
db
,
model_nr
,
min_poly_proline_stretch
,
max_thread_count
))
dssp
::
dssp
(
const
cif
::
datablock
&
db
,
int
model_nr
,
int
min_poly_proline_stretch
,
bool
calculateSurfaceAccessibility
)
:
m_impl
(
new
DSSP_impl
(
db
,
model_nr
,
min_poly_proline_stretch
))
{
if
(
calculateSurfaceAccessibility
)
{
...
...
src/mkdssp.cpp
View file @
805bfa2f
...
...
@@ -81,8 +81,6 @@ int d_main(int argc, const char *argv[])
mcfp
::
make_option
(
"verbose,v"
,
"verbose output"
),
mcfp
::
make_option
(
"quiet"
,
"Reduce verbose output to a minimum"
),
mcfp
::
make_option
<
unsigned
>
(
"max-threads"
,
0
,
"Maximum number of threads to use, if zero the nummber of CPU's is the max"
),
mcfp
::
make_hidden_option
<
int
>
(
"debug,d"
,
"Debug level (for even more verbose output)"
));
config
.
parse
(
argc
,
argv
);
...
...
@@ -95,16 +93,10 @@ int d_main(int argc, const char *argv[])
exit
(
0
);
}
if
(
config
.
has
(
"help"
))
if
(
config
.
has
(
"help"
)
or
config
.
operands
().
empty
()
)
{
std
::
cerr
<<
config
<<
std
::
endl
;
exit
(
0
);
}
if
(
config
.
operands
().
empty
())
{
std
::
cerr
<<
"Input file not specified"
<<
std
::
endl
;
exit
(
1
);
exit
(
config
.
has
(
"help"
)
?
0
:
1
);
}
if
(
config
.
has
(
"output-format"
)
and
config
.
get
<
std
::
string
>
(
"output-format"
)
!=
"dssp"
and
config
.
get
<
std
::
string
>
(
"output-format"
)
!=
"mmcif"
)
...
...
@@ -164,7 +156,7 @@ int d_main(int argc, const char *argv[])
fmt
=
"cif"
;
}
dssp
dssp
(
f
.
front
(),
1
,
pp_stretch
,
true
,
config
.
get
<
unsigned
>
(
"max-threads"
)
);
dssp
dssp
(
f
.
front
(),
1
,
pp_stretch
,
true
);
if
(
not
output
.
empty
())
{
...
...
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