Unverified Commit 60f078a8 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

fix buffer size and format bugs in atom_vec_tri.cpp

parent 5f14d5c8
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -490,7 +490,6 @@ int AtomVecLine::pack_data_bonus(double *buf, int /*flag*/)
      buf[m++] = y2;
    } else m += size_data_bonus;
  }

  return m;
}

+2 −4
Original line number Diff line number Diff line
@@ -724,10 +724,8 @@ int AtomVecTri::pack_data_bonus(double *buf, int /*flag*/)
      buf[m++] = xc + dc3[0];
      buf[m++] = yc + dc3[1];
      buf[m++] = zc + dc3[2];
    } else m += size_data_bonus;
  }
    m++;
  }

  return m;
}

@@ -739,7 +737,7 @@ void AtomVecTri::write_data_bonus(FILE *fp, int n, double *buf, int /*flag*/)
{
  int i = 0;
  while (i < n) {
    fmt::print(fp,"{} {} {} {} {} {} {} {} {} {} {}\n", ubuf(buf[i]).i,
    fmt::print(fp,"{} {} {} {} {} {} {} {} {} {}\n", ubuf(buf[i]).i,
               buf[i+1],buf[i+2],buf[i+3],buf[i+4],buf[i+5],buf[i+6],
               buf[i+7],buf[i+8],buf[i+9]);
    i += size_data_bonus;
+1 −1
Original line number Diff line number Diff line
@@ -669,7 +669,7 @@ void WriteData::bonus(int flag)
  int maxvalues;
  MPI_Allreduce(&nvalues,&maxvalues,1,MPI_INT,MPI_MAX,world);

  double *buf;
  double *buf = nullptr;
  if (me == 0) memory->create(buf,MAX(1,maxvalues),"write_data:buf");
  else memory->create(buf,MAX(1,nvalues),"write_data:buf");