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

Merge branch 'v2.2'

parents ea2dc469 f7c88b17
No related branches found
No related tags found
No related merge requests found
......@@ -117,6 +117,8 @@ For users:
- Optimisations (activation of the dependencies, secondary structures, DRMSD)
- Fixed a performance regression with RMSD=OPTIMAL-FAST
- Fixed a bug in the normalization of kernel functions (relevant for \ref HISTOGRAM).
- Fixed a regression introduced in v2.2 that was making \ref METAD with non-MPI multiple walkers crash
if reading frequently. See \issue{190}
- Updated patch for gromacs 5.1
- Possibility to control manual generation (including pdf) from ./configure. Pdf manual is now off
by default. Notice that on travis CI it is still generated.
......
include ../../scripts/test.make
This diff is collapsed.
mpiprocs=3
type=driver
# this is to test a different name
arg="--plumed=plumed.dat --timestep=0.05 --ixyz trajectory.xyz --multi 3"
_SET_SUFFIX .a
c: DISTANCE ATOMS=1,2
d: DISTANCE ATOMS=2,3
# this is a dummy file, just to enable checking
PRINT FILE=colvar ARG=c
# the HILLS file are not really checked here since non-mpi walkers are not reproducible
# however, this example crashes
single: METAD ARG=c,d SIGMA=0.1,0.2 HEIGHT=0.1 PACE=2 WALKERS_ID=0 WALKERS_DIR=. WALKERS_N=3 WALKERS_RSTRIDE=1
_SET_SUFFIX .a
c: DISTANCE ATOMS=1,2
d: DISTANCE ATOMS=2,3
single: METAD ARG=c,d SIGMA=0.1,0.2 HEIGHT=0.1 PACE=2 WALKERS_ID=1 WALKERS_DIR=. WALKERS_N=3 WALKERS_RSTRIDE=1
_SET_SUFFIX .a
c: DISTANCE ATOMS=1,2
d: DISTANCE ATOMS=2,3
single: METAD ARG=c,d SIGMA=0.1,0.2 HEIGHT=0.1 PACE=2 WALKERS_ID=2 WALKERS_DIR=. WALKERS_N=3 WALKERS_RSTRIDE=1
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -499,6 +499,7 @@ void PlumedMain::readInputFile(std::string str){
IFile ifile;
ifile.link(*this);
ifile.open(str);
ifile.allowNoEOL();
std::vector<std::string> words;
while(Tools::getParsedLine(ifile,words) && words[0]!="ENDPLUMED") readInputWords(words);
log.printf("END FILE: %s\n",str.c_str());
......
......@@ -187,7 +187,8 @@ IFile& IFile::scanField(){
IFile::IFile():
inMiddleOfField(false),
ignoreFields(false)
ignoreFields(false),
noEOL(false)
{
}
......@@ -198,9 +199,8 @@ IFile::~IFile(){
IFile& IFile::getline(std::string &str){
char tmp=0;
str="";
// I comment out this (see note below on commented fgetpos):
// fpos_t pos;
// fgetpos(fp,&pos);
fpos_t pos;
fgetpos(fp,&pos);
while(llread(&tmp,1)==1 && tmp && tmp!='\n' && tmp!='\r' && !eof && !err){
str+=tmp;
}
......@@ -208,11 +208,12 @@ IFile& IFile::getline(std::string &str){
llread(&tmp,1);
plumed_massert(tmp=='\n',"plumed only accepts \\n (unix) or \\r\\n (dos) new lines");
}
if(eof){
if(str.length()>0) eof=false;
} else if(err || tmp!='\n'){
if(eof && noEOL){
if(str.length()>0) eof=false;
} else if(eof || err || tmp!='\n'){
eof = true;
str="";
if(!err) fsetpos(fp,&pos);
// there was a fsetpos here that apparently is not necessary
// fsetpos(fp,&pos);
// I think it was necessary to have rewind working correctly
......@@ -245,4 +246,8 @@ void IFile::allowIgnoredFields(){
ignoreFields=true;
}
void IFile::allowNoEOL(){
noEOL=true;
}
}
......@@ -55,6 +55,8 @@ public virtual FileBase{
bool inMiddleOfField;
/// Set to true if you want to allow fields to be ignored in the read in file
bool ignoreFields;
/// Set to true to allow files without end-of-line at the end
bool noEOL;
/// Advance to next field (= read one line)
IFile& advanceField();
/// Find field index by name
......@@ -93,6 +95,10 @@ Typically used as
IFile& scanField(Value* val);
/// Allow some of the fields in the input to be ignored
void allowIgnoredFields();
/// Allow files without EOL at the end.
/// This in practice should be only used when opening
/// plumed input files
void allowNoEOL();
};
}
......
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