Commit 2c6e177d authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

avoid reporting negative memory allocation when memory_usage() is called before initialized

parent 7b218283
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -215,7 +215,7 @@ void ComputeForceTally::compute_peratom()

double ComputeForceTally::memory_usage()
{
  double bytes = nmax*size_peratom_cols * sizeof(double);
  double bytes = (nmax < 0) ? 0 : nmax*size_peratom_cols * sizeof(double);
  return bytes;
}
+1 −1
Original line number Diff line number Diff line
@@ -275,7 +275,7 @@ void ComputeHeatFluxTally::compute_vector()

double ComputeHeatFluxTally::memory_usage()
{
  double bytes = nmax*comm_reverse * sizeof(double);
  double bytes = (nmax < 0) ? 0 : nmax*comm_reverse * sizeof(double);
  return bytes;
}
+1 −1
Original line number Diff line number Diff line
@@ -199,7 +199,7 @@ void ComputePETally::compute_peratom()

double ComputePETally::memory_usage()
{
  double bytes = nmax*size_peratom_cols * sizeof(double);
  double bytes = (nmax < 0) ? 0 : nmax*size_peratom_cols * sizeof(double);
  return bytes;
}
+1 −1
Original line number Diff line number Diff line
@@ -242,7 +242,7 @@ void ComputeStressTally::compute_peratom()

double ComputeStressTally::memory_usage()
{
  double bytes = nmax*size_peratom_cols * sizeof(double);
  double bytes = (nmax < 0) ? 0 : nmax*size_peratom_cols * sizeof(double);
  return bytes;
}