Commit 28bdebd3 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

avoid segfault when calling PPPM*::memory_usage() before grid communication is initialized

parent 5feeb79c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -3158,7 +3158,7 @@ double PPPMKokkos<DeviceType>::memory_usage()
  if (peratom_allocate_flag)
    bytes += 6 * nbrick * sizeof(FFT_SCALAR);

  bytes += cg->memory_usage();
  if (cg) bytes += cg->memory_usage();

  return bytes;
}
+1 −1
Original line number Diff line number Diff line
@@ -3085,7 +3085,7 @@ double PPPM::memory_usage()
    bytes += 2 * nfft_both * sizeof(FFT_SCALAR);;
  }

  bytes += cg->memory_usage();
  if (cg) bytes += cg->memory_usage();

  return bytes;
}
+2 −2
Original line number Diff line number Diff line
@@ -8240,7 +8240,7 @@ double PPPMDisp::memory_usage()
    bytes += 6 * nfft_both * sizeof(double);      // vg
    bytes += nfft_both * sizeof(double);          // greensfn
    bytes += nfft_both * 3 * sizeof(FFT_SCALAR);    // density_FFT, work1, work2
    bytes += cg->memory_usage();
    if (cg) bytes += cg->memory_usage();
  }

  if (function[1] + function[2] + function[3]) {
@@ -8250,7 +8250,7 @@ double PPPMDisp::memory_usage()
    bytes += 6 * nfft_both_6 * sizeof(double);      // vg
    bytes += nfft_both_6 * sizeof(double);          // greensfn
    bytes += nfft_both_6 * (mixing + 2) * sizeof(FFT_SCALAR);    // density_FFT, work1, work2
    bytes += cg_6->memory_usage();
    if (cg_6) bytes += cg_6->memory_usage();
  }
  return bytes;
}