Skip to content
Snippets Groups Projects
Commit 3319395a authored by Carlo Camilloni's avatar Carlo Camilloni
Browse files

checkpointing: preliminary feature, a checkpoinitng flag is read

that is used to flush all the actions
[ makedoc ]
parent 59d11e92
No related branches found
No related tags found
No related merge requests found
......@@ -58,6 +58,7 @@ Changes from version 2.2 which are relevant for users:
the patch is still backward compatible with older PLUMED version, but the charges will only be passed
when using PLUMED 2.3 or later.
- Patches for GROMACS 4.6 and 5.1 incorporate Hamiltonian replica exchange, see \ref hrex
- Gromacs 5.1 flushes the plumed output files upon checkpointing
- New features for existing actions:
- The SPECIES and SPECIESA keyword in MultiColvars can now take a multicolvar as input. This allows one
to calculate quantities such as the Q4 parameters for those atoms that have a coordination number greater
......@@ -75,7 +76,7 @@ Changes from version 2.2 which are relevant for users:
- PLUMED now generate a VIM syntax file, see \ref VimSyntax
For developers:
- Added new strings for plumed cmd: setMDMassUnits, setMDChargeUnits, readInputLine, performCalcNoUpdate, and update.
- Added new strings for plumed cmd: setMDMassUnits, setMDChargeUnits, readInputLine, performCalcNoUpdate, update and doCheckPoint.
*/
......@@ -80,6 +80,7 @@ PlumedMain::PlumedMain():
exchangePatterns(*new(ExchangePatterns)),
exchangeStep(false),
restart(false),
doCheckPoint(false),
stopFlag(NULL),
stopNow(false),
novirial(false),
......@@ -368,6 +369,14 @@ void PlumedMain::cmd(const std::string & word,void*val){
CHECK_NOTNULL(val,word);
if(*static_cast<int*>(val)!=0) restart=true;
break;
/* ADDED WITH API==4 */
case cmd_doCheckPoint:
CHECK_INIT(initialized,word);
CHECK_NOTNULL(val,word);
doCheckPoint = false;
if(*static_cast<int*>(val)!=0) doCheckPoint = true;
break;
/* STOP API */
case cmd_setMDEngine:
CHECK_NOTINIT(initialized,word);
CHECK_NOTNULL(val,word);
......@@ -505,9 +514,6 @@ void PlumedMain::readInputFile(std::string str){
log.printf("END FILE: %s\n",str.c_str());
log.flush();
//comm.Barrier();
//if(comm.Get_rank()==0) multi_sim_comm.Barrier();
pilots=actionSet.select<ActionPilot*>();
}
......@@ -736,7 +742,8 @@ void PlumedMain::update(){
// flush by default every 10000 steps
// hopefully will not affect performance
if(step%10000==0){
// also if receive checkpointing signal
if(step%10000==0||doCheckPoint){
fflush();
log.flush();
for(ActionSet::const_iterator p=actionSet.begin();p!=actionSet.end();++p) (*p)->fflush();
......
......@@ -133,6 +133,9 @@ private:
/// Flag for restart
bool restart;
/// Flag for checkpointig
bool doCheckPoint;
std::set<FileBase*> files;
typedef std::set<FileBase*>::iterator files_iterator;
......
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