use new utils::sfread() utility function in several classes
This commit is contained in:
@ -1364,7 +1364,7 @@ int Modify::read_restart(FILE *fp)
|
||||
// nfix_restart_global = # of restart entries with global state info
|
||||
|
||||
int me = comm->me;
|
||||
if (me == 0) fread(&nfix_restart_global,sizeof(int),1,fp);
|
||||
if (me == 0) utils::sfread(FLERR,&nfix_restart_global,sizeof(int),1,fp,NULL,error);
|
||||
MPI_Bcast(&nfix_restart_global,1,MPI_INT,0,world);
|
||||
|
||||
// allocate space for each entry
|
||||
@ -1381,22 +1381,22 @@ int Modify::read_restart(FILE *fp)
|
||||
|
||||
int n;
|
||||
for (int i = 0; i < nfix_restart_global; i++) {
|
||||
if (me == 0) fread(&n,sizeof(int),1,fp);
|
||||
if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error);
|
||||
MPI_Bcast(&n,1,MPI_INT,0,world);
|
||||
id_restart_global[i] = new char[n];
|
||||
if (me == 0) fread(id_restart_global[i],sizeof(char),n,fp);
|
||||
if (me == 0) utils::sfread(FLERR,id_restart_global[i],sizeof(char),n,fp,NULL,error);
|
||||
MPI_Bcast(id_restart_global[i],n,MPI_CHAR,0,world);
|
||||
|
||||
if (me == 0) fread(&n,sizeof(int),1,fp);
|
||||
if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error);
|
||||
MPI_Bcast(&n,1,MPI_INT,0,world);
|
||||
style_restart_global[i] = new char[n];
|
||||
if (me == 0) fread(style_restart_global[i],sizeof(char),n,fp);
|
||||
if (me == 0) utils::sfread(FLERR,style_restart_global[i],sizeof(char),n,fp,NULL,error);
|
||||
MPI_Bcast(style_restart_global[i],n,MPI_CHAR,0,world);
|
||||
|
||||
if (me == 0) fread(&n,sizeof(int),1,fp);
|
||||
if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error);
|
||||
MPI_Bcast(&n,1,MPI_INT,0,world);
|
||||
state_restart_global[i] = new char[n];
|
||||
if (me == 0) fread(state_restart_global[i],sizeof(char),n,fp);
|
||||
if (me == 0) utils::sfread(FLERR,state_restart_global[i],sizeof(char),n,fp,NULL,error);
|
||||
MPI_Bcast(state_restart_global[i],n,MPI_CHAR,0,world);
|
||||
|
||||
used_restart_global[i] = 0;
|
||||
@ -1406,7 +1406,7 @@ int Modify::read_restart(FILE *fp)
|
||||
|
||||
int maxsize = 0;
|
||||
|
||||
if (me == 0) fread(&nfix_restart_peratom,sizeof(int),1,fp);
|
||||
if (me == 0) utils::sfread(FLERR,&nfix_restart_peratom,sizeof(int),1,fp,NULL,error);
|
||||
MPI_Bcast(&nfix_restart_peratom,1,MPI_INT,0,world);
|
||||
|
||||
// allocate space for each entry
|
||||
@ -1423,19 +1423,19 @@ int Modify::read_restart(FILE *fp)
|
||||
// set index = which set of extra data this fix represents
|
||||
|
||||
for (int i = 0; i < nfix_restart_peratom; i++) {
|
||||
if (me == 0) fread(&n,sizeof(int),1,fp);
|
||||
if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error);
|
||||
MPI_Bcast(&n,1,MPI_INT,0,world);
|
||||
id_restart_peratom[i] = new char[n];
|
||||
if (me == 0) fread(id_restart_peratom[i],sizeof(char),n,fp);
|
||||
if (me == 0) utils::sfread(FLERR,id_restart_peratom[i],sizeof(char),n,fp,NULL,error);
|
||||
MPI_Bcast(id_restart_peratom[i],n,MPI_CHAR,0,world);
|
||||
|
||||
if (me == 0) fread(&n,sizeof(int),1,fp);
|
||||
if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error);
|
||||
MPI_Bcast(&n,1,MPI_INT,0,world);
|
||||
style_restart_peratom[i] = new char[n];
|
||||
if (me == 0) fread(style_restart_peratom[i],sizeof(char),n,fp);
|
||||
if (me == 0) utils::sfread(FLERR,style_restart_peratom[i],sizeof(char),n,fp,NULL,error);
|
||||
MPI_Bcast(style_restart_peratom[i],n,MPI_CHAR,0,world);
|
||||
|
||||
if (me == 0) fread(&n,sizeof(int),1,fp);
|
||||
if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error);
|
||||
MPI_Bcast(&n,1,MPI_INT,0,world);
|
||||
maxsize += n;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user