From 1aa68bd2727de89bedf79bf85d4a777cea596c05 Mon Sep 17 00:00:00 2001
From: Carlo Camilloni <carlo.camilloni@gmail.com>
Date: Fri, 26 Feb 2016 11:28:13 +0100
Subject: [PATCH] PlumedAction: faster check for the activation of the
 dependecies

this is usually not important, but for the case (like with
metainference) in which you have a bias that is applied on
a large number of arguments, then it was getting very slow
---
 src/core/Action.cpp     | 2 +-
 src/core/PlumedMain.cpp | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/core/Action.cpp b/src/core/Action.cpp
index 813d5b873..0b8d0acaa 100644
--- a/src/core/Action.cpp
+++ b/src/core/Action.cpp
@@ -151,7 +151,7 @@ void Action::activate(){
     this->unlockRequests();
     prepare();
     this->lockRequests();
-  }
+  } else return;
   for(Dependencies::iterator p=after.begin();p!=after.end();++p) (*p)->activate();
   active=true;
 }
diff --git a/src/core/PlumedMain.cpp b/src/core/PlumedMain.cpp
index ea6c9ce7f..19bc88fb4 100644
--- a/src/core/PlumedMain.cpp
+++ b/src/core/PlumedMain.cpp
@@ -578,7 +578,8 @@ void PlumedMain::prepareDependencies(){
 // First switch off all actions
   for(ActionSet::iterator p=actionSet.begin();p!=actionSet.end();++p){
      (*p)->deactivate();
-     (*p)->clearOptions();
+     //I think this is already done inside deactivate
+     //(*p)->clearOptions();
   }
 
 // for optimization, an "active" flag remains false if no action at all is active
-- 
GitLab