1
0
mirror of https://github.com/paboyle/Grid.git synced 2025-04-06 20:25:56 +01:00

Hadrons: more verbose directory creation error

This commit is contained in:
Antonin Portelli 2018-05-07 18:12:22 +01:00
parent 27a4d4c951
commit 2017e4e3b4
2 changed files with 14 additions and 8 deletions

View File

@ -170,11 +170,13 @@ protected:
{
ScidacWriter binWriter(evec[0]._grid->IsBoss());
XmlWriter xmlWriter("", "eigenPackPar");
std::string d = dirname(filename);
std::string d = dirname(filename);
int status = mkdir(d);
if (mkdir(d))
if (status)
{
HADRONS_ERROR(Io, "cannot create directory '" + d + "'");\
HADRONS_ERROR(Io, "cannot create directory '" + d
+ "' (status " + std::to_string(status) + ")");
}
xmlWriter.pushXmlString(record.operatorXml);
xmlWriter.pushXmlString(record.solverXml);
@ -199,11 +201,13 @@ protected:
ScidacWriter binWriter(evec._grid->IsBoss());
XmlWriter xmlWriter("", "eigenPackPar");
VecRecord vecRecord;
std::string d = dirname(filename);
std::string d = dirname(filename);
int status = mkdir(d);
if (mkdir(d))
if (status)
{
HADRONS_ERROR(Io, "cannot create directory '" + d + "'");\
HADRONS_ERROR(Io, "cannot create directory '" + d
+ "' (status " + std::to_string(status) + ")");
}
xmlWriter.pushXmlString(record.operatorXml);
xmlWriter.pushXmlString(record.solverXml);

View File

@ -123,10 +123,12 @@ MACRO_REDIRECT(__VA_ARGS__, envTmpLat5, envTmpLat4)(__VA_ARGS__)
if (env().getGrid()->IsBoss())\
{\
std::string _dirname = dirname(ioStem);\
int _status = mkdir(_dirname);\
\
if (mkdir(_dirname))\
if (_status)\
{\
HADRONS_ERROR(Io, "cannot create directory '" + _dirname + "'");\
HADRONS_ERROR(Io, "cannot create directory '" + _dirname \
+ "' (status " + std::to_string(_status) + ")");\
}\
{\
ResultWriter _writer(RESULT_FILE_NAME(ioStem));\