diff --git a/src/cltools/Driver.cpp b/src/cltools/Driver.cpp index d575b48ef44ece2ea9085d9fe2798ad126bb4456..6ca916fb6a53518334a4e9ef8d601ecec35d6705 100644 --- a/src/cltools/Driver.cpp +++ b/src/cltools/Driver.cpp @@ -915,7 +915,7 @@ int Driver<real>::main(FILE* in,FILE*out,Communicator& pc) { p.cmd("GREX shareAllDeltaBias"); for(int i=0; i<n; i++) { string s; Tools::convert(i,s); - real a; s="GREX getDeltaBias "+s; p.cmd(s.c_str(),&a); + real a=NAN; s="GREX getDeltaBias "+s; p.cmd(s.c_str(),&a); if(grex_log) fprintf(grex_log," %f",a); } if(grex_log) fprintf(grex_log,"\n"); diff --git a/src/tools/Communicator.cpp b/src/tools/Communicator.cpp index 48acdd3458f9f7c5667bcf8e98c7a84e4141359a..e933a6a50d50748c9df49b926ac8451f991ddc9c 100644 --- a/src/tools/Communicator.cpp +++ b/src/tools/Communicator.cpp @@ -224,12 +224,13 @@ MPI_Comm & Communicator::Get_comm() { } bool Communicator::initialized() { - int flag=false; #if defined(__PLUMED_HAS_MPI) + int flag=0; MPI_Initialized(&flag); -#endif if(flag) return true; else return false; +#endif + return false; } void Communicator::Request::wait(Status&s) { diff --git a/src/tools/Exception.h b/src/tools/Exception.h index fbf9e6ea3da3be552a438c1c0b64669429799c5f..38b1e18be55c85021e73abb53e461ec83ae81ffb 100644 --- a/src/tools/Exception.h +++ b/src/tools/Exception.h @@ -172,7 +172,7 @@ public: const char*file; const unsigned line; const char* pretty; - Location(const char*file,unsigned line,const char* pretty=nullptr): + explicit Location(const char*file,unsigned line,const char* pretty=nullptr): file(file), line(line), pretty(pretty) @@ -184,7 +184,7 @@ public: class Assertion { public: const char*assertion; - Assertion(const char*assertion=nullptr): + explicit Assertion(const char*assertion=nullptr): assertion(assertion) {} };