Skip to content

Commit 15212cc

Browse files
committed
v13.2.0 fixes for VASP ML output handling, queueRefreshInterval update in runtime
1 parent 040d196 commit 15212cc

File tree

5 files changed

+35
-8
lines changed

5 files changed

+35
-8
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ cmake_minimum_required(VERSION 3.0...3.27)
22
project(XtalOpt)
33

44
set(XtalOpt_VERSION_MAJOR 13)
5-
set(XtalOpt_VERSION_MINOR 1)
6-
set(XtalOpt_VERSION_PATCH 1)
5+
set(XtalOpt_VERSION_MINOR 2)
6+
set(XtalOpt_VERSION_PATCH 0)
77
set(XtalOpt_VERSION "${XtalOpt_VERSION_MAJOR}.${XtalOpt_VERSION_MINOR}")
88
set(XtalOpt_VERSION_FULL "${XtalOpt_VERSION}.${XtalOpt_VERSION_PATCH}")
99

src/globalsearch/constants.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
/**********************************************************************
2+
constants.h - Constants and conversion factors used in XtalOpt.
3+
4+
Copyright (C) 2024 by Samad Hajinazar
5+
6+
This source code is released under the New BSD License, (the "License").
7+
8+
Unless required by applicable law or agreed to in writing, software
9+
distributed under the License is distributed on an "AS IS" BASIS,
10+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
See the License for the specific language governing permissions and
12+
limitations under the License.
13+
14+
***********************************************************************/
15+
116
#ifndef CONSTANTS_H
217
#define CONSTANTS_H
318

src/globalsearch/formats/poscarformat.cpp

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,12 @@ bool PoscarFormat::read(Structure& s, std::istream& in)
101101
// Assume atomic symbols are here and store them
102102
symbolsList = split(line, ' ');
103103
// Store atomic nums
104-
for (size_t i = 0; i < symbolsList.size(); ++i)
105-
atomicNumbers.push_back(ElemInfo::getAtomicNum(symbolsList[i]));
104+
for (size_t i = 0; i < symbolsList.size(); ++i) {
105+
// This is to handle VASP compiled with HDF5 where "/..."
106+
// might appear after species symbol
107+
string sptype = symbolsList[i].substr(0, symbolsList[i].find("/"));
108+
atomicNumbers.push_back(ElemInfo::getAtomicNum(sptype));
109+
}
106110
// This next one should be atom types
107111
getline(in, line);
108112
}
@@ -119,8 +123,12 @@ bool PoscarFormat::read(Structure& s, std::istream& in)
119123
}
120124
// Now get the symbols with a simple space split
121125
symbolsList = split(trimFormula, ' ');
122-
for (size_t i = 0; i < symbolsList.size(); ++i)
123-
atomicNumbers.push_back(ElemInfo::getAtomicNum(symbolsList.at(i)));
126+
for (size_t i = 0; i < symbolsList.size(); ++i) {
127+
// This is to handle VASP compiled with HDF5 where "/..."
128+
// might appear after species symbol
129+
string sptype = symbolsList[i].substr(0, symbolsList[i].find("/"));
130+
atomicNumbers.push_back(ElemInfo::getAtomicNum(sptype));
131+
}
124132
}
125133
}
126134

src/globalsearch/formats/vaspformat.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,15 +123,15 @@ bool VaspFormat::getOUTCAREnthalpy(std::istream& in, double& enthalpy)
123123
in.seekg(0, std::ios::end);
124124
while (in.tellg() >= 0) {
125125
reverseGetline(in, line);
126-
if (strstr(line.c_str(), "enthalpy is")) {
126+
if (strstr(line.c_str(), "enthalpy is TOTEN")) {
127127
vector<string> stringSplit = split(line, ' ');
128128
// Make sure the line is long enough. If not, just keep reading.
129129
if (stringSplit.size() < 5)
130130
continue;
131131

132132
enthalpy = atof(stringSplit[4].c_str());
133133
return true;
134-
} else if (strstr(line.c_str(), "enthalpy is ML")) { // VASP ML output
134+
} else if (strstr(line.c_str(), "enthalpy is ML TOTEN")) { // VASP ML output
135135
vector<string> stringSplit = split(line, ' ');
136136
// Make sure the line is long enough. If not, just keep reading.
137137
if (stringSplit.size() < 6)

src/xtalopt/cliOptions.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1416,6 +1416,8 @@ void XtalOptCLIOptions::writeInitialRuntimeFile(XtalOpt& xtalopt)
14161416
QString("spglibTolerance = ") + QString::number(xtalopt.tol_spg) + "\n";
14171417

14181418
text += QString("\n# Queue Interface Settings\n");
1419+
text += QString("queueRefreshInterval = ") +
1420+
QString::number(xtalopt.queueRefreshInterval()) + "\n";
14191421
text += QString("autoCancelJobAfterTime = ") +
14201422
fromBool(xtalopt.m_cancelJobAfterTime) + "\n";
14211423

@@ -1609,6 +1611,8 @@ void XtalOptCLIOptions::processRuntimeOptions(
16091611
xtalopt.m_cancelJobAfterTime = toBool(options[option]);
16101612
} else if (CICompare("hoursForAutoCancelJob", option)) {
16111613
xtalopt.m_hoursForCancelJobAfterTime = options[option].toDouble();
1614+
} else if (CICompare("queueRefreshInterval", option)) {
1615+
xtalopt.setQueueRefreshInterval(options[option].toUInt());
16121616
} else if (CICompare("softExit", option)) {
16131617
xtalopt.m_softExit = toBool(options[option]);
16141618
} else if (CICompare("hardExit", option)) {

0 commit comments

Comments
 (0)