25 #include "tools/Tools.h"
26 #include "tools/Communicator.h"
53 #define CHECK_INIT(ini,word) plumed_massert(ini,"cmd(\"" + word +"\") should be only used after GREX initialization")
54 #define CHECK_NOTINIT(ini,word) plumed_massert(!(ini),"cmd(\"" + word +"\") should be only used before GREX initialization")
55 #define CHECK_NULL(val,word) plumed_massert(val,"NULL pointer received in cmd(\"GREX " + word + "\")");
59 }
else if(key==
"initialized"){
62 }
else if(key==
"setMPIIntracomm"){
65 }
else if(key==
"setMPIIntercomm"){
69 }
else if(key==
"setMPIFIntracomm"){
72 }
else if(key==
"setMPIFIntercomm"){
76 }
else if(key==
"init"){
85 }
else if(key==
"prepare"){
90 }
else if(key==
"setPartner"){
92 partner=*
static_cast<int*
>(val);
93 }
else if(key==
"savePositions"){
96 }
else if(key==
"calculate"){
101 }
else if(key==
"getLocalDeltaBias"){
106 }
else if(key==
"cacheLocalUNow"){
113 }
else if(key==
"cacheLocalUSwap"){
120 }
else if(key==
"getForeignDeltaBias"){
125 }
else if(key==
"shareAllDeltaBias"){
136 }
else if(nw==2 && words[0]==
"getDeltaBias"){
140 "to retrieve bias with cmd(\"GREX getDeltaBias\"), first share it with cmd(\"GREX shareAllDeltaBias\")");
143 plumed_massert(rep<
allDeltaBias.size(),
"replica index passed to cmd(\"GREX getDeltaBias\") is out of range");
147 plumed_merror(
"cannot interpret cmd(\"GREX " + key +
"\"). check plumed developers manual to see the available commands.");
164 unsigned nn=
buffer.size();
165 vector<char> rbuf(nn);
173 istringstream i(
string(&rbuf[0],rbuf.size()));
#define CHECK_NOTINIT(ini, word)
#define CHECK_INIT(ini, word)
void setExchangeStep(bool f)
Set exchangeStep flag.
void Bcast(T *, int, int)
void waitData()
Scatters the needed atoms.
Communicator & multi_sim_comm
void writeBinary(std::ostream &) const
Class containing wrappers to MPI.
void justCalculate()
Perform the forward loop on active actions.
void double2MD(const double &d, void *m) const
std::vector< double > allDeltaBias
#define CHECK_NULL(val, word)
int Get_rank() const
Obtain the rank of the present process.
void readBinary(std::istream &)
void prepareDependencies()
Prepare the list of active Actions and needed atoms.
const double & getEnergy() const
Get energy units as double.
void setSuffix(const std::string &)
Set the suffix string.
void Recv(T *, int, int, int, Status &)
double getBias() const
get the value of the bias
const Units & getMDUnits()
void Set_comm(MPI_Comm)
Set from a real MPI communicator.
void resetActive(bool active)
Enforce active flag.
int Get_size() const
Obtain the number of processes.
void Set_fcomm(void *comm)
Set from a pointer to a real MPI communicator (FORTRAN)
void cmd(const std::string &key, void *val=NULL)
This has to be implemented in daughter classes.
void Sum(T *, int)
Wrapper for MPI_Allreduce with MPI_SUM.
Request Isend(const T *, int, int, int)
void MD2double(const void *m, double &d) const