avoid segfault when calling PPPM*::memory_usage() before grid communication is initialized
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user