Skip to content
Snippets Groups Projects
Commit 5de24f52 authored by Giovanni Bussi's avatar Giovanni Bussi
Browse files

Merge branch 'fix-setstopflag' into v2.0

parents bcdc9539 3f776da4
No related branches found
No related tags found
No related merge requests found
......@@ -27,5 +27,6 @@ For users:
For developers:
- Several small fixes in documentation
- Added possibility to setup replica exchange from MD codes in fortran (commands "GREX setMPIFIntercomm" and "GREX setMPIFIntracomm")
- cmd("setStopFlag") should now be called after PLUMED initialization.
*/
......@@ -256,8 +256,6 @@ int Driver<real>::main(FILE* in,FILE*out,Communicator& pc){
int rr=sizeof(real);
p.cmd("setRealPrecision",&rr);
int checknatoms=-1;
int plumedStopCondition=0;
p.cmd("setStopFlag",&plumedStopCondition);
int step=0;
if(Communicator::initialized()){
if(multi){
......@@ -327,7 +325,7 @@ int Driver<real>::main(FILE* in,FILE*out,Communicator& pc){
while(true){
if(!noatoms){
if(!Tools::getline(fp,line)) break;
} else if ( plumedStopCondition ) break;
}
int natoms;
bool first_step=false;
......@@ -421,7 +419,9 @@ int Driver<real>::main(FILE* in,FILE*out,Communicator& pc){
}
}
int plumedStopCondition=0;
p.cmd("setStep",&step);
p.cmd("setStopFlag",&plumedStopCondition);
if(!noatoms){
if(trajectory_fmt=="xyz"){
if(!Tools::getline(fp,line)) error("premature end of trajectory file");
......@@ -559,6 +559,8 @@ int Driver<real>::main(FILE* in,FILE*out,Communicator& pc){
fprintf(fp_forces,fmt.c_str(),forces[3*i],forces[3*i+1],forces[3*i+2]);
}
if(noatoms && plumedStopCondition) break;
step+=stride;
}
p.cmd("runFinalJobs");
......
......@@ -289,11 +289,11 @@ void PlumedMain::cmd(const std::string & word,void*val){
CHECK_NOTINIT(initialized,word);
CHECK_NULL(val,word);
log.open(static_cast<char*>(val),"w");
// other commands that should be used after initialization:
} else if(word=="setStopFlag"){
CHECK_NOTINIT(initialized,word);
CHECK_INIT(initialized,word);
CHECK_NULL(val,word);
stopFlag=static_cast<int*>(val);
// other commands that should be used after initialization:
} else if(word=="getExchangesFlag"){
CHECK_INIT(initialized,word);
CHECK_NULL(val,word);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment