diff --git a/src/core/PlumedMain.cpp b/src/core/PlumedMain.cpp index 40c9f4376c..7728a3ad4b 100644 --- a/src/core/PlumedMain.cpp +++ b/src/core/PlumedMain.cpp @@ -1058,38 +1058,42 @@ void PlumedMain::update() { } } -void PlumedMain::load(const std::string& ss) { +void PlumedMain::load(const std::string& fileName, const bool loadGlobal) { if(DLLoader::installed()) { - std::string s=ss; - size_t n=s.find_last_of("."); + std::string libName=fileName; + size_t n=libName.find_last_of("."); std::string extension=""; - std::string base=s; - if(n!=std::string::npos && n0) log<<" (only on master node)"; log<<"\n"; if(comm.Get_rank()==0) { int ret=std::system(cmd.c_str()); - if(ret!=0) plumed_error() <<"An error happened while executing command "< handles; std::string lastError; -/// Deleted copy constructor + /// Deleted copy constructor DLLoader(const DLLoader&) = delete; -/// Deleted assignment + /// Deleted assignment DLLoader&operator=(const DLLoader&) = delete; public: -/// Default constructor + /// Default constructor DLLoader(); -/// Cleanup + /// Cleanup ~DLLoader(); -/// Load a library, returning its handle - void* load(const std::string&); -/// Returns the last error in dynamic loader + /// Load a library, returning its handle + void* load(const std::string&, bool=false); + /// Returns the last error in dynamic loader const std::string & error(); -/// Returns true if the dynamic loader is available (on some systems it may not). + /// Returns true if the dynamic loader is available (on some systems it may not). static bool installed(); }; -} +} // namespace PLMD #endif