Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Plumed AlphaFold
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Kurečka
Plumed AlphaFold
Commits
480ee424
There was an error fetching the commit references. Please try again later.
Commit
480ee424
authored
6 years ago
by
carlocamilloni
Browse files
Options
Downloads
Plain Diff
Merge branch 'v2.4' into v2.5
parents
9b443c39
318174e6
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGES/v2.4.md
+3
-0
3 additions, 0 deletions
CHANGES/v2.4.md
src/tools/OpenMP.cpp
+27
-6
27 additions, 6 deletions
src/tools/OpenMP.cpp
src/tools/OpenMP.h
+3
-0
3 additions, 0 deletions
src/tools/OpenMP.h
with
33 additions
and
6 deletions
CHANGES/v2.4.md
+
3
−
0
View file @
480ee424
...
@@ -203,6 +203,9 @@ For users:
...
@@ -203,6 +203,9 @@ For users:
## Version 2.4.4 (to be released)
## Version 2.4.4 (to be released)
For users:
-
Fix some performances regression issue with OpenMP
For developers:
For developers:
-
Small fix in LDFLAGS when enabling coverage.
-
Small fix in LDFLAGS when enabling coverage.
This diff is collapsed.
Click to expand it.
src/tools/OpenMP.cpp
+
27
−
6
View file @
480ee424
...
@@ -29,16 +29,37 @@
...
@@ -29,16 +29,37 @@
namespace
PLMD
{
namespace
PLMD
{
struct
OpenMPVars
{
unsigned
cacheline_size
=
512
;
bool
cache_set
=
false
;
unsigned
num_threads
=
1
;
bool
nt_env_set
=
false
;
};
static
OpenMPVars
&
getOpenMPVars
()
{
static
OpenMPVars
vars
;
return
vars
;
}
void
OpenMP
::
setNumThreads
(
const
unsigned
nt
)
{
getOpenMPVars
().
num_threads
=
nt
;
}
unsigned
OpenMP
::
getCachelineSize
()
{
unsigned
OpenMP
::
getCachelineSize
()
{
static
unsigned
cachelineSize
=
512
;
if
(
!
getOpenMPVars
().
cache_set
)
{
if
(
std
::
getenv
(
"PLUMED_CACHELINE_SIZE"
))
Tools
::
convert
(
std
::
getenv
(
"PLUMED_CACHELINE_SIZE"
),
cachelineSize
);
if
(
std
::
getenv
(
"PLUMED_CACHELINE_SIZE"
))
Tools
::
convert
(
std
::
getenv
(
"PLUMED_CACHELINE_SIZE"
),
getOpenMPVars
().
cacheline_size
);
return
cachelineSize
;
getOpenMPVars
().
cache_set
=
true
;
}
return
getOpenMPVars
().
cacheline_size
;
}
}
unsigned
OpenMP
::
getNumThreads
()
{
unsigned
OpenMP
::
getNumThreads
()
{
static
unsigned
numThreads
=
1
;
if
(
!
getOpenMPVars
().
nt_env_set
)
{
if
(
std
::
getenv
(
"PLUMED_NUM_THREADS"
))
Tools
::
convert
(
std
::
getenv
(
"PLUMED_NUM_THREADS"
),
numThreads
);
if
(
std
::
getenv
(
"PLUMED_NUM_THREADS"
))
Tools
::
convert
(
std
::
getenv
(
"PLUMED_NUM_THREADS"
),
getOpenMPVars
().
num_threads
);
return
numThreads
;
getOpenMPVars
().
nt_env_set
=
true
;
}
return
getOpenMPVars
().
num_threads
;
}
}
unsigned
OpenMP
::
getThreadNum
()
{
unsigned
OpenMP
::
getThreadNum
()
{
...
...
This diff is collapsed.
Click to expand it.
src/tools/OpenMP.h
+
3
−
0
View file @
480ee424
...
@@ -30,6 +30,9 @@ class OpenMP {
...
@@ -30,6 +30,9 @@ class OpenMP {
public:
public:
/// Set number of threads that can be used by openMP
static
void
setNumThreads
(
const
unsigned
nt
);
/// Get number of threads that can be used by openMP
/// Get number of threads that can be used by openMP
static
unsigned
getNumThreads
();
static
unsigned
getNumThreads
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment