Skip to content

Commit d3e5452

Browse files
Merge branch 'master' into test_intel
2 parents 569a668 + e9bd5d4 commit d3e5452

File tree

8 files changed

+63
-29
lines changed

8 files changed

+63
-29
lines changed

CHANGES/v2.9.md

+1
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,6 @@ Changes from version 2.8 which are relevant for users:
5555
- Step number is now stored as a `long long int`. Might facilitate Windows compatibility.
5656

5757
## Version 2.9.1 (to be released)
58+
- Includes all fixes up to 2.8.4
5859
- Plumed now fetches the massses correctly from QEspresso 7.0
5960

regtest/secondarystructure/rt32/plumed.dat

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
MOLINFO STRUCTURE=helix.pdb
2-
ALPHARMSD RESIDUES=all TYPE=DRMSD LESS_THAN={RATIONAL R_0=0.08 NN=8 MM=12 NOSTRETCH} LABEL=a
2+
ALPHARMSD RESIDUES=ALL TYPE=DRMSD LESS_THAN={RATIONAL R_0=0.08 NN=8 MM=12 NOSTRETCH} LABEL=a
33
ANTIBETARMSD RESIDUES=all TYPE=DRMSD STRANDS_CUTOFF=1.0 LESS_THAN={RATIONAL R_0=0.08 NN=8 MM=12 NOSTRETCH} LABEL=b
44
PARABETARMSD RESIDUES=all TYPE=DRMSD STRANDS_CUTOFF=1.0 LESS_THAN={RATIONAL R_0=0.08 NN=8 MM=12 NOSTRETCH} LABEL=p
55
PRINT ARG=a.*,b.*,p.* STRIDE=1 FILE=colvar FMT=%8.4f
66
ALPHARMSD RESIDUES=2-7 TYPE=DRMSD R_0=0.08 NN=8 MM=12 LABEL=a2
77
ALPHARMSD RESIDUES=2-7 TYPE=DRMSD R_0=0.08 NN=8 MM=12 NUMERICAL_DERIVATIVES LABEL=a2num
88
DUMPDERIVATIVES ARG=a2.*,a2num.* FILE=derivatives1 FMT=%8.4f STRIDE=1
9-
ANTIBETARMSD RESIDUES=3-5,8-10 STYLE=inter TYPE=OPTIMAL LESS_THAN={RATIONAL R_0=0.08 NN=8 MM=12 NOSTRETCH} LABEL=b2
9+
ANTIBETARMSD RESIDUES=3-5,8-10 STYLE=INTER TYPE=OPTIMAL LESS_THAN={RATIONAL R_0=0.08 NN=8 MM=12 NOSTRETCH} LABEL=b2
1010
ANTIBETARMSD RESIDUES=3-5,8-10 STYLE=inter TYPE=OPTIMAL LESS_THAN={RATIONAL R_0=0.08 NN=8 MM=12 NOSTRETCH} NUMERICAL_DERIVATIVES LABEL=b2num
1111
DUMPDERIVATIVES ARG=b2.*,b2num.* FILE=derivatives2 FMT=%8.3f STRIDE=1
1212
RESTRAINT ARG=b.lessthan,p.lessthan,a.lessthan,a2,b2.lessthan AT=0,1,2,3,4 KAPPA=1,2,3,4,5 SLOPE=5,4,3,2,1

src/opes/ECVlinear.cpp

+19-3
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,22 @@ ECVlinear::ECVlinear(const ActionOptions&ao)
122122
if(dimensionless)
123123
beta0_=1;
124124

125+
//workaround needed for intel compiler
126+
bool nan_support=true;
127+
const double my_nan_value=-42;
128+
if(!std::isnan(std::numeric_limits<double>::quiet_NaN()))
129+
{
130+
nan_support=false;
131+
log.printf(" +++ WARNING +++ do not set LAMBDA_MIN/MAX=%g, see https://github.com/plumed/plumed2/pull/990\n", my_nan_value);
132+
}
133+
auto isNone=[nan_support,my_nan_value](const double value)
134+
{
135+
if(nan_support)
136+
return std::isnan(value);
137+
else
138+
return value==my_nan_value;
139+
};
140+
125141
//parse lambda info
126142
parse("LAMBDA",lambda0_);
127143
double lambda_min=std::numeric_limits<double>::quiet_NaN();
@@ -140,7 +156,7 @@ ECVlinear::ECVlinear(const ActionOptions&ao)
140156
if(lambdas.size()>0)
141157
{
142158
plumed_massert(lambda_steps==0,"cannot set both LAMBDA_STEPS and LAMBDA_SET_ALL");
143-
plumed_massert(std::isnan(lambda_min) && std::isnan(lambda_max),"cannot set both LAMBDA_SET_ALL and LAMBDA_MIN/MAX");
159+
plumed_massert(isNone(lambda_min) && isNone(lambda_max),"cannot set both LAMBDA_SET_ALL and LAMBDA_MIN/MAX");
144160
plumed_massert(lambdas.size()>=2,"set at least 2 lambdas with LAMBDA_SET_ALL");
145161
for(unsigned k=0; k<lambdas.size()-1; k++)
146162
plumed_massert(lambdas[k]<=lambdas[k+1],"LAMBDA_SET_ALL must be properly ordered");
@@ -152,12 +168,12 @@ ECVlinear::ECVlinear(const ActionOptions&ao)
152168
}
153169
else
154170
{ //get LAMBDA_MIN and LAMBDA_MAX
155-
if(std::isnan(lambda_min))
171+
if(isNone(lambda_min))
156172
{
157173
lambda_min=0;
158174
log.printf(" no LAMBDA_MIN provided, using LAMBDA_MIN = %g\n",lambda_min);
159175
}
160-
if(std::isnan(lambda_max))
176+
if(isNone(lambda_max))
161177
{
162178
lambda_max=1;
163179
log.printf(" no LAMBDA_MAX provided, using LAMBDA_MAX = %g\n",lambda_max);

src/opes/ECVmultiThermal.cpp

+12-12
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Notice that \f$p=0.06022140857\f$ corresponds to 1 bar when using the default PL
7979
*/
8080
//+ENDPLUMEDOC
8181

82-
class ECVmultiCanonical :
82+
class ECVmultiThermal :
8383
public ExpansionCVs
8484
{
8585
private:
@@ -90,7 +90,7 @@ class ECVmultiCanonical :
9090
void initECVs();
9191

9292
public:
93-
explicit ECVmultiCanonical(const ActionOptions&);
93+
explicit ECVmultiThermal(const ActionOptions&);
9494
static void registerKeywords(Keywords& keys);
9595
void calculateECVs(const double *) override;
9696
const double * getPntrToECVs(unsigned) override;
@@ -100,9 +100,9 @@ class ECVmultiCanonical :
100100
void initECVs_restart(const std::vector<std::string>&) override;
101101
};
102102

103-
PLUMED_REGISTER_ACTION(ECVmultiCanonical,"ECV_MULTITHERMAL")
103+
PLUMED_REGISTER_ACTION(ECVmultiThermal,"ECV_MULTITHERMAL")
104104

105-
void ECVmultiCanonical::registerKeywords(Keywords& keys)
105+
void ECVmultiThermal::registerKeywords(Keywords& keys)
106106
{
107107
ExpansionCVs::registerKeywords(keys);
108108
keys.remove("ARG");
@@ -114,7 +114,7 @@ void ECVmultiCanonical::registerKeywords(Keywords& keys)
114114
keys.addFlag("NO_GEOM_SPACING",false,"do not use geometrical spacing in temperature, but instead linear spacing in inverse temperature");
115115
}
116116

117-
ECVmultiCanonical::ECVmultiCanonical(const ActionOptions&ao)
117+
ECVmultiThermal::ECVmultiThermal(const ActionOptions&ao)
118118
: Action(ao)
119119
, ExpansionCVs(ao)
120120
, todoAutomatic_(false)
@@ -188,28 +188,28 @@ ECVmultiCanonical::ECVmultiCanonical(const ActionOptions&ao)
188188
log.printf(" -- NO_GEOM_SPACING: inverse temperatures will be linearly spaced\n");
189189
}
190190

191-
void ECVmultiCanonical::calculateECVs(const double * ene)
191+
void ECVmultiThermal::calculateECVs(const double * ene)
192192
{
193193
for(unsigned k=0; k<derECVs_.size(); k++)
194194
ECVs_[k]=derECVs_[k]*ene[0];
195195
// derivatives never change: derECVs_k=(beta_k-beta0)
196196
}
197197

198-
const double * ECVmultiCanonical::getPntrToECVs(unsigned j)
198+
const double * ECVmultiThermal::getPntrToECVs(unsigned j)
199199
{
200200
plumed_massert(isReady_,"cannot access ECVs before initialization");
201201
plumed_massert(j==0,getName()+" has only one CV, the ENERGY");
202202
return &ECVs_[0];
203203
}
204204

205-
const double * ECVmultiCanonical::getPntrToDerECVs(unsigned j)
205+
const double * ECVmultiThermal::getPntrToDerECVs(unsigned j)
206206
{
207207
plumed_massert(isReady_,"cannot access ECVs before initialization");
208208
plumed_massert(j==0,getName()+" has only one CV, the ENERGY");
209209
return &derECVs_[0];
210210
}
211211

212-
std::vector<std::string> ECVmultiCanonical::getLambdas() const
212+
std::vector<std::string> ECVmultiThermal::getLambdas() const
213213
{
214214
plumed_massert(!todoAutomatic_,"cannot access lambdas before initializing them");
215215
const double temp0=kbt_/plumed.getAtoms().getKBoltzmann();
@@ -223,7 +223,7 @@ std::vector<std::string> ECVmultiCanonical::getLambdas() const
223223
return lambdas;
224224
}
225225

226-
void ECVmultiCanonical::initECVs()
226+
void ECVmultiThermal::initECVs()
227227
{
228228
plumed_massert(!isReady_,"initialization should not be called twice");
229229
plumed_massert(!todoAutomatic_,"this should not happen");
@@ -233,7 +233,7 @@ void ECVmultiCanonical::initECVs()
233233
log.printf(" *%4lu temperatures for %s\n",derECVs_.size(),getName().c_str());
234234
}
235235

236-
void ECVmultiCanonical::initECVs_observ(const std::vector<double>& all_obs_cvs,const unsigned ncv,const unsigned index_j)
236+
void ECVmultiThermal::initECVs_observ(const std::vector<double>& all_obs_cvs,const unsigned ncv,const unsigned index_j)
237237
{
238238
if(todoAutomatic_) //estimate the steps in beta from observations
239239
{
@@ -250,7 +250,7 @@ void ECVmultiCanonical::initECVs_observ(const std::vector<double>& all_obs_cvs,c
250250
calculateECVs(&all_obs_cvs[index_j]);
251251
}
252252

253-
void ECVmultiCanonical::initECVs_restart(const std::vector<std::string>& lambdas)
253+
void ECVmultiThermal::initECVs_restart(const std::vector<std::string>& lambdas)
254254
{
255255
std::size_t pos=lambdas[0].find("_");
256256
plumed_massert(pos==std::string::npos,"this should not happen, only one CV is used in "+getName());

src/opes/ECVmultiThermalBaric.cpp

+20-4
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,22 @@ ECVmultiThermalBaric::ECVmultiThermalBaric(const ActionOptions&ao)
146146
const double kB=plumed.getAtoms().getKBoltzmann();
147147
const double temp0=kbt_/kB;
148148

149+
//workaround needed for intel compiler
150+
bool nan_support=true;
151+
const double my_nan_value=-42;
152+
if(!std::isnan(std::numeric_limits<double>::quiet_NaN()))
153+
{
154+
nan_support=false;
155+
log.printf(" +++ WARNING +++ do not set PRESSURE_MIN/MAX=%g, see https://github.com/plumed/plumed2/pull/990\n", my_nan_value);
156+
}
157+
auto isNone=[nan_support,my_nan_value](const double value)
158+
{
159+
if(nan_support)
160+
return std::isnan(value);
161+
else
162+
return value==my_nan_value;
163+
};
164+
149165
//parse temp range
150166
double temp_min=-1;
151167
double temp_max=-1;
@@ -181,7 +197,7 @@ ECVmultiThermalBaric::ECVmultiThermalBaric(const ActionOptions&ao)
181197
plumed_massert(temp_steps==0,"cannot set both SET_ALL_TEMP_PRESSURE and TEMP_STEPS");
182198
plumed_massert(pres_steps==0,"cannot set both SET_ALL_TEMP_PRESSURE and PRESSURE_STEPS");
183199
plumed_massert(temp_min==-1 && temp_max==-1,"cannot set both SET_ALL_TEMP_PRESSURE and TEMP_MIN/MAX");
184-
plumed_massert(std::isnan(pres_min) && std::isnan(pres_max),"cannot set both SET_ALL_TEMP_PRESSURE and PRESSURE_MIN/MAX");
200+
plumed_massert(isNone(pres_min) && isNone(pres_max),"cannot set both SET_ALL_TEMP_PRESSURE and PRESSURE_MIN/MAX");
185201
plumed_massert(cut_corner.size()==0,"cannot set both SET_ALL_TEMP_PRESSURE and CUT_CORNER");
186202
//setup the target temperature-pressure grid
187203
derECVs_beta_.resize(custom_lambdas_.size());
@@ -257,7 +273,7 @@ ECVmultiThermalBaric::ECVmultiThermalBaric(const ActionOptions&ao)
257273
if(pres_.size()>0)
258274
{
259275
plumed_massert(pres_steps==0,"cannot set both PRESSURE_STEPS and PRESSURE_SET_ALL");
260-
plumed_massert(std::isnan(pres_min) && std::isnan(pres_max),"cannot set both PRESSURE_SET_ALL and PRESSURE_MIN/MAX");
276+
plumed_massert(isNone(pres_min) && isNone(pres_max),"cannot set both PRESSURE_SET_ALL and PRESSURE_MIN/MAX");
261277
plumed_massert(pres_.size()>=2,"set at least 2 pressures");
262278
for(unsigned kk=0; kk<pres_.size()-1; kk++)
263279
plumed_massert(pres_[kk]<=pres_[kk+1],"PRESSURE_SET_ALL must be properly ordered");
@@ -266,12 +282,12 @@ ECVmultiThermalBaric::ECVmultiThermalBaric(const ActionOptions&ao)
266282
}
267283
else
268284
{ //get PRESSURE_MIN and PRESSURE_MAX
269-
if(std::isnan(pres_min))
285+
if(isNone(pres_min))
270286
{
271287
pres_min=pres0_;
272288
log.printf(" no PRESSURE_MIN provided, using PRESSURE_MIN=PRESSURE\n");
273289
}
274-
if(std::isnan(pres_max))
290+
if(isNone(pres_max))
275291
{
276292
pres_max=pres0_;
277293
log.printf(" no PRESSURE_MAX provided, using PRESSURE_MAX=PRESSURE\n");

src/secondarystructure/AntibetaRMSD.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,11 @@ AntibetaRMSD::AntibetaRMSD(const ActionOptions&ao):
112112

113113
bool intra_chain(false), inter_chain(false);
114114
std::string style; parse("STYLE",style);
115-
if( style=="all" ) {
115+
if( Tools::caseInSensStringCompare(style, "all") ) {
116116
intra_chain=true; inter_chain=true;
117-
} else if( style=="inter") {
117+
} else if( Tools::caseInSensStringCompare(style, "inter") ) {
118118
intra_chain=false; inter_chain=true;
119-
} else if( style=="intra") {
119+
} else if( Tools::caseInSensStringCompare(style, "intra") ) {
120120
intra_chain=true; inter_chain=false;
121121
} else {
122122
error( style + " is not a valid directive for the STYLE keyword");

src/secondarystructure/ParabetaRMSD.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,11 @@ ParabetaRMSD::ParabetaRMSD(const ActionOptions&ao):
113113

114114
bool intra_chain(false), inter_chain(false);
115115
std::string style; parse("STYLE",style);
116-
if( style=="all" ) {
116+
if( Tools::caseInSensStringCompare(style, "all") ) {
117117
intra_chain=true; inter_chain=true;
118-
} else if( style=="inter") {
118+
} else if( Tools::caseInSensStringCompare(style, "inter") ) {
119119
intra_chain=false; inter_chain=true;
120-
} else if( style=="intra") {
120+
} else if( Tools::caseInSensStringCompare(style, "intra") ) {
121121
intra_chain=true; inter_chain=false;
122122
} else {
123123
error( style + " is not a valid directive for the STYLE keyword");
@@ -148,7 +148,7 @@ ParabetaRMSD::ParabetaRMSD(const ActionOptions&ao):
148148
}
149149
// This constructs all conceivable sections of antibeta sheet that form between chains
150150
if( inter_chain ) {
151-
if( chains.size()==1 && style!="all" ) error("there is only one chain defined so cannot use inter_chain option");
151+
if( chains.size()==1 && !Tools::caseInSensStringCompare(style, "all") ) error("there is only one chain defined so cannot use inter_chain option");
152152
std::vector<unsigned> nlist(30);
153153
for(unsigned ichain=1; ichain<chains.size(); ++ichain) {
154154
unsigned iprev=0; for(unsigned i=0; i<ichain; ++i) iprev+=chains[i];

src/secondarystructure/SecondaryStructureRMSD.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ void SecondaryStructureRMSD::readBackboneAtoms( const std::string& moltype, std:
115115
std::vector<std::string> resstrings; parseVector( "RESIDUES", resstrings );
116116
if( !verbose_output ) {
117117
if(resstrings.size()==0) error("residues are not defined, check the keyword RESIDUES");
118-
else if(resstrings[0]=="all") {
118+
else if( Tools::caseInSensStringCompare(resstrings[0], "all") ) {
119+
resstrings[0]="all";
119120
log.printf(" examining all possible secondary structure combinations\n");
120121
} else {
121122
log.printf(" examining secondary structure in residue positions : %s \n",resstrings[0].c_str() );

0 commit comments

Comments
 (0)