26 for (
int i = 1; i < argc; i++)
28 vec.push_back(argv[i]);
35 ifstream ifile(name.c_str());
39 int main(
int argc,
char* argv[])
42 int rank = 0, world_size = 1;
44 MPI_Init_thread(NULL, NULL, MPI_THREAD_FUNNELED, &provided);
45 MPI_Comm_rank(MPI_COMM_WORLD, &rank);
46 MPI_Comm_size(MPI_COMM_WORLD, &world_size);
49 vector<string> vecParams;
52 string ofname =
"eshdf.h5";
53 for (
int i = 0; i < vecParams.size(); i++)
55 if (vecParams[i] ==
"--output" || vecParams[i] ==
"-o")
57 ofname = vecParams[i + 1];
67 cerr <<
"must specify a valid xml file name as an argument" << endl;
68 cerr << fname <<
" did not work" << endl;
72 ifstream is(fname.c_str());
75 string name = inFile.getName();
76 string directory(
"./");
77 const int last_slash_index = fname.find_last_of(
'/');
78 if (last_slash_index > -1)
80 directory = fname.substr(0, last_slash_index + 1);
83 if (name ==
"qes:espresso")
87 cout <<
"xml file comes from quantum espresso" << endl;
94 else if (name ==
"fpmd:sample")
96 cout <<
"xml file comes from qbox" << endl;
105 cerr <<
"xml format is unrecognized" << endl;
bool file_exists(const std::string &name)
void convertToVecStrings(int argc, char *argv[], std::vector< std::string > &vec)
void writeQEElectrons(const XmlNode &qeXml, const std::string &dir_name)
void writeQEAtoms(const XmlNode &qeXml)
void writeQboxBoilerPlate(const XmlNode &qboxSample)
int main(int argc, char *argv[])
void writeQEBoilerPlate(const XmlNode &qeXml)
void writeQboxElectrons(const XmlNode &qboxSample)
void writeQboxAtoms(const XmlNode &qboxSample)
void writeQESupercell(const XmlNode &qeXml)
void writeQboxSupercell(const XmlNode &qboxSample)