Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openstructure
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
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
schwede
openstructure
Commits
4b4401ea
Commit
4b4401ea
authored
8 years ago
by
Gerardo Tauriello
Browse files
Options
Downloads
Patches
Plain Diff
OpenMM plugin folders are only loaded once per path per execution.
parent
9c2c35cc
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/mol/mm/src/simulation.cc
+10
-0
10 additions, 0 deletions
modules/mol/mm/src/simulation.cc
modules/mol/mm/src/simulation.hh
+3
-0
3 additions, 0 deletions
modules/mol/mm/src/simulation.hh
with
13 additions
and
0 deletions
modules/mol/mm/src/simulation.cc
+
10
−
0
View file @
4b4401ea
...
...
@@ -267,6 +267,16 @@ SimulationPtr Simulation::Load(const String& filename, SettingsPtr settings){
}
void
Simulation
::
EnsurePluginsLoaded
(
const
String
&
plugin_path
)
{
// note: this is guaranteed to be constructed on first use only
static
std
::
set
<
String
>
already_loaded
;
if
(
already_loaded
.
find
(
plugin_path
)
==
already_loaded
.
end
())
{
// not loaded yet: load directory, but only once!
OpenMM
::
Platform
::
loadPluginsFromDirectory
(
plugin_path
);
already_loaded
.
insert
(
plugin_path
);
}
}
void
Simulation
::
Init
(
const
TopologyPtr
top
,
const
SettingsPtr
settings
){
...
...
This diff is collapsed.
Click to expand it.
modules/mol/mm/src/simulation.hh
+
3
−
0
View file @
4b4401ea
...
...
@@ -145,6 +145,9 @@ private:
int
TimeToNextNotification
();
// loads plugins from directory for OpenMM BUT only once per unique path!
static
void
EnsurePluginsLoaded
(
const
String
&
plugin_path
);
SystemPtr
system_
;
IntegratorPtr
integrator_
;
ContextPtr
context_
;
...
...
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