more local buffers removed and file error status added.
This commit is contained in:
@ -32,6 +32,8 @@
|
||||
#include "thermo.h"
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
#include "utils.h"
|
||||
#include "fmt/format.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
@ -191,11 +193,9 @@ void WriteData::write(char *file)
|
||||
|
||||
if (me == 0) {
|
||||
fp = fopen(file,"w");
|
||||
if (fp == NULL) {
|
||||
char str[128];
|
||||
snprintf(str,128,"Cannot open data file %s",file);
|
||||
error->one(FLERR,str);
|
||||
}
|
||||
if (fp == NULL)
|
||||
error->one(FLERR,fmt::format("Cannot open data file {}: {}",
|
||||
file, utils::getsyserror()));
|
||||
}
|
||||
|
||||
// proc 0 writes header, ntype-length arrays, force fields
|
||||
|
||||
Reference in New Issue
Block a user