more local buffers removed and file error status added.

This commit is contained in:
Axel Kohlmeyer
2020-06-04 19:46:35 -04:00
parent 62ee8d41f3
commit 54a8b4e08b
15 changed files with 152 additions and 146 deletions

View File

@ -35,6 +35,8 @@
#include "mpiio.h"
#include "memory.h"
#include "error.h"
#include "utils.h"
#include "fmt/format.h"
#include "lmprestart.h"
@ -242,11 +244,9 @@ void WriteRestart::write(char *file)
*ptr = '%';
} else hfile = file;
fp = fopen(hfile,"wb");
if (fp == NULL) {
char str[128];
snprintf(str,128,"Cannot open restart file %s",hfile);
error->one(FLERR,str);
}
if (fp == NULL)
error->one(FLERR, fmt::format("Cannot open restart file {}: {}",
hfile, utils::getsyserror()));
if (multiproc) delete [] hfile;
}
@ -310,11 +310,9 @@ void WriteRestart::write(char *file)
if (filewriter) {
fp = fopen(multiname,"wb");
if (fp == NULL) {
char str[128];
snprintf(str,128,"Cannot open restart file %s",multiname);
error->one(FLERR,str);
}
if (fp == NULL)
error->one(FLERR, fmt::format("Cannot open restart file {}: {}",
multiname, utils::getsyserror()));
write_int(PROCSPERFILE,nclusterprocs);
}