diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 7507db07ef..827306c9aa 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -4,8 +4,6 @@ name: "CodeQL Code Analysis" on: push: branches: [master] - pull_request: - branches: [master] jobs: analyze: diff --git a/.github/workflows/unittest-macos.yml b/.github/workflows/unittest-macos.yml index ed3b9562a5..a65db7636b 100644 --- a/.github/workflows/unittest-macos.yml +++ b/.github/workflows/unittest-macos.yml @@ -4,8 +4,6 @@ name: "Unittest for MacOS" on: push: branches: [master] - pull_request: - branches: [master] jobs: build: diff --git a/doc/src/thermo_modify.rst b/doc/src/thermo_modify.rst index fc8f66b90b..6d56f60276 100644 --- a/doc/src/thermo_modify.rst +++ b/doc/src/thermo_modify.rst @@ -96,9 +96,11 @@ always include a divide by the number of atoms in the variable formula if this is not the case. The *flush* keyword invokes a flush operation after thermodynamic info -is written to the log file. This insures the output in that file is -current (no buffering by the OS), even if LAMMPS halts before the -simulation completes. +is written to the screen and log file. This insures the output is +updated and not buffered (by the application) even if LAMMPS halts +before the simulation completes. Please note that this does not +affect buffering by the OS or devices, so you may still lose data +in case the simulation stops due to a hardware failure. The *line* keyword determines whether thermodynamics will be output as a series of numeric values on one line or in a multi-line format with diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp index f52b976b63..73d2a2f8ba 100644 --- a/src/GRANULAR/fix_wall_gran.cpp +++ b/src/GRANULAR/fix_wall_gran.cpp @@ -1446,10 +1446,10 @@ double FixWallGran::memory_usage() { int nmax = atom->nmax; double bytes = 0.0; - if (use_history) bytes += nmax*size_history * sizeof(double); // shear history - if (fix_rigid) bytes += nmax * sizeof(int); // mass_rigid + if (use_history) bytes += (double)nmax*size_history * sizeof(double); // shear history + if (fix_rigid) bytes += (double)nmax * sizeof(int); // mass_rigid // store contacts - if (peratom_flag) bytes += nmax*size_peratom_cols*sizeof(double); + if (peratom_flag) bytes += (double)nmax*size_peratom_cols*sizeof(double); return bytes; } diff --git a/src/GRANULAR/fix_wall_gran_region.cpp b/src/GRANULAR/fix_wall_gran_region.cpp index d4199c2023..5e670a0a07 100644 --- a/src/GRANULAR/fix_wall_gran_region.cpp +++ b/src/GRANULAR/fix_wall_gran_region.cpp @@ -346,11 +346,11 @@ double FixWallGranRegion::memory_usage() int nmax = atom->nmax; double bytes = 0.0; if (use_history) { // shear history - bytes += nmax * sizeof(int); // ncontact - bytes += nmax*tmax * sizeof(int); // walls - bytes += nmax*tmax*size_history * sizeof(double); // history_many + bytes += (double)nmax * sizeof(int); // ncontact + bytes += (double)nmax*tmax * sizeof(int); // walls + bytes += (double)nmax*tmax*size_history * sizeof(double); // history_many } - if (fix_rigid) bytes += nmax * sizeof(int); // mass_rigid + if (fix_rigid) bytes += (double)nmax * sizeof(int); // mass_rigid return bytes; } diff --git a/src/KOKKOS/atom_vec_dpd_kokkos.cpp b/src/KOKKOS/atom_vec_dpd_kokkos.cpp index ad47b6f108..923f734d6e 100644 --- a/src/KOKKOS/atom_vec_dpd_kokkos.cpp +++ b/src/KOKKOS/atom_vec_dpd_kokkos.cpp @@ -1101,7 +1101,7 @@ struct AtomVecDPDKokkos_UnpackBorder { _uCond(uCond), _uMech(uMech), _uChem(uChem), - _uCG(uCGnew), + _uCG(uCG), _uCGnew(uCGnew), _first(first) {}; diff --git a/src/KOKKOS/fix_neigh_history_kokkos.cpp b/src/KOKKOS/fix_neigh_history_kokkos.cpp index e7b16e64f8..fd625c6718 100644 --- a/src/KOKKOS/fix_neigh_history_kokkos.cpp +++ b/src/KOKKOS/fix_neigh_history_kokkos.cpp @@ -244,10 +244,10 @@ template double FixNeighHistoryKokkos::memory_usage() { double bytes = d_firstflag.extent(0)*d_firstflag.extent(1)*sizeof(int); - bytes += d_firstvalue.extent(0)*d_firstvalue.extent(1)*sizeof(double); - bytes += 2*k_npartner.extent(0)*sizeof(int); - bytes += 2*k_partner.extent(0)*k_partner.extent(1)*sizeof(int); - bytes += 2*k_valuepartner.extent(0)*k_valuepartner.extent(1)*sizeof(double); + bytes += (double)d_firstvalue.extent(0)*d_firstvalue.extent(1)*sizeof(double); + bytes += (double)2*k_npartner.extent(0)*sizeof(int); + bytes += (double)2*k_partner.extent(0)*k_partner.extent(1)*sizeof(int); + bytes += (double)2*k_valuepartner.extent(0)*k_valuepartner.extent(1)*sizeof(double); return bytes; } diff --git a/src/KOKKOS/fix_qeq_reax_kokkos.cpp b/src/KOKKOS/fix_qeq_reax_kokkos.cpp index 81922c764b..7e4d99e1c3 100644 --- a/src/KOKKOS/fix_qeq_reax_kokkos.cpp +++ b/src/KOKKOS/fix_qeq_reax_kokkos.cpp @@ -1492,10 +1492,10 @@ double FixQEqReaxKokkos::memory_usage() double bytes; bytes = atom->nmax*nprev*2 * sizeof(F_FLOAT); // s_hist & t_hist - bytes += atom->nmax*8 * sizeof(F_FLOAT); // storage - bytes += n_cap*2 * sizeof(int); // matrix... - bytes += m_cap * sizeof(int); - bytes += m_cap * sizeof(F_FLOAT); + bytes += (double)atom->nmax*8 * sizeof(F_FLOAT); // storage + bytes += (double)n_cap*2 * sizeof(int); // matrix... + bytes += (double)m_cap * sizeof(int); + bytes += (double)m_cap * sizeof(F_FLOAT); return bytes; } diff --git a/src/KOKKOS/fix_shardlow_kokkos.cpp b/src/KOKKOS/fix_shardlow_kokkos.cpp index 029740a305..fa4828dece 100644 --- a/src/KOKKOS/fix_shardlow_kokkos.cpp +++ b/src/KOKKOS/fix_shardlow_kokkos.cpp @@ -790,7 +790,7 @@ template double FixShardlowKokkos::memory_usage() { double bytes = 0.0; - bytes += sizeof(double)*3*ghostmax; // v_t0[] + bytes += (double)sizeof(double)*3*ghostmax; // v_t0[] return bytes; } diff --git a/src/KOKKOS/pair_reaxc_kokkos.cpp b/src/KOKKOS/pair_reaxc_kokkos.cpp index a918695e33..75a1448b33 100644 --- a/src/KOKKOS/pair_reaxc_kokkos.cpp +++ b/src/KOKKOS/pair_reaxc_kokkos.cpp @@ -3696,25 +3696,25 @@ double PairReaxCKokkos::memory_usage() double bytes = 0.0; if (cut_hbsq > 0.0) { - bytes += nmax*3*sizeof(int); - bytes += maxhb*nmax*sizeof(int); + bytes += (double)nmax*3*sizeof(int); + bytes += (double)maxhb*nmax*sizeof(int); } - bytes += nmax*2*sizeof(int); - bytes += maxbo*nmax*sizeof(int); + bytes += (double)nmax*2*sizeof(int); + bytes += (double)maxbo*nmax*sizeof(int); - bytes += nmax*17*sizeof(F_FLOAT); - bytes += maxbo*nmax*34*sizeof(F_FLOAT); + bytes += (double)nmax*17*sizeof(F_FLOAT); + bytes += (double)maxbo*nmax*34*sizeof(F_FLOAT); // FixReaxCSpecies if (fixspecies_flag) { - bytes += MAXSPECBOND*nmax*sizeof(tagint); - bytes += MAXSPECBOND*nmax*sizeof(F_FLOAT); + bytes += (double)MAXSPECBOND*nmax*sizeof(tagint); + bytes += (double)MAXSPECBOND*nmax*sizeof(F_FLOAT); } // FixReaxCBonds - bytes += maxbo*nmax*sizeof(tagint); - bytes += maxbo*nmax*sizeof(F_FLOAT); - bytes += nmax*sizeof(int); + bytes += (double)maxbo*nmax*sizeof(tagint); + bytes += (double)maxbo*nmax*sizeof(F_FLOAT); + bytes += (double)nmax*sizeof(int); return bytes; } diff --git a/src/KOKKOS/pppm_kokkos.cpp b/src/KOKKOS/pppm_kokkos.cpp index edee26e645..cdf973ce28 100644 --- a/src/KOKKOS/pppm_kokkos.cpp +++ b/src/KOKKOS/pppm_kokkos.cpp @@ -2876,18 +2876,18 @@ double PPPMKokkos::memory_usage() double bytes = nmax*3 * sizeof(double); int nbrick = (nxhi_out-nxlo_out+1) * (nyhi_out-nylo_out+1) * (nzhi_out-nzlo_out+1); - bytes += 4 * nbrick * sizeof(FFT_SCALAR); - if (triclinic) bytes += 3 * nfft_both * sizeof(double); - bytes += 6 * nfft_both * sizeof(double); - bytes += nfft_both * sizeof(double); - bytes += nfft_both*5 * sizeof(FFT_SCALAR); + bytes += (double)4 * nbrick * sizeof(FFT_SCALAR); + if (triclinic) bytes += (double)3 * nfft_both * sizeof(double); + bytes += (double)6 * nfft_both * sizeof(double); + bytes += (double)nfft_both * sizeof(double); + bytes += (double)nfft_both*5 * sizeof(FFT_SCALAR); if (peratom_allocate_flag) - bytes += 6 * nbrick * sizeof(FFT_SCALAR); + bytes += (double)6 * nbrick * sizeof(FFT_SCALAR); // two GridComm bufs - bytes += (ngc_buf1 + ngc_buf2) * npergrid * sizeof(FFT_SCALAR); + bytes += (double)(ngc_buf1 + ngc_buf2) * npergrid * sizeof(FFT_SCALAR); return bytes; } diff --git a/src/KSPACE/ewald.cpp b/src/KSPACE/ewald.cpp index a1fa018ef1..12b3a7d962 100644 --- a/src/KSPACE/ewald.cpp +++ b/src/KSPACE/ewald.cpp @@ -1228,10 +1228,10 @@ void Ewald::slabcorr() double Ewald::memory_usage() { double bytes = 3 * kmax3d * sizeof(int); - bytes += (1 + 3 + 6) * kmax3d * sizeof(double); - bytes += 4 * kmax3d * sizeof(double); - bytes += nmax*3 * sizeof(double); - bytes += 2 * (2*kmax+1)*3*nmax * sizeof(double); + bytes += (double)(1 + 3 + 6) * kmax3d * sizeof(double); + bytes += (double)4 * kmax3d * sizeof(double); + bytes += (double)nmax*3 * sizeof(double); + bytes += (double)2 * (2*kmax+1)*3*nmax * sizeof(double); return bytes; } diff --git a/src/KSPACE/ewald_disp.cpp b/src/KSPACE/ewald_disp.cpp index 83e33b9e8f..89eeb4b3eb 100644 --- a/src/KSPACE/ewald_disp.cpp +++ b/src/KSPACE/ewald_disp.cpp @@ -406,17 +406,17 @@ void EwaldDisp::reallocate() if (nkvec>nkvec_max) { deallocate(); // free memory hvec = new hvector[nkvec]; // hvec - bytes += (nkvec-nkvec_max)*sizeof(hvector); + bytes += (double)(nkvec-nkvec_max)*sizeof(hvector); kvec = new kvector[nkvec]; // kvec - bytes += (nkvec-nkvec_max)*sizeof(kvector); + bytes += (double)(nkvec-nkvec_max)*sizeof(kvector); kenergy = new double[nkvec*nfunctions]; // kenergy - bytes += (nkvec-nkvec_max)*nfunctions*sizeof(double); + bytes += (double)(nkvec-nkvec_max)*nfunctions*sizeof(double); kvirial = new double[6*nkvec*nfunctions]; // kvirial - bytes += 6*(nkvec-nkvec_max)*nfunctions*sizeof(double); + bytes += (double)6*(nkvec-nkvec_max)*nfunctions*sizeof(double); cek_local = new complex[nkvec*nsums]; // cek_local - bytes += (nkvec-nkvec_max)*nsums*sizeof(complex); + bytes += (double)(nkvec-nkvec_max)*nsums*sizeof(complex); cek_global = new complex[nkvec*nsums]; // cek_global - bytes += (nkvec-nkvec_max)*nsums*sizeof(complex); + bytes += (double)(nkvec-nkvec_max)*nsums*sizeof(complex); nkvec_max = nkvec; } @@ -449,7 +449,7 @@ void EwaldDisp::reallocate_atoms() if ((nevec = atom->nmax*(2*nbox+1))<=nevec_max) return; delete [] ekr_local; ekr_local = new cvector[nevec]; - bytes += (nevec-nevec_max)*sizeof(cvector); + bytes += (double)(nevec-nevec_max)*sizeof(cvector); nevec_max = nevec; } @@ -549,7 +549,7 @@ void EwaldDisp::init_coeffs() delete [] B; B = new double[n+1]; B[0] = 0.0; - bytes += (n+1)*sizeof(double); + bytes += (double)(n+1)*sizeof(double); for (int i=1; i<=n; ++i) B[i] = sqrt(fabs(b[i][i])); } if (function[2]) { // arithmetic 1/r^6 diff --git a/src/KSPACE/msm.cpp b/src/KSPACE/msm.cpp index 2ff758a6fc..febf37029b 100644 --- a/src/KSPACE/msm.cpp +++ b/src/KSPACE/msm.cpp @@ -3433,11 +3433,11 @@ double MSM::memory_usage() // all GridComm bufs - bytes += (ngcall_buf1 + ngcall_buf2) * npergrid * sizeof(double); + bytes += (double)(ngcall_buf1 + ngcall_buf2) * npergrid * sizeof(double); for (int n=0; nnthreads; i++) bytes += ipage[i].size(); - bytes += 2*maxlocal * sizeof(double); + bytes += (double)2*maxlocal * sizeof(double); return bytes; } diff --git a/src/MANYBODY/pair_bop.cpp b/src/MANYBODY/pair_bop.cpp index 9f12b0755a..be4f17b291 100644 --- a/src/MANYBODY/pair_bop.cpp +++ b/src/MANYBODY/pair_bop.cpp @@ -5339,226 +5339,226 @@ double PairBOP::memory_usage() double bytes = 0.0; // rcut - bytes += npairs * sizeof (double); + bytes += (double)npairs * sizeof (double); // rcut3 - bytes += npairs * sizeof (double); + bytes += (double)npairs * sizeof (double); // rcutsq - bytes += npairs * sizeof (double); + bytes += (double)npairs * sizeof (double); // rcutsq3 - bytes += npairs * sizeof (double); + bytes += (double)npairs * sizeof (double); // dr - bytes += npairs * sizeof (double); + bytes += (double)npairs * sizeof (double); // rdr - bytes += npairs * sizeof (double); + bytes += (double)npairs * sizeof (double); // dr3 - bytes += npairs * sizeof (double); + bytes += (double)npairs * sizeof (double); // rdr3 - bytes += npairs * sizeof (double); + bytes += (double)npairs * sizeof (double); // setflag - bytes += (n+1) * (n+1) * sizeof (int); + bytes += (double)(n+1) * (n+1) * sizeof (int); // cutsq - bytes += (n+1) * (n+1) * sizeof (double); + bytes += (double)(n+1) * (n+1) * sizeof (double); // cutghost - bytes += (n+1) * (n+1) * sizeof (double); + bytes += (double)(n+1) * (n+1) * sizeof (double); // cutghost - bytes += (n+1) * (n+1) * sizeof (double); + bytes += (double)(n+1) * (n+1) * sizeof (double); // pBetaS - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pBetaS1 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pBetaS2 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pBetaS3 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pBetaS4 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pBetaS5 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pBetaS6 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pLong - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pLong1 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pLong2 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pLong3 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pLong4 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pLong5 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pLong6 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pBetaP - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pBetaP1 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pBetaP2 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pBetaP3 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pBetaP4 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pBetaP5 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pBetaP6 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pRepul - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pRepul1 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pRepul2 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pRepul3 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pRepul4 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pRepul5 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // pRepul6 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // FsigBO - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // FsigBO1 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // FsigBO2 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // FsigBO3 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // FsigBO4 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // FsigBO5 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // FsigBO6 - bytes += npairs * nr * sizeof (double); + bytes += (double)npairs * nr * sizeof (double); // itypeSigBk - bytes += neigh_ct* sizeof(int); + bytes += (double)neigh_ct* sizeof(int); // itypePiBk - bytes += neigh_ct* sizeof(int); + bytes += (double)neigh_ct* sizeof(int); // BOP_index - bytes += nall * sizeof(double); + bytes += (double)nall * sizeof(double); // BOP_total - bytes += nall * sizeof(double); + bytes += (double)nall * sizeof(double); if (otfly==0) { // cosAng - bytes += cos_total* sizeof(double); + bytes += (double)cos_total* sizeof(double); // dcAng - bytes += cos_total * 3 * 2 * sizeof(double); + bytes += (double)cos_total * 3 * 2 * sizeof(double); // disij - bytes += neigh_total * 3 * sizeof(double); + bytes += (double)neigh_total * 3 * sizeof(double); // rij - bytes += neigh_total * sizeof(double); + bytes += (double)neigh_total * sizeof(double); // betaS - bytes += neigh_total * sizeof(double); + bytes += (double)neigh_total * sizeof(double); // dBetaS - bytes += neigh_total * sizeof(double); + bytes += (double)neigh_total * sizeof(double); // betaP - bytes += neigh_total * sizeof(double); + bytes += (double)neigh_total * sizeof(double); // dBetaP - bytes += neigh_total * sizeof(double); + bytes += (double)neigh_total * sizeof(double); // repul - bytes += neigh_total * sizeof(double); + bytes += (double)neigh_total * sizeof(double); // dRepul - bytes += neigh_total * sizeof(double); + bytes += (double)neigh_total * sizeof(double); // cos_index - bytes += nall * sizeof(double); + bytes += (double)nall * sizeof(double); } // pi_a - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // pro - bytes += bop_types * sizeof(double); + bytes += (double)bop_types * sizeof(double); // pi_delta - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // pi_p - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // pi_c - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // sigma_r0 - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // pi_r0 - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // phi_r0 - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // sigma_rc - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // pi_rc - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // pi_a - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // pro_delta - bytes += bop_types * sizeof(double); + bytes += (double)bop_types * sizeof(double); // pi_delta - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // pi_p - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // pi_c - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // sigma_r0 - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // pi_r0 - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // phi_r0 - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // sigma_rc - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // pi_rc - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // phi_rc - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // r1 - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // sigma_beta0 - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // pi_beta0 - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // phi0 - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // sigma_n - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // pi_n - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // phi_m - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // sigma_nc - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // pi_nc - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // phi_nc - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // sigma_delta - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // sigma_c - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // sigma_a - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // sigma_f - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // sigma_k - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // small3 - bytes += npairs * sizeof(double); + bytes += (double)npairs * sizeof(double); // bt_pi - bytes += maxneigh*(maxneigh/2) *sizeof(B_PI); + bytes += (double)maxneigh*(maxneigh/2) *sizeof(B_PI); // bt_sigma - bytes += maxneigh*(maxneigh/2) *sizeof(B_SG); + bytes += (double)maxneigh*(maxneigh/2) *sizeof(B_SG); if (npower<=2) { // gfunc - bytes += bop_types*bop_types*bop_types*ntheta *sizeof(double); + bytes += (double)bop_types*bop_types*bop_types*ntheta *sizeof(double); // gfunc1 - bytes += bop_types*bop_types*bop_types*ntheta *sizeof(double); + bytes += (double)bop_types*bop_types*bop_types*ntheta *sizeof(double); // gfunc2 - bytes += bop_types*bop_types*bop_types*ntheta *sizeof(double); + bytes += (double)bop_types*bop_types*bop_types*ntheta *sizeof(double); // gfunc3 - bytes += bop_types*bop_types*bop_types*ntheta *sizeof(double); + bytes += (double)bop_types*bop_types*bop_types*ntheta *sizeof(double); // gfunc4 - bytes += bop_types*bop_types*bop_types*ntheta *sizeof(double); + bytes += (double)bop_types*bop_types*bop_types*ntheta *sizeof(double); // gfunc5 - bytes += bop_types*bop_types*bop_types*ntheta *sizeof(double); + bytes += (double)bop_types*bop_types*bop_types*ntheta *sizeof(double); // gfunc6 - bytes += bop_types*bop_types*bop_types*ntheta *sizeof(double); + bytes += (double)bop_types*bop_types*bop_types*ntheta *sizeof(double); } else { - bytes += bop_types*bop_types*bop_types*npower+1 *sizeof(double); + bytes += (double)bop_types*bop_types*bop_types*npower+1 *sizeof(double); } return bytes; } diff --git a/src/MANYBODY/pair_comb.cpp b/src/MANYBODY/pair_comb.cpp index 86bf7a20c5..7292726292 100644 --- a/src/MANYBODY/pair_comb.cpp +++ b/src/MANYBODY/pair_comb.cpp @@ -2099,14 +2099,14 @@ void PairComb::Short_neigh() double PairComb::memory_usage() { double bytes = maxeatom * sizeof(double); - bytes += maxvatom*6 * sizeof(double); - bytes += nmax * sizeof(int); - bytes += nmax * sizeof(int *); + bytes += (double)maxvatom*6 * sizeof(double); + bytes += (double)nmax * sizeof(int); + bytes += (double)nmax * sizeof(int *); for (int i = 0; i < comm->nthreads; i++) bytes += ipage[i].size(); - bytes += nmax * sizeof(int); - bytes += MAXNEIGH*nmax * sizeof(double); + bytes += (double)nmax * sizeof(int); + bytes += (double)MAXNEIGH*nmax * sizeof(double); return bytes; } diff --git a/src/MANYBODY/pair_comb3.cpp b/src/MANYBODY/pair_comb3.cpp index 5f08a6a97b..aa2afe5d20 100644 --- a/src/MANYBODY/pair_comb3.cpp +++ b/src/MANYBODY/pair_comb3.cpp @@ -3851,10 +3851,10 @@ void PairComb3::unpack_reverse_comm(int n, int *list, double *buf) double PairComb3::memory_usage() { double bytes = maxeatom * sizeof(double); - bytes += maxvatom*6 * sizeof(double); - bytes += nmax * sizeof(int); - bytes += nmax * 8.0 * sizeof(double); - bytes += 25000*2*sizeof(double); + bytes += (double)maxvatom*6 * sizeof(double); + bytes += (double)nmax * sizeof(int); + bytes += (double)nmax * 8.0 * sizeof(double); + bytes += (double)25000*2*sizeof(double); for (int i = 0; i < comm->nthreads; i++) bytes += ipage[i].size(); diff --git a/src/MANYBODY/pair_eam.cpp b/src/MANYBODY/pair_eam.cpp index 889f0969ef..d509768572 100644 --- a/src/MANYBODY/pair_eam.cpp +++ b/src/MANYBODY/pair_eam.cpp @@ -914,8 +914,8 @@ void PairEAM::unpack_reverse_comm(int n, int *list, double *buf) double PairEAM::memory_usage() { double bytes = maxeatom * sizeof(double); - bytes += maxvatom*6 * sizeof(double); - bytes += 2 * nmax * sizeof(double); + bytes += (double)maxvatom*6 * sizeof(double); + bytes += (double)2 * nmax * sizeof(double); return bytes; } diff --git a/src/MANYBODY/pair_eim.cpp b/src/MANYBODY/pair_eim.cpp index db673611e2..c56a07fb71 100644 --- a/src/MANYBODY/pair_eim.cpp +++ b/src/MANYBODY/pair_eim.cpp @@ -1045,8 +1045,8 @@ void PairEIM::unpack_reverse_comm(int n, int *list, double *buf) double PairEIM::memory_usage() { double bytes = maxeatom * sizeof(double); - bytes += maxvatom*6 * sizeof(double); - bytes += 2 * nmax * sizeof(double); + bytes += (double)maxvatom*6 * sizeof(double); + bytes += (double)2 * nmax * sizeof(double); return bytes; } diff --git a/src/MANYBODY/pair_lcbop.cpp b/src/MANYBODY/pair_lcbop.cpp index 070f23dbb9..a2a8c3d1fa 100644 --- a/src/MANYBODY/pair_lcbop.cpp +++ b/src/MANYBODY/pair_lcbop.cpp @@ -1263,12 +1263,12 @@ void PairLCBOP::spline_init() { double PairLCBOP::memory_usage() { double bytes = 0.0; - bytes += maxlocal * sizeof(int); - bytes += maxlocal * sizeof(int *); + bytes += (double)maxlocal * sizeof(int); + bytes += (double)maxlocal * sizeof(int *); for (int i = 0; i < comm->nthreads; i++) bytes += ipage[i].size(); - bytes += 3*maxlocal * sizeof(double); + bytes += (double)3*maxlocal * sizeof(double); return bytes; } diff --git a/src/MC/fix_bond_break.cpp b/src/MC/fix_bond_break.cpp index 5530649fd7..ba19cfaf69 100644 --- a/src/MC/fix_bond_break.cpp +++ b/src/MC/fix_bond_break.cpp @@ -849,6 +849,6 @@ double FixBondBreak::memory_usage() { int nmax = atom->nmax; double bytes = 2*nmax * sizeof(tagint); - bytes += nmax * sizeof(double); + bytes += (double)nmax * sizeof(double); return bytes; } diff --git a/src/MC/fix_bond_create.cpp b/src/MC/fix_bond_create.cpp index 773e033907..b33e213759 100644 --- a/src/MC/fix_bond_create.cpp +++ b/src/MC/fix_bond_create.cpp @@ -1429,7 +1429,7 @@ double FixBondCreate::memory_usage() int nmax = atom->nmax; double bytes = nmax * sizeof(int); bytes = 2*nmax * sizeof(tagint); - bytes += nmax * sizeof(double); + bytes += (double)nmax * sizeof(double); return bytes; } diff --git a/src/MISC/fix_orient_bcc.cpp b/src/MISC/fix_orient_bcc.cpp index b6ab2545ad..85734b0a6c 100644 --- a/src/MISC/fix_orient_bcc.cpp +++ b/src/MISC/fix_orient_bcc.cpp @@ -597,6 +597,6 @@ int FixOrientBCC::compare(const void *pi, const void *pj) double FixOrientBCC::memory_usage() { double bytes = nmax * sizeof(Nbr); - bytes += 2*nmax * sizeof(double); + bytes += (double)2*nmax * sizeof(double); return bytes; } diff --git a/src/MISC/fix_orient_fcc.cpp b/src/MISC/fix_orient_fcc.cpp index f718df07ad..b46232c710 100644 --- a/src/MISC/fix_orient_fcc.cpp +++ b/src/MISC/fix_orient_fcc.cpp @@ -595,6 +595,6 @@ int FixOrientFCC::compare(const void *pi, const void *pj) double FixOrientFCC::memory_usage() { double bytes = nmax * sizeof(Nbr); - bytes += 2*nmax * sizeof(double); + bytes += (double)2*nmax * sizeof(double); return bytes; } diff --git a/src/MISC/fix_ttm.cpp b/src/MISC/fix_ttm.cpp index 700c7f3d4b..4658c0c943 100644 --- a/src/MISC/fix_ttm.cpp +++ b/src/MISC/fix_ttm.cpp @@ -558,8 +558,8 @@ void FixTTM::end_of_step() double FixTTM::memory_usage() { double bytes = 0.0; - bytes += 5*total_nnodes * sizeof(int); - bytes += 14*total_nnodes * sizeof(double); + bytes += (double)5*total_nnodes * sizeof(int); + bytes += (double)14*total_nnodes * sizeof(double); return bytes; } diff --git a/src/MLIAP/compute_mliap.cpp b/src/MLIAP/compute_mliap.cpp index 0842e421c0..5b2d97d251 100644 --- a/src/MLIAP/compute_mliap.cpp +++ b/src/MLIAP/compute_mliap.cpp @@ -359,10 +359,10 @@ double ComputeMLIAP::memory_usage() double bytes = size_array_rows*size_array_cols * sizeof(double); // mliaparray - bytes += size_array_rows*size_array_cols * + bytes += (double)size_array_rows*size_array_cols * sizeof(double); // mliaparrayall int n = atom->ntypes+1; - bytes += n*sizeof(int); // map + bytes += (double)n*sizeof(int); // map bytes += descriptor->memory_usage(); // Descriptor object bytes += model->memory_usage(); // Model object diff --git a/src/MLIAP/mliap_data.cpp b/src/MLIAP/mliap_data.cpp index c310f0efc7..8eff580dd7 100644 --- a/src/MLIAP/mliap_data.cpp +++ b/src/MLIAP/mliap_data.cpp @@ -260,32 +260,32 @@ double MLIAPData::memory_usage() { double bytes = 0.0; - bytes += nelements*nparams*sizeof(double); // egradient - bytes += nmax*size_gradforce*sizeof(double); // gradforce + bytes += (double)nelements*nparams*sizeof(double); // egradient + bytes += (double)nmax*size_gradforce*sizeof(double); // gradforce if (gradgradflag == 1) { - bytes += natomgamma_max* + bytes += (double)natomgamma_max* gamma_nnz*sizeof(int); //gamma_row_index - bytes += natomgamma_max* + bytes += (double)natomgamma_max* gamma_nnz*sizeof(int); // gamma_col_index - bytes += natomgamma_max* + bytes += (double)natomgamma_max* gamma_nnz*sizeof(double); // gamma } - bytes += natoms*ndescriptors*sizeof(int); // betas - bytes += natoms*ndescriptors*sizeof(int); // descriptors - bytes += natoms*sizeof(double); // eatoms + bytes += (double)natoms*ndescriptors*sizeof(int); // betas + bytes += (double)natoms*ndescriptors*sizeof(int); // descriptors + bytes += (double)natoms*sizeof(double); // eatoms - bytes += natomneigh_max*sizeof(int); // iatoms - bytes += natomneigh_max*sizeof(int); // ielems - bytes += natomneigh_max*sizeof(int); // numneighs + bytes += (double)natomneigh_max*sizeof(int); // iatoms + bytes += (double)natomneigh_max*sizeof(int); // ielems + bytes += (double)natomneigh_max*sizeof(int); // numneighs - bytes += nneigh_max*sizeof(int); // jatoms - bytes += nneigh_max*sizeof(int); // jelems - bytes += nneigh_max*3*sizeof(double); // rij" + bytes += (double)nneigh_max*sizeof(int); // jatoms + bytes += (double)nneigh_max*sizeof(int); // jelems + bytes += (double)nneigh_max*3*sizeof(double); // rij" if (gradgradflag == 0) - bytes += nneigh_max*ndescriptors*3*sizeof(double);// graddesc + bytes += (double)nneigh_max*ndescriptors*3*sizeof(double);// graddesc return bytes; } diff --git a/src/MLIAP/mliap_descriptor_snap.cpp b/src/MLIAP/mliap_descriptor_snap.cpp index 275eadd74e..21de044f40 100644 --- a/src/MLIAP/mliap_descriptor_snap.cpp +++ b/src/MLIAP/mliap_descriptor_snap.cpp @@ -515,10 +515,10 @@ double MLIAPDescriptorSNAP::memory_usage() { double bytes = 0; - bytes += nelements*sizeof(double); // radelem - bytes += nelements*sizeof(double); // welem - bytes += nelements*nelements*sizeof(int); // cutsq - bytes += snaptr->memory_usage(); // SNA object + bytes += (double)nelements*sizeof(double); // radelem + bytes += (double)nelements*sizeof(double); // welem + bytes += (double)nelements*nelements*sizeof(int); // cutsq + bytes += snaptr->memory_usage(); // SNA object return bytes; } diff --git a/src/MLIAP/mliap_model.cpp b/src/MLIAP/mliap_model.cpp index 882f64263f..f993aeb725 100644 --- a/src/MLIAP/mliap_model.cpp +++ b/src/MLIAP/mliap_model.cpp @@ -185,7 +185,7 @@ double MLIAPModelSimple::memory_usage() { double bytes = 0; - bytes += nelements*nparams*sizeof(double); // coeffelem + bytes += (double)nelements*nparams*sizeof(double); // coeffelem return bytes; } diff --git a/src/MLIAP/pair_mliap.cpp b/src/MLIAP/pair_mliap.cpp index 0c6f3903f6..ef8a4c974e 100644 --- a/src/MLIAP/pair_mliap.cpp +++ b/src/MLIAP/pair_mliap.cpp @@ -336,9 +336,9 @@ double PairMLIAP::memory_usage() double bytes = Pair::memory_usage(); int n = atom->ntypes+1; - bytes += n*n*sizeof(int); // setflag - bytes += n*n*sizeof(int); // cutsq - bytes += n*sizeof(int); // map + bytes += (double)n*n*sizeof(int); // setflag + bytes += (double)n*n*sizeof(int); // cutsq + bytes += (double)n*sizeof(int); // map bytes += descriptor->memory_usage(); // Descriptor object bytes += model->memory_usage(); // Model object bytes += data->memory_usage(); // Data object diff --git a/src/MOLECULE/fix_cmap.cpp b/src/MOLECULE/fix_cmap.cpp index d8aee3e181..b594c4770d 100644 --- a/src/MOLECULE/fix_cmap.cpp +++ b/src/MOLECULE/fix_cmap.cpp @@ -1441,8 +1441,8 @@ double FixCMAP::memory_usage() { int nmax = atom->nmax; double bytes = nmax * sizeof(int); // num_crossterm - bytes += nmax*CMAPMAX * sizeof(int); // crossterm_type - bytes += 5*nmax*CMAPMAX * sizeof(int); // crossterm_atom 12345 - bytes += maxcrossterm*6 * sizeof(int); // crosstermlist + bytes += (double)nmax*CMAPMAX * sizeof(int); // crossterm_type + bytes += (double)5*nmax*CMAPMAX * sizeof(int); // crossterm_atom 12345 + bytes += (double)maxcrossterm*6 * sizeof(int); // crosstermlist return bytes; } diff --git a/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp b/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp index 1ef51cbcc8..32b5332484 100644 --- a/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp +++ b/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp @@ -749,7 +749,7 @@ void *PairLJCutTIP4PCut::extract(const char *str, int &dim) double PairLJCutTIP4PCut::memory_usage() { double bytes = maxeatom * sizeof(double); - bytes += maxvatom*6 * sizeof(double); - bytes += 2 * nmax * sizeof(double); + bytes += (double)maxvatom*6 * sizeof(double); + bytes += (double)2 * nmax * sizeof(double); return bytes; } diff --git a/src/MOLECULE/pair_tip4p_cut.cpp b/src/MOLECULE/pair_tip4p_cut.cpp index 3f30122a65..82055aa55b 100644 --- a/src/MOLECULE/pair_tip4p_cut.cpp +++ b/src/MOLECULE/pair_tip4p_cut.cpp @@ -551,7 +551,7 @@ void PairTIP4PCut::compute_newsite(double *xO, double *xH1, double PairTIP4PCut::memory_usage() { double bytes = maxeatom * sizeof(double); - bytes += maxvatom*6 * sizeof(double); - bytes += 2 * nmax * sizeof(double); + bytes += (double)maxvatom*6 * sizeof(double); + bytes += (double)2 * nmax * sizeof(double); return bytes; } diff --git a/src/PERI/fix_peri_neigh.cpp b/src/PERI/fix_peri_neigh.cpp index dd3cd12831..99210bde5b 100644 --- a/src/PERI/fix_peri_neigh.cpp +++ b/src/PERI/fix_peri_neigh.cpp @@ -399,18 +399,18 @@ double FixPeriNeigh::memory_usage() { int nmax = atom->nmax; int bytes = nmax * sizeof(int); - bytes += nmax*maxpartner * sizeof(tagint); - bytes += nmax*maxpartner * sizeof(double); + bytes += (double)nmax*maxpartner * sizeof(tagint); + bytes += (double)nmax*maxpartner * sizeof(double); if (isVES) { - bytes += nmax*maxpartner * sizeof(double); - bytes += nmax*maxpartner * sizeof(double); + bytes += (double)nmax*maxpartner * sizeof(double); + bytes += (double)nmax*maxpartner * sizeof(double); } if (isEPS) { - bytes += nmax*maxpartner * sizeof(double); - bytes += nmax * sizeof(double); + bytes += (double)nmax*maxpartner * sizeof(double); + bytes += (double)nmax * sizeof(double); } - bytes += nmax * sizeof(double); - bytes += nmax * sizeof(double); + bytes += (double)nmax * sizeof(double); + bytes += (double)nmax * sizeof(double); return bytes; } diff --git a/src/POEMS/fix_poems.cpp b/src/POEMS/fix_poems.cpp index a220216fdd..4379fa6bec 100644 --- a/src/POEMS/fix_poems.cpp +++ b/src/POEMS/fix_poems.cpp @@ -1526,8 +1526,8 @@ double FixPOEMS::memory_usage() { int nmax = atom->nmax; double bytes = nmax * sizeof(int); - bytes += nmax*MAXBODY * sizeof(int); - bytes += nmax*3 * sizeof(double); + bytes += (double)nmax*MAXBODY * sizeof(int); + bytes += (double)nmax*3 * sizeof(double); return bytes; } diff --git a/src/QEQ/fix_qeq.cpp b/src/QEQ/fix_qeq.cpp index 733d566b7d..1ad01e5c4e 100644 --- a/src/QEQ/fix_qeq.cpp +++ b/src/QEQ/fix_qeq.cpp @@ -525,10 +525,10 @@ double FixQEq::memory_usage() double bytes; bytes = atom->nmax*nprev*2 * sizeof(double); // s_hist & t_hist - bytes += atom->nmax*11 * sizeof(double); // storage - bytes += n_cap*2 * sizeof(int); // matrix... - bytes += m_cap * sizeof(int); - bytes += m_cap * sizeof(double); + bytes += (double)atom->nmax*11 * sizeof(double); // storage + bytes += (double)n_cap*2 * sizeof(int); // matrix... + bytes += (double)m_cap * sizeof(int); + bytes += (double)m_cap * sizeof(double); return bytes; } diff --git a/src/REPLICA/fix_event.cpp b/src/REPLICA/fix_event.cpp index a1158b0e85..8862030b7e 100644 --- a/src/REPLICA/fix_event.cpp +++ b/src/REPLICA/fix_event.cpp @@ -208,7 +208,7 @@ void FixEvent::restore_state_dephase() double FixEvent::memory_usage() { double bytes = 12*atom->nmax * sizeof(double); - bytes += atom->nmax*sizeof(int); + bytes += (double)atom->nmax*sizeof(int); return bytes; } diff --git a/src/REPLICA/fix_hyper_local.cpp b/src/REPLICA/fix_hyper_local.cpp index 4a18a47176..5bca43fbe5 100644 --- a/src/REPLICA/fix_hyper_local.cpp +++ b/src/REPLICA/fix_hyper_local.cpp @@ -1733,15 +1733,15 @@ double FixHyperLocal::memory_usage() { double bytes = maxbond * sizeof(OneBond); // blist bytes = maxbond * sizeof(double); // per-bond bias coeffs - bytes += 3*maxlocal * sizeof(int); // numbond,maxhalf,eligible - bytes += maxlocal * sizeof(double); // maxhalfstrain - bytes += maxall * sizeof(int); // old2now - bytes += maxall * sizeof(tagint); // tagold - bytes += 3*maxall * sizeof(double); // xold - bytes += 2*maxall * sizeof(double); // maxstrain,maxstrain_domain - if (checkbias) bytes += maxall * sizeof(tagint); // biasflag - bytes += maxcoeff * sizeof(int); // numcoeff - bytes += maxcoeff * sizeof(HyperOneCoeff *); // clist - bytes += maxlocal*maxbondperatom * sizeof(HyperOneCoeff); // cpage estimate + bytes += (double)3*maxlocal * sizeof(int); // numbond,maxhalf,eligible + bytes += (double)maxlocal * sizeof(double); // maxhalfstrain + bytes += (double)maxall * sizeof(int); // old2now + bytes += (double)maxall * sizeof(tagint); // tagold + bytes += (double)3*maxall * sizeof(double); // xold + bytes += (double)2*maxall * sizeof(double); // maxstrain,maxstrain_domain + if (checkbias) bytes += (double)maxall * sizeof(tagint); // biasflag + bytes += (double)maxcoeff * sizeof(int); // numcoeff + bytes += (double)maxcoeff * sizeof(HyperOneCoeff *); // clist + bytes += (double)maxlocal*maxbondperatom * sizeof(HyperOneCoeff); // cpage estimate return bytes; } diff --git a/src/RIGID/fix_ehex.cpp b/src/RIGID/fix_ehex.cpp index a3346b3d1c..474c865a8b 100644 --- a/src/RIGID/fix_ehex.cpp +++ b/src/RIGID/fix_ehex.cpp @@ -317,7 +317,7 @@ double FixEHEX::compute_scalar() double FixEHEX::memory_usage() { double bytes = 0.0; - bytes += atom->nmax * sizeof(double); + bytes += (double)atom->nmax * sizeof(double); return bytes; } diff --git a/src/RIGID/fix_rattle.cpp b/src/RIGID/fix_rattle.cpp index 2d2c11974c..6482a28e6f 100644 --- a/src/RIGID/fix_rattle.cpp +++ b/src/RIGID/fix_rattle.cpp @@ -629,7 +629,7 @@ double FixRattle::memory_usage() { int nmax = atom->nmax; double bytes = FixShake::memory_usage(); - bytes += nmax*3 * sizeof(double); + bytes += (double)nmax*3 * sizeof(double); return bytes; } diff --git a/src/RIGID/fix_rigid.cpp b/src/RIGID/fix_rigid.cpp index 9ce28438d3..b46cb1667f 100644 --- a/src/RIGID/fix_rigid.cpp +++ b/src/RIGID/fix_rigid.cpp @@ -2453,11 +2453,11 @@ double FixRigid::memory_usage() { int nmax = atom->nmax; double bytes = nmax * sizeof(int); - bytes += nmax * sizeof(imageint); - bytes += nmax*3 * sizeof(double); - bytes += maxvatom*6 * sizeof(double); // vatom + bytes += (double)nmax * sizeof(imageint); + bytes += (double)nmax*3 * sizeof(double); + bytes += (double)maxvatom*6 * sizeof(double); // vatom if (extended) { - bytes += nmax * sizeof(int); + bytes += (double)nmax * sizeof(int); if (orientflag) bytes = nmax*orientflag * sizeof(double); if (dorientflag) bytes = nmax*3 * sizeof(double); } diff --git a/src/RIGID/fix_rigid_small.cpp b/src/RIGID/fix_rigid_small.cpp index 1b022f35c4..6a26de6083 100644 --- a/src/RIGID/fix_rigid_small.cpp +++ b/src/RIGID/fix_rigid_small.cpp @@ -3568,15 +3568,15 @@ double FixRigidSmall::memory_usage() { int nmax = atom->nmax; double bytes = nmax*2 * sizeof(int); - bytes += nmax * sizeof(imageint); - bytes += nmax*3 * sizeof(double); - bytes += maxvatom*6 * sizeof(double); // vatom + bytes += (double)nmax * sizeof(imageint); + bytes += (double)nmax*3 * sizeof(double); + bytes += (double)maxvatom*6 * sizeof(double); // vatom if (extended) { - bytes += nmax * sizeof(int); + bytes += (double)nmax * sizeof(int); if (orientflag) bytes = nmax*orientflag * sizeof(double); if (dorientflag) bytes = nmax*3 * sizeof(double); } - bytes += nmax_body * sizeof(Body); + bytes += (double)nmax_body * sizeof(Body); return bytes; } diff --git a/src/RIGID/fix_shake.cpp b/src/RIGID/fix_shake.cpp index 61ba36ea2b..2af6ed8440 100644 --- a/src/RIGID/fix_shake.cpp +++ b/src/RIGID/fix_shake.cpp @@ -2679,10 +2679,10 @@ double FixShake::memory_usage() { int nmax = atom->nmax; double bytes = nmax * sizeof(int); - bytes += nmax*4 * sizeof(int); - bytes += nmax*3 * sizeof(int); - bytes += nmax*3 * sizeof(double); - bytes += maxvatom*6 * sizeof(double); + bytes += (double)nmax*4 * sizeof(int); + bytes += (double)nmax*3 * sizeof(int); + bytes += (double)nmax*3 * sizeof(double); + bytes += (double)maxvatom*6 * sizeof(double); return bytes; } diff --git a/src/SNAP/compute_snap.cpp b/src/SNAP/compute_snap.cpp index eca832f665..ee37b24198 100644 --- a/src/SNAP/compute_snap.cpp +++ b/src/SNAP/compute_snap.cpp @@ -531,12 +531,12 @@ double ComputeSnap::memory_usage() double bytes = size_array_rows*size_array_cols * sizeof(double); // snap - bytes += size_array_rows*size_array_cols * + bytes += (double)size_array_rows*size_array_cols * sizeof(double); // snapall - bytes += nmax*size_peratom * sizeof(double); // snap_peratom + bytes += (double)nmax*size_peratom * sizeof(double); // snap_peratom bytes += snaptr->memory_usage(); // SNA object int n = atom->ntypes+1; - bytes += n*sizeof(int); // map + bytes += (double)n*sizeof(int); // map return bytes; } diff --git a/src/SNAP/pair_snap.cpp b/src/SNAP/pair_snap.cpp index 9be8638db0..8673dd09af 100644 --- a/src/SNAP/pair_snap.cpp +++ b/src/SNAP/pair_snap.cpp @@ -747,11 +747,11 @@ double PairSNAP::memory_usage() double bytes = Pair::memory_usage(); int n = atom->ntypes+1; - bytes += n*n*sizeof(int); // setflag - bytes += n*n*sizeof(double); // cutsq - bytes += n*sizeof(int); // map - bytes += beta_max*ncoeff*sizeof(double); // bispectrum - bytes += beta_max*ncoeff*sizeof(double); // beta + bytes += (double)n*n*sizeof(int); // setflag + bytes += (double)n*n*sizeof(double); // cutsq + bytes += (double)n*sizeof(int); // map + bytes += (double)beta_max*ncoeff*sizeof(double); // bispectrum + bytes += (double)beta_max*ncoeff*sizeof(double); // beta bytes += snaptr->memory_usage(); // SNA object diff --git a/src/SNAP/sna.cpp b/src/SNAP/sna.cpp index d2b423d5db..5568dd002e 100644 --- a/src/SNAP/sna.cpp +++ b/src/SNAP/sna.cpp @@ -1282,33 +1282,33 @@ double SNA::memory_usage() bytes = 0; - bytes += jdimpq*jdimpq * sizeof(double); // pqarray - bytes += idxcg_max * sizeof(double); // cglist + bytes += (double)jdimpq*jdimpq * sizeof(double); // pqarray + bytes += (double)idxcg_max * sizeof(double); // cglist - bytes += nmax * idxu_max * sizeof(double) * 2; // ulist_ij - bytes += idxu_max * nelements * sizeof(double) * 2; // ulisttot - bytes += idxu_max * 3 * sizeof(double) * 2; // dulist + bytes += (double)nmax * idxu_max * sizeof(double) * 2; // ulist_ij + bytes += (double)idxu_max * nelements * sizeof(double) * 2; // ulisttot + bytes += (double)idxu_max * 3 * sizeof(double) * 2; // dulist - bytes += idxz_max * ndoubles * sizeof(double) * 2; // zlist - bytes += idxb_max * ntriples * sizeof(double); // blist - bytes += idxb_max * ntriples * 3 * sizeof(double); // dblist - bytes += idxu_max * nelements * sizeof(double) * 2; // ylist + bytes += (double)idxz_max * ndoubles * sizeof(double) * 2; // zlist + bytes += (double)idxb_max * ntriples * sizeof(double); // blist + bytes += (double)idxb_max * ntriples * 3 * sizeof(double); // dblist + bytes += (double)idxu_max * nelements * sizeof(double) * 2; // ylist - bytes += jdim * jdim * jdim * sizeof(int); // idxcg_block - bytes += jdim * sizeof(int); // idxu_block - bytes += jdim * jdim * jdim * sizeof(int); // idxz_block - bytes += jdim * jdim * jdim * sizeof(int); // idxb_block + bytes += (double)jdim * jdim * jdim * sizeof(int); // idxcg_block + bytes += (double)jdim * sizeof(int); // idxu_block + bytes += (double)jdim * jdim * jdim * sizeof(int); // idxz_block + bytes += (double)jdim * jdim * jdim * sizeof(int); // idxb_block - bytes += idxz_max * sizeof(SNA_ZINDICES); // idxz - bytes += idxb_max * sizeof(SNA_BINDICES); // idxb + bytes += (double)idxz_max * sizeof(SNA_ZINDICES); // idxz + bytes += (double)idxb_max * sizeof(SNA_BINDICES); // idxb if (bzero_flag) - bytes += jdim * sizeof(double); // bzero + bytes += (double)jdim * sizeof(double); // bzero - bytes += nmax * 3 * sizeof(double); // rij - bytes += nmax * sizeof(int); // inside - bytes += nmax * sizeof(double); // wj - bytes += nmax * sizeof(double); // rcutij + bytes += (double)nmax * 3 * sizeof(double); // rij + bytes += (double)nmax * sizeof(int); // inside + bytes += (double)nmax * sizeof(double); // wj + bytes += (double)nmax * sizeof(double); // rcutij return bytes; } diff --git a/src/SRD/fix_srd.cpp b/src/SRD/fix_srd.cpp index d8c5ef2cee..1ba6e4a03f 100644 --- a/src/SRD/fix_srd.cpp +++ b/src/SRD/fix_srd.cpp @@ -3979,13 +3979,13 @@ void FixSRD::triside(double t, double &f, double &df) double FixSRD::memory_usage() { double bytes = 0.0; - bytes += (shifts[0].nbins + shifts[1].nbins) * sizeof(BinAve); - bytes += nmax * sizeof(int); + bytes += (double)(shifts[0].nbins + shifts[1].nbins) * sizeof(BinAve); + bytes += (double)nmax * sizeof(int); if (bigexist) { - bytes += nbins2 * sizeof(int); - bytes += nbins2*ATOMPERBIN * sizeof(int); + bytes += (double)nbins2 * sizeof(int); + bytes += (double)nbins2*ATOMPERBIN * sizeof(int); } - bytes += nmax * sizeof(int); + bytes += (double)nmax * sizeof(int); return bytes; } diff --git a/src/USER-AWPMD/pair_awpmd_cut.cpp b/src/USER-AWPMD/pair_awpmd_cut.cpp index 19bb06ad87..b46bf75181 100644 --- a/src/USER-AWPMD/pair_awpmd_cut.cpp +++ b/src/USER-AWPMD/pair_awpmd_cut.cpp @@ -735,7 +735,7 @@ void PairAWPMDCut::min_x_set(int /* ignore */) double PairAWPMDCut::memory_usage() { double bytes = maxeatom * sizeof(double); - bytes += maxvatom*6 * sizeof(double); - bytes += 2 * nmax * sizeof(double); + bytes += (double)maxvatom*6 * sizeof(double); + bytes += (double)2 * nmax * sizeof(double); return bytes; } diff --git a/src/USER-CGSDK/pair_lj_sdk.cpp b/src/USER-CGSDK/pair_lj_sdk.cpp index beac894cc8..fd9e13fecf 100644 --- a/src/USER-CGSDK/pair_lj_sdk.cpp +++ b/src/USER-CGSDK/pair_lj_sdk.cpp @@ -495,9 +495,9 @@ double PairLJSDK::memory_usage() int n = atom->ntypes; // setflag/lj_type - bytes += 2 * (n+1)*(n+1)*sizeof(int); + bytes += (double)2 * (n+1)*(n+1)*sizeof(int); // cut/cutsq/epsilon/sigma/offset/lj1/lj2/lj3/lj4/rminsq/emin - bytes += 11 * (n+1)*(n+1)*sizeof(double); + bytes += (double)11 * (n+1)*(n+1)*sizeof(double); return bytes; } diff --git a/src/USER-CGSDK/pair_lj_sdk_coul_long.cpp b/src/USER-CGSDK/pair_lj_sdk_coul_long.cpp index 7136aa381f..293a4b1b9c 100644 --- a/src/USER-CGSDK/pair_lj_sdk_coul_long.cpp +++ b/src/USER-CGSDK/pair_lj_sdk_coul_long.cpp @@ -654,13 +654,13 @@ double PairLJSDKCoulLong::memory_usage() int n = atom->ntypes; // setflag/lj_type - bytes += 2 * (n+1)*(n+1)*sizeof(int); + bytes += (double)2 * (n+1)*(n+1)*sizeof(int); // lj_cut/lj_cutsq/epsilon/sigma/offset/lj1/lj2/lj3/lj4/rminsq/emin - bytes += 11 * (n+1)*(n+1)*sizeof(double); + bytes += (double)11 * (n+1)*(n+1)*sizeof(double); if (ncoultablebits) { int ntable = 1<nghost; // v_t0[] - bytes += sizeof(*rand_state)*maxRNG; // rand_state[] + bytes += (double)sizeof(double)*3*atom->nghost; // v_t0[] + bytes += (double)sizeof(*rand_state)*maxRNG; // rand_state[] return bytes; } diff --git a/src/USER-EFF/pair_eff_cut.cpp b/src/USER-EFF/pair_eff_cut.cpp index 63c6c6f46a..f39c1d31af 100644 --- a/src/USER-EFF/pair_eff_cut.cpp +++ b/src/USER-EFF/pair_eff_cut.cpp @@ -1079,7 +1079,7 @@ void PairEffCut::min_x_set(int /*ignore*/) double PairEffCut::memory_usage() { double bytes = maxeatom * sizeof(double); - bytes += maxvatom*6 * sizeof(double); - bytes += 2 * nmax * sizeof(double); + bytes += (double)maxvatom*6 * sizeof(double); + bytes += (double)2 * nmax * sizeof(double); return bytes; } diff --git a/src/USER-FEP/pair_lj_cut_tip4p_long_soft.cpp b/src/USER-FEP/pair_lj_cut_tip4p_long_soft.cpp index 0cc21f73a8..c06bd69c48 100644 --- a/src/USER-FEP/pair_lj_cut_tip4p_long_soft.cpp +++ b/src/USER-FEP/pair_lj_cut_tip4p_long_soft.cpp @@ -589,7 +589,7 @@ void *PairLJCutTIP4PLongSoft::extract(const char *str, int &dim) double PairLJCutTIP4PLongSoft::memory_usage() { double bytes = maxeatom * sizeof(double); - bytes += maxvatom*6 * sizeof(double); - bytes += 2 * nmax * sizeof(double); + bytes += (double)maxvatom*6 * sizeof(double); + bytes += (double)2 * nmax * sizeof(double); return bytes; } diff --git a/src/USER-FEP/pair_tip4p_long_soft.cpp b/src/USER-FEP/pair_tip4p_long_soft.cpp index 216276ebf1..47b9fe0a93 100644 --- a/src/USER-FEP/pair_tip4p_long_soft.cpp +++ b/src/USER-FEP/pair_tip4p_long_soft.cpp @@ -511,7 +511,7 @@ void *PairTIP4PLongSoft::extract(const char *str, int &dim) double PairTIP4PLongSoft::memory_usage() { double bytes = maxeatom * sizeof(double); - bytes += maxvatom*6 * sizeof(double); - bytes += 2 * nmax * sizeof(double); + bytes += (double)maxvatom*6 * sizeof(double); + bytes += (double)2 * nmax * sizeof(double); return bytes; } diff --git a/src/USER-INTEL/pppm_intel.cpp b/src/USER-INTEL/pppm_intel.cpp index 6e836dd3b3..c91066e314 100644 --- a/src/USER-INTEL/pppm_intel.cpp +++ b/src/USER-INTEL/pppm_intel.cpp @@ -979,16 +979,16 @@ double PPPMIntel::memory_usage() { double bytes = PPPM::memory_usage(); if ((comm->nthreads > 1) && !_use_lrt) { - bytes += (comm->nthreads - 1) * (ngrid + INTEL_P3M_ALIGNED_MAXORDER) * + bytes += (double)(comm->nthreads - 1) * (ngrid + INTEL_P3M_ALIGNED_MAXORDER) * sizeof(FFT_SCALAR); } if (differentiation_flag == 1) { - bytes += 3 * nmax * sizeof(FFT_SCALAR); + bytes += (double)3 * nmax * sizeof(FFT_SCALAR); } if (_use_table) { - bytes += rho_points * INTEL_P3M_ALIGNED_MAXORDER * sizeof(FFT_SCALAR); + bytes += (double)rho_points * INTEL_P3M_ALIGNED_MAXORDER * sizeof(FFT_SCALAR); if (differentiation_flag == 1) { - bytes += rho_points * INTEL_P3M_ALIGNED_MAXORDER * sizeof(FFT_SCALAR); + bytes += (double)rho_points * INTEL_P3M_ALIGNED_MAXORDER * sizeof(FFT_SCALAR); } } return bytes; diff --git a/src/USER-LB/fix_lb_rigid_pc_sphere.cpp b/src/USER-LB/fix_lb_rigid_pc_sphere.cpp index 88eb54593a..b139d8e6f2 100644 --- a/src/USER-LB/fix_lb_rigid_pc_sphere.cpp +++ b/src/USER-LB/fix_lb_rigid_pc_sphere.cpp @@ -1431,8 +1431,8 @@ double FixLbRigidPCSphere::memory_usage() { int nmax = atom->nmax; double bytes = nmax * sizeof(int); - bytes += nmax*3 * sizeof(double); - bytes += maxvatom*6 * sizeof(double); + bytes += (double)nmax*3 * sizeof(double); + bytes += (double)maxvatom*6 * sizeof(double); return bytes; } diff --git a/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp b/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp index 229dfd2433..5d5bdea156 100644 --- a/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp +++ b/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp @@ -330,10 +330,10 @@ double FixNVEManifoldRattle::memory_usage() { double bytes = 0.0; - bytes += sizeof(statistics); - bytes += sizeof(*ptr_m) + sizeof(ptr_m); - bytes += nvars*sizeof(double) + sizeof(double*); - bytes += nvars*( sizeof(char*) + 3*sizeof(int) ); + bytes += (double)sizeof(statistics); + bytes += (double)sizeof(*ptr_m) + sizeof(ptr_m); + bytes += (double)nvars*sizeof(double) + sizeof(double*); + bytes += (double)nvars*( sizeof(char*) + 3*sizeof(int) ); return bytes; } diff --git a/src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp b/src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp index 9ac81aafb0..310dae8725 100644 --- a/src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp +++ b/src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp @@ -402,7 +402,7 @@ void FixNVTManifoldRattle::reset_dt() double FixNVTManifoldRattle::memory_usage() { double bytes = FixNVEManifoldRattle::memory_usage(); - bytes += (4*mtchain+1)*sizeof(double); + bytes += (double)(4*mtchain+1)*sizeof(double); return bytes; } diff --git a/src/USER-MEAMC/pair_meamc.cpp b/src/USER-MEAMC/pair_meamc.cpp index d0fb8a0463..b9738f779d 100644 --- a/src/USER-MEAMC/pair_meamc.cpp +++ b/src/USER-MEAMC/pair_meamc.cpp @@ -803,8 +803,8 @@ void PairMEAMC::unpack_reverse_comm(int n, int *list, double *buf) double PairMEAMC::memory_usage() { double bytes = 11 * meam_inst->nmax * sizeof(double); - bytes += (3 + 6 + 10 + 3 + 3 + 3) * meam_inst->nmax * sizeof(double); - bytes += 3 * meam_inst->maxneigh * sizeof(double); + bytes += (double)(3 + 6 + 10 + 3 + 3 + 3) * meam_inst->nmax * sizeof(double); + bytes += (double)3 * meam_inst->maxneigh * sizeof(double); return bytes; } diff --git a/src/USER-MISC/compute_cnp_atom.cpp b/src/USER-MISC/compute_cnp_atom.cpp index 7928599805..c927d8e520 100644 --- a/src/USER-MISC/compute_cnp_atom.cpp +++ b/src/USER-MISC/compute_cnp_atom.cpp @@ -324,7 +324,7 @@ void ComputeCNPAtom::compute_peratom() double ComputeCNPAtom::memory_usage() { double bytes = nmax * sizeof(int); - bytes += nmax * MAXNEAR * sizeof(int); - bytes += nmax * sizeof(double); + bytes += (double)nmax * MAXNEAR * sizeof(int); + bytes += (double)nmax * sizeof(double); return bytes; } diff --git a/src/USER-MISC/fix_filter_corotate.cpp b/src/USER-MISC/fix_filter_corotate.cpp index 4f1feeaa6c..38b22c1189 100644 --- a/src/USER-MISC/fix_filter_corotate.cpp +++ b/src/USER-MISC/fix_filter_corotate.cpp @@ -1810,17 +1810,17 @@ double FixFilterCorotate::memory_usage() { double bytes = 0; //GROW: - bytes += 3*sizeof(double) + 5*sizeof(tagint) + 5*sizeof(int); + bytes += (double)3*sizeof(double) + 5*sizeof(tagint) + 5*sizeof(int); //clist - bytes += 13*atom->nlocal*sizeof(int); - bytes += 15*16*nlocal*sizeof(double); + bytes += (double)13*atom->nlocal*sizeof(int); + bytes += (double)15*16*nlocal*sizeof(double); //fixed: int nb = atom->nbondtypes+1; int na = atom->nangletypes+1; int nt = atom->ntypes+1; - bytes += (nb+na+nt)*sizeof(int); - bytes += (nt-1+nb+na+15*15+18+10*15)*sizeof(double); + bytes += (double)(nb+na+nt)*sizeof(int); + bytes += (double)(nt-1+nb+na+15*15+18+10*15)*sizeof(double); return bytes; } diff --git a/src/USER-MISC/fix_orient_eco.cpp b/src/USER-MISC/fix_orient_eco.cpp index f90a1ab23e..0594e9c5b4 100644 --- a/src/USER-MISC/fix_orient_eco.cpp +++ b/src/USER-MISC/fix_orient_eco.cpp @@ -475,7 +475,7 @@ void FixOrientECO::unpack_forward_comm(int n, int first, double *buf) { double FixOrientECO::memory_usage() { double bytes = nmax * sizeof(Nbr); - bytes += 2 * nmax * sizeof(double); + bytes += (double)2 * nmax * sizeof(double); return bytes; } diff --git a/src/USER-MISC/fix_propel_self.cpp b/src/USER-MISC/fix_propel_self.cpp index 7805c4d9a7..a1e69ad179 100644 --- a/src/USER-MISC/fix_propel_self.cpp +++ b/src/USER-MISC/fix_propel_self.cpp @@ -131,7 +131,7 @@ double FixPropelSelf::memory_usage() { // magnitude + thermostat_orient + mode + n_types_filter + apply_to_type double bytes = sizeof(double) + 3*sizeof(int) + sizeof(int*); - bytes += sizeof(int)*atom->ntypes*n_types_filter; + bytes += (double)sizeof(int)*atom->ntypes*n_types_filter; return bytes; } diff --git a/src/USER-MISC/fix_ttm_mod.cpp b/src/USER-MISC/fix_ttm_mod.cpp index a776e7e1da..9cac1c02b2 100644 --- a/src/USER-MISC/fix_ttm_mod.cpp +++ b/src/USER-MISC/fix_ttm_mod.cpp @@ -886,8 +886,8 @@ void FixTTMMod::end_of_step() double FixTTMMod::memory_usage() { double bytes = 0.0; - bytes += 5*total_nnodes * sizeof(int); - bytes += 14*total_nnodes * sizeof(double); + bytes += (double)5*total_nnodes * sizeof(int); + bytes += (double)14*total_nnodes * sizeof(double); return bytes; } diff --git a/src/USER-MISC/pair_gauss_cut.cpp b/src/USER-MISC/pair_gauss_cut.cpp index 2e65640090..80101b8f97 100644 --- a/src/USER-MISC/pair_gauss_cut.cpp +++ b/src/USER-MISC/pair_gauss_cut.cpp @@ -392,8 +392,8 @@ double PairGaussCut::memory_usage() double bytes = Pair::memory_usage(); - bytes += 7*((n+1)*(n+1) * sizeof(double) + (n+1)*sizeof(double *)); - bytes += 1*((n+1)*(n+1) * sizeof(int) + (n+1)*sizeof(int *)); + bytes += (double)7*((n+1)*(n+1) * sizeof(double) + (n+1)*sizeof(double *)); + bytes += (double)1*((n+1)*(n+1) * sizeof(int) + (n+1)*sizeof(int *)); return bytes; } diff --git a/src/USER-MISC/pair_list.cpp b/src/USER-MISC/pair_list.cpp index f14fd67bf7..5b6729ff58 100644 --- a/src/USER-MISC/pair_list.cpp +++ b/src/USER-MISC/pair_list.cpp @@ -410,9 +410,9 @@ double PairList::init_one(int, int) double PairList::memory_usage() { double bytes = npairs * sizeof(int); - bytes += npairs * sizeof(list_parm_t); + bytes += (double)npairs * sizeof(list_parm_t); const int n = atom->ntypes+1; - bytes += n*(n*sizeof(int) + sizeof(int *)); - bytes += n*(n*sizeof(double) + sizeof(double *)); + bytes += (double)n*(n*sizeof(int) + sizeof(int *)); + bytes += (double)n*(n*sizeof(double) + sizeof(double *)); return bytes; } diff --git a/src/USER-MISC/pair_local_density.cpp b/src/USER-MISC/pair_local_density.cpp index dc4e694995..c85633e600 100644 --- a/src/USER-MISC/pair_local_density.cpp +++ b/src/USER-MISC/pair_local_density.cpp @@ -882,8 +882,8 @@ void PairLocalDensity::unpack_reverse_comm(int n, int *list, double *buf) { double PairLocalDensity::memory_usage() { double bytes = maxeatom * sizeof(double); - bytes += maxvatom*6 * sizeof(double); - bytes += 2 * (nmax*nLD) * sizeof(double); + bytes += (double)maxvatom*6 * sizeof(double); + bytes += (double)2 * (nmax*nLD) * sizeof(double); return bytes; } diff --git a/src/USER-MOLFILE/dump_molfile.cpp b/src/USER-MOLFILE/dump_molfile.cpp index f96807138e..9de9a79e26 100644 --- a/src/USER-MOLFILE/dump_molfile.cpp +++ b/src/USER-MOLFILE/dump_molfile.cpp @@ -456,6 +456,6 @@ double DumpMolfile::memory_usage() { double bytes = Dump::memory_usage(); bytes += memory->usage(coords,natoms*3); - bytes += sizeof(MFI); + bytes += (double)sizeof(MFI); return bytes; } diff --git a/src/USER-OMP/fix_omp.cpp b/src/USER-OMP/fix_omp.cpp index b60a8d1e32..23671f4c7e 100644 --- a/src/USER-OMP/fix_omp.cpp +++ b/src/USER-OMP/fix_omp.cpp @@ -371,8 +371,8 @@ void FixOMP::pre_force(int) double FixOMP::memory_usage() { - double bytes = _nthr * (sizeof(ThrData *) + sizeof(ThrData)); - bytes += _nthr * thr[0]->memory_usage(); + double bytes = (double)_nthr * (sizeof(ThrData *) + sizeof(ThrData)); + bytes += (double)_nthr * thr[0]->memory_usage(); return bytes; } diff --git a/src/USER-OMP/msm_cg_omp.cpp b/src/USER-OMP/msm_cg_omp.cpp index e7cfa10cd4..b3f173d550 100644 --- a/src/USER-OMP/msm_cg_omp.cpp +++ b/src/USER-OMP/msm_cg_omp.cpp @@ -564,6 +564,6 @@ void MSMCGOMP::fieldforce_peratom() double MSMCGOMP::memory_usage() { double bytes = MSM::memory_usage(); - bytes += nmax * sizeof(int); + bytes += (double)nmax * sizeof(int); return bytes; } diff --git a/src/USER-OMP/pair_adp_omp.cpp b/src/USER-OMP/pair_adp_omp.cpp index 1e0bcd214d..bd92936ecb 100644 --- a/src/USER-OMP/pair_adp_omp.cpp +++ b/src/USER-OMP/pair_adp_omp.cpp @@ -387,7 +387,7 @@ void PairADPOMP::eval(int iifrom, int iito, ThrData * const thr) double PairADPOMP::memory_usage() { double bytes = memory_usage_thr(); - bytes += PairADP::memory_usage(); - bytes += (comm->nthreads-1) * nmax * (10*sizeof(double) + 3*sizeof(double *)); + bytes += (double)PairADP::memory_usage(); + bytes += (double)(comm->nthreads-1) * nmax * (10*sizeof(double) + 3*sizeof(double *)); return bytes; } diff --git a/src/USER-OMP/pair_brownian_omp.cpp b/src/USER-OMP/pair_brownian_omp.cpp index 2841c5e840..a82b8d575c 100644 --- a/src/USER-OMP/pair_brownian_omp.cpp +++ b/src/USER-OMP/pair_brownian_omp.cpp @@ -406,8 +406,8 @@ double PairBrownianOMP::memory_usage() { double bytes = memory_usage_thr(); bytes += PairBrownian::memory_usage(); - bytes += nthreads * sizeof(RanMars*); - bytes += nthreads * sizeof(RanMars); + bytes += (double)nthreads * sizeof(RanMars*); + bytes += (double)nthreads * sizeof(RanMars); return bytes; } diff --git a/src/USER-OMP/pair_brownian_poly_omp.cpp b/src/USER-OMP/pair_brownian_poly_omp.cpp index d02d13a74e..124617afab 100644 --- a/src/USER-OMP/pair_brownian_poly_omp.cpp +++ b/src/USER-OMP/pair_brownian_poly_omp.cpp @@ -396,8 +396,8 @@ double PairBrownianPolyOMP::memory_usage() { double bytes = memory_usage_thr(); bytes += PairBrownianPoly::memory_usage(); - bytes += nthreads * sizeof(RanMars*); - bytes += nthreads * sizeof(RanMars); + bytes += (double)nthreads * sizeof(RanMars*); + bytes += (double)nthreads * sizeof(RanMars); return bytes; } diff --git a/src/USER-OMP/pair_dpd_omp.cpp b/src/USER-OMP/pair_dpd_omp.cpp index ddee900b56..97a3c5c647 100644 --- a/src/USER-OMP/pair_dpd_omp.cpp +++ b/src/USER-OMP/pair_dpd_omp.cpp @@ -220,8 +220,8 @@ double PairDPDOMP::memory_usage() { double bytes = memory_usage_thr(); bytes += PairDPD::memory_usage(); - bytes += comm->nthreads * sizeof(RanMars*); - bytes += comm->nthreads * sizeof(RanMars); + bytes += (double)comm->nthreads * sizeof(RanMars*); + bytes += (double)comm->nthreads * sizeof(RanMars); return bytes; } diff --git a/src/USER-OMP/pair_dpd_tstat_omp.cpp b/src/USER-OMP/pair_dpd_tstat_omp.cpp index 9695895ddc..5e1b145494 100644 --- a/src/USER-OMP/pair_dpd_tstat_omp.cpp +++ b/src/USER-OMP/pair_dpd_tstat_omp.cpp @@ -220,8 +220,8 @@ double PairDPDTstatOMP::memory_usage() { double bytes = memory_usage_thr(); bytes += PairDPDTstat::memory_usage(); - bytes += comm->nthreads * sizeof(RanMars*); - bytes += comm->nthreads * sizeof(RanMars); + bytes += (double)comm->nthreads * sizeof(RanMars*); + bytes += (double)comm->nthreads * sizeof(RanMars); return bytes; } diff --git a/src/USER-OMP/pair_hbond_dreiding_lj_omp.cpp b/src/USER-OMP/pair_hbond_dreiding_lj_omp.cpp index 9dceea1239..9abc0c236e 100644 --- a/src/USER-OMP/pair_hbond_dreiding_lj_omp.cpp +++ b/src/USER-OMP/pair_hbond_dreiding_lj_omp.cpp @@ -309,7 +309,7 @@ void PairHbondDreidingLJOMP::eval(int iifrom, int iito, ThrData * const thr) double PairHbondDreidingLJOMP::memory_usage() { double bytes = memory_usage_thr(); - bytes += comm->nthreads * 2 * sizeof(double); + bytes += (double)comm->nthreads * 2 * sizeof(double); bytes += PairHbondDreidingLJ::memory_usage(); return bytes; diff --git a/src/USER-OMP/pair_hbond_dreiding_morse_omp.cpp b/src/USER-OMP/pair_hbond_dreiding_morse_omp.cpp index 531131885d..1cc416219d 100644 --- a/src/USER-OMP/pair_hbond_dreiding_morse_omp.cpp +++ b/src/USER-OMP/pair_hbond_dreiding_morse_omp.cpp @@ -308,7 +308,7 @@ void PairHbondDreidingMorseOMP::eval(int iifrom, int iito, ThrData * const thr) double PairHbondDreidingMorseOMP::memory_usage() { double bytes = memory_usage_thr(); - bytes += comm->nthreads * 2 * sizeof(double); + bytes += (double)comm->nthreads * 2 * sizeof(double); bytes += PairHbondDreidingMorse::memory_usage(); return bytes; diff --git a/src/USER-OMP/thr_data.cpp b/src/USER-OMP/thr_data.cpp index 6a0ce9ba3e..2935e87d04 100644 --- a/src/USER-OMP/thr_data.cpp +++ b/src/USER-OMP/thr_data.cpp @@ -278,8 +278,8 @@ void ThrData::virial_fdotr_compute(double **x, int nlocal, int nghost, int nfirs double ThrData::memory_usage() { double bytes = (7 + 6*6) * sizeof(double); - bytes += 2 * sizeof(double*); - bytes += 4 * sizeof(int); + bytes += (double)2 * sizeof(double*); + bytes += (double)4 * sizeof(int); return bytes; } diff --git a/src/USER-PTM/compute_ptm_atom.cpp b/src/USER-PTM/compute_ptm_atom.cpp index db472aac85..593c7f9b5e 100644 --- a/src/USER-PTM/compute_ptm_atom.cpp +++ b/src/USER-PTM/compute_ptm_atom.cpp @@ -334,6 +334,6 @@ void ComputePTMAtom::compute_peratom() { double ComputePTMAtom::memory_usage() { double bytes = nmax * NUM_COLUMNS * sizeof(double); - bytes += nmax * sizeof(double); + bytes += (double)nmax * sizeof(double); return bytes; } diff --git a/src/USER-QMMM/fix_qmmm.cpp b/src/USER-QMMM/fix_qmmm.cpp index f352cce827..6689ebdb9d 100644 --- a/src/USER-QMMM/fix_qmmm.cpp +++ b/src/USER-QMMM/fix_qmmm.cpp @@ -826,8 +826,8 @@ double FixQMMM::memory_usage(void) double bytes; bytes = sizeof(FixQMMM); - bytes += maxbuf; - bytes += 6*num_qm*sizeof(double); + bytes += (double)maxbuf; + bytes += (double)6*num_qm*sizeof(double); return bytes; } diff --git a/src/USER-QTB/fix_qbmsst.cpp b/src/USER-QTB/fix_qbmsst.cpp index 2257c9992e..b1a4f39382 100644 --- a/src/USER-QTB/fix_qbmsst.cpp +++ b/src/USER-QTB/fix_qbmsst.cpp @@ -1122,10 +1122,10 @@ double FixQBMSST::memory_usage() { double bytes = 0.0; // random_arrays memory usage - bytes += (atom->nmax* 6*N_f * sizeof(double)); + bytes += (double)(atom->nmax* 6*N_f * sizeof(double)); // fran memory usage - bytes += (atom->nmax* 3 * sizeof(double)); - bytes += (4*N_f * sizeof(double)); + bytes += (double)(atom->nmax* 3 * sizeof(double)); + bytes += (double)(4*N_f * sizeof(double)); return bytes; } diff --git a/src/USER-QTB/fix_qtb.cpp b/src/USER-QTB/fix_qtb.cpp index 31f0808ca7..f97d142099 100644 --- a/src/USER-QTB/fix_qtb.cpp +++ b/src/USER-QTB/fix_qtb.cpp @@ -375,10 +375,10 @@ double FixQTB::memory_usage() { double bytes = 0.0; // random_arrays memory usage - bytes += (atom->nmax* 6*N_f * sizeof(double)); + bytes += (double)(atom->nmax* 6*N_f * sizeof(double)); // fran memory usage - bytes += (atom->nmax* 3 * sizeof(double)); - bytes += (4*N_f * sizeof(double)); + bytes += (double)(atom->nmax* 3 * sizeof(double)); + bytes += (double)(4*N_f * sizeof(double)); return bytes; } diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp index e1b7ff4fa6..f49374b0b8 100644 --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -3745,7 +3745,7 @@ double FixBondReact::memory_usage() int nmax = atom->nmax; double bytes = nmax * sizeof(int); bytes = 2*nmax * sizeof(tagint); - bytes += nmax * sizeof(double); + bytes += (double)nmax * sizeof(double); return bytes; } diff --git a/src/USER-REAXC/fix_qeq_reax.cpp b/src/USER-REAXC/fix_qeq_reax.cpp index abe6f26081..dd978c7582 100644 --- a/src/USER-REAXC/fix_qeq_reax.cpp +++ b/src/USER-REAXC/fix_qeq_reax.cpp @@ -900,13 +900,13 @@ double FixQEqReax::memory_usage() double bytes; bytes = atom->nmax*nprev*2 * sizeof(double); // s_hist & t_hist - bytes += atom->nmax*11 * sizeof(double); // storage - bytes += n_cap*2 * sizeof(int); // matrix... - bytes += m_cap * sizeof(int); - bytes += m_cap * sizeof(double); + bytes += (double)atom->nmax*11 * sizeof(double); // storage + bytes += (double)n_cap*2 * sizeof(int); // matrix... + bytes += (double)m_cap * sizeof(int); + bytes += (double)m_cap * sizeof(double); if (dual_enabled) - bytes += atom->nmax*4 * sizeof(double); // double size for q, d, r, and p + bytes += (double)atom->nmax*4 * sizeof(double); // double size for q, d, r, and p return bytes; } diff --git a/src/USER-REAXC/fix_reaxc_bonds.cpp b/src/USER-REAXC/fix_reaxc_bonds.cpp index 6d90ef5fae..0cb78521f2 100644 --- a/src/USER-REAXC/fix_reaxc_bonds.cpp +++ b/src/USER-REAXC/fix_reaxc_bonds.cpp @@ -354,9 +354,9 @@ double FixReaxCBonds::memory_usage() double bytes; bytes = 3.0*nmax*sizeof(double); - bytes += nmax*sizeof(int); - bytes += 1.0*nmax*MAXREAXBOND*sizeof(double); - bytes += 1.0*nmax*MAXREAXBOND*sizeof(int); + bytes += (double)nmax*sizeof(int); + bytes += (double)1.0*nmax*MAXREAXBOND*sizeof(double); + bytes += (double)1.0*nmax*MAXREAXBOND*sizeof(int); return bytes; } diff --git a/src/USER-REAXC/pair_reaxc.cpp b/src/USER-REAXC/pair_reaxc.cpp index bfe9330819..fe78fbbb37 100644 --- a/src/USER-REAXC/pair_reaxc.cpp +++ b/src/USER-REAXC/pair_reaxc.cpp @@ -829,25 +829,25 @@ double PairReaxC::memory_usage() double bytes = 0.0; // From pair_reax_c - bytes += 1.0 * system->N * sizeof(int); - bytes += 1.0 * system->N * sizeof(double); + bytes += (double)1.0 * system->N * sizeof(int); + bytes += (double)1.0 * system->N * sizeof(double); // From reaxc_allocate: BO - bytes += 1.0 * system->total_cap * sizeof(reax_atom); - bytes += 19.0 * system->total_cap * sizeof(double); - bytes += 3.0 * system->total_cap * sizeof(int); + bytes += (double)1.0 * system->total_cap * sizeof(reax_atom); + bytes += (double)19.0 * system->total_cap * sizeof(double); + bytes += (double)3.0 * system->total_cap * sizeof(int); // From reaxc_lists - bytes += 2.0 * lists->n * sizeof(int); - bytes += lists->num_intrs * sizeof(three_body_interaction_data); - bytes += lists->num_intrs * sizeof(bond_data); - bytes += lists->num_intrs * sizeof(dbond_data); - bytes += lists->num_intrs * sizeof(dDelta_data); - bytes += lists->num_intrs * sizeof(far_neighbor_data); - bytes += lists->num_intrs * sizeof(hbond_data); + bytes += (double)2.0 * lists->n * sizeof(int); + bytes += (double)lists->num_intrs * sizeof(three_body_interaction_data); + bytes += (double)lists->num_intrs * sizeof(bond_data); + bytes += (double)lists->num_intrs * sizeof(dbond_data); + bytes += (double)lists->num_intrs * sizeof(dDelta_data); + bytes += (double)lists->num_intrs * sizeof(far_neighbor_data); + bytes += (double)lists->num_intrs * sizeof(hbond_data); if (fixspecies_flag) - bytes += 2 * nmax * MAXSPECBOND * sizeof(double); + bytes += (double)2 * nmax * MAXSPECBOND * sizeof(double); return bytes; } diff --git a/src/USER-SCAFACOS/scafacos.cpp b/src/USER-SCAFACOS/scafacos.cpp index ab28589f20..0ce027ec1e 100644 --- a/src/USER-SCAFACOS/scafacos.cpp +++ b/src/USER-SCAFACOS/scafacos.cpp @@ -380,8 +380,8 @@ int Scafacos::modify_param(int narg, char **arg) double Scafacos::memory_usage() { double bytes = 0.0; - bytes += maxatom * sizeof(double); - bytes += 3*maxatom * sizeof(double); + bytes += (double)maxatom * sizeof(double); + bytes += (double)3*maxatom * sizeof(double); return bytes; } diff --git a/src/USER-SDPD/fix_meso_move.cpp b/src/USER-SDPD/fix_meso_move.cpp index 75a5179f8e..6721bcb70e 100644 --- a/src/USER-SDPD/fix_meso_move.cpp +++ b/src/USER-SDPD/fix_meso_move.cpp @@ -800,8 +800,8 @@ void FixMesoMove::final_integrate () { double FixMesoMove::memory_usage () { double bytes = atom->nmax*3 * sizeof(double); - if (displaceflag) bytes += atom->nmax*3 * sizeof(double); - if (velocityflag) bytes += atom->nmax*3 * sizeof(double); + if (displaceflag) bytes += (double)atom->nmax*3 * sizeof(double); + if (velocityflag) bytes += (double)atom->nmax*3 * sizeof(double); return bytes; } diff --git a/src/USER-SMD/fix_smd_tlsph_reference_configuration.cpp b/src/USER-SMD/fix_smd_tlsph_reference_configuration.cpp index 1c1fb539f3..685278d846 100644 --- a/src/USER-SMD/fix_smd_tlsph_reference_configuration.cpp +++ b/src/USER-SMD/fix_smd_tlsph_reference_configuration.cpp @@ -355,11 +355,11 @@ void FixSMD_TLSPH_ReferenceConfiguration::setup(int /*vflag*/) { double FixSMD_TLSPH_ReferenceConfiguration::memory_usage() { int nmax = atom->nmax; int bytes = nmax * sizeof(int); - bytes += nmax * maxpartner * sizeof(tagint); // partner array - bytes += nmax * maxpartner * sizeof(float); // wf_list - bytes += nmax * maxpartner * sizeof(float); // wfd_list - bytes += nmax * maxpartner * sizeof(float); // damage_per_interaction array - bytes += nmax * sizeof(int); // npartner array + bytes += (double)nmax * maxpartner * sizeof(tagint); // partner array + bytes += (double)nmax * maxpartner * sizeof(float); // wf_list + bytes += (double)nmax * maxpartner * sizeof(float); // wfd_list + bytes += (double)nmax * maxpartner * sizeof(float); // damage_per_interaction array + bytes += (double)nmax * sizeof(int); // npartner array return bytes; } diff --git a/src/USER-SMTBQ/pair_smtbq.cpp b/src/USER-SMTBQ/pair_smtbq.cpp index 2eeb6990d3..f32d2e0c98 100644 --- a/src/USER-SMTBQ/pair_smtbq.cpp +++ b/src/USER-SMTBQ/pair_smtbq.cpp @@ -3525,9 +3525,9 @@ void PairSMTBQ::reverse_int(int *tab) double PairSMTBQ::memory_usage() { double bytes = maxeatom * sizeof(double); - bytes += maxvatom*6 * sizeof(double); - bytes += nmax * sizeof(int); - bytes += MAXNEIGH * nmax * sizeof(int); + bytes += (double)maxvatom*6 * sizeof(double); + bytes += (double)nmax * sizeof(int); + bytes += (double)MAXNEIGH * nmax * sizeof(int); return bytes; } diff --git a/src/VORONOI/compute_voronoi_atom.cpp b/src/VORONOI/compute_voronoi_atom.cpp index 2c3dac06f8..63158d4a6b 100644 --- a/src/VORONOI/compute_voronoi_atom.cpp +++ b/src/VORONOI/compute_voronoi_atom.cpp @@ -616,7 +616,7 @@ double ComputeVoronoi::memory_usage() { double bytes = size_peratom_cols * nmax * sizeof(double); // estimate based on average coordination of 12 - if (faces_flag) bytes += 12 * size_local_cols * nmax * sizeof(double); + if (faces_flag) bytes += (double)12 * size_local_cols * nmax * sizeof(double); return bytes; } diff --git a/src/angle.cpp b/src/angle.cpp index 110719d432..17ece68755 100644 --- a/src/angle.cpp +++ b/src/angle.cpp @@ -351,7 +351,7 @@ void Angle::ev_tally(int i, int j, int k, int nlocal, int newton_bond, double Angle::memory_usage() { double bytes = comm->nthreads*maxeatom * sizeof(double); - bytes += comm->nthreads*maxvatom*6 * sizeof(double); - bytes += comm->nthreads*maxcvatom*9 * sizeof(double); + bytes += (double)comm->nthreads*maxvatom*6 * sizeof(double); + bytes += (double)comm->nthreads*maxcvatom*9 * sizeof(double); return bytes; } diff --git a/src/angle_hybrid.cpp b/src/angle_hybrid.cpp index 94b941c234..98d9bb9762 100644 --- a/src/angle_hybrid.cpp +++ b/src/angle_hybrid.cpp @@ -392,9 +392,9 @@ double AngleHybrid::single(int type, int i1, int i2, int i3) double AngleHybrid::memory_usage() { double bytes = maxeatom * sizeof(double); - bytes += maxvatom*6 * sizeof(double); - bytes += maxcvatom*9 * sizeof(double); - for (int m = 0; m < nstyles; m++) bytes += maxangle[m]*4 * sizeof(int); + bytes += (double)maxvatom*6 * sizeof(double); + bytes += (double)maxcvatom*9 * sizeof(double); + for (int m = 0; m < nstyles; m++) bytes += (double)maxangle[m]*4 * sizeof(int); for (int m = 0; m < nstyles; m++) if (styles[m]) bytes += styles[m]->memory_usage(); return bytes; diff --git a/src/atom.cpp b/src/atom.cpp index daead53a83..3308d07267 100644 --- a/src/atom.cpp +++ b/src/atom.cpp @@ -2700,12 +2700,12 @@ double Atom::memory_usage() { double bytes = avec->memory_usage(); - bytes += max_same*sizeof(int); + bytes += (double)max_same*sizeof(int); if (map_style == MAP_ARRAY) bytes += memory->usage(map_array,map_maxarray); else if (map_style == MAP_HASH) { - bytes += map_nbucket*sizeof(int); - bytes += map_nhash*sizeof(HashElem); + bytes += (double)map_nbucket*sizeof(int); + bytes += (double)map_nhash*sizeof(HashElem); } if (maxnext) { bytes += memory->usage(next,maxnext); diff --git a/src/atom_vec_body.cpp b/src/atom_vec_body.cpp index 0310e10540..533d7975c1 100644 --- a/src/atom_vec_body.cpp +++ b/src/atom_vec_body.cpp @@ -554,14 +554,14 @@ void AtomVecBody::data_body(int m, int ninteger, int ndouble, double AtomVecBody::memory_usage_bonus() { double bytes = 0; - bytes += nmax_bonus*sizeof(Bonus); + bytes += (double)nmax_bonus*sizeof(Bonus); bytes += icp->size() + dcp->size(); int nall = nlocal_bonus + nghost_bonus; for (int i = 0; i < nall; i++) { if (body[i] >= 0) { - bytes += bonus[body[i]].ninteger * sizeof(int); - bytes += bonus[body[i]].ndouble * sizeof(double); + bytes += (double)bonus[body[i]].ninteger * sizeof(int); + bytes += (double)bonus[body[i]].ndouble * sizeof(double); } } diff --git a/src/atom_vec_line.cpp b/src/atom_vec_line.cpp index dd899fbb7e..696110ab77 100644 --- a/src/atom_vec_line.cpp +++ b/src/atom_vec_line.cpp @@ -383,7 +383,7 @@ void AtomVecLine::data_atom_bonus(int m, char **values) double AtomVecLine::memory_usage_bonus() { double bytes = 0; - bytes += nmax_bonus*sizeof(Bonus); + bytes += (double)nmax_bonus*sizeof(Bonus); return bytes; } diff --git a/src/atom_vec_tri.cpp b/src/atom_vec_tri.cpp index 77a46c2b59..e9477a7d41 100644 --- a/src/atom_vec_tri.cpp +++ b/src/atom_vec_tri.cpp @@ -605,7 +605,7 @@ void AtomVecTri::data_atom_bonus(int m, char **values) double AtomVecTri::memory_usage_bonus() { double bytes = 0; - bytes += nmax_bonus*sizeof(Bonus); + bytes += (double)nmax_bonus*sizeof(Bonus); return bytes; } diff --git a/src/bond.cpp b/src/bond.cpp index 16d3c43dea..e8d220d104 100644 --- a/src/bond.cpp +++ b/src/bond.cpp @@ -330,7 +330,7 @@ void Bond::write_file(int narg, char **arg) double Bond::memory_usage() { double bytes = comm->nthreads*maxeatom * sizeof(double); - bytes += comm->nthreads*maxvatom*6 * sizeof(double); + bytes += (double)comm->nthreads*maxvatom*6 * sizeof(double); return bytes; } diff --git a/src/bond_hybrid.cpp b/src/bond_hybrid.cpp index bcd079105f..ec275ce0a4 100644 --- a/src/bond_hybrid.cpp +++ b/src/bond_hybrid.cpp @@ -387,8 +387,8 @@ double BondHybrid::single(int type, double rsq, int i, int j, double BondHybrid::memory_usage() { double bytes = maxeatom * sizeof(double); - bytes += maxvatom*6 * sizeof(double); - for (int m = 0; m < nstyles; m++) bytes += maxbond[m]*3 * sizeof(int); + bytes += (double)maxvatom*6 * sizeof(double); + for (int m = 0; m < nstyles; m++) bytes += (double)maxbond[m]*3 * sizeof(int); for (int m = 0; m < nstyles; m++) if (styles[m]) bytes += styles[m]->memory_usage(); return bytes; diff --git a/src/comm_brick.cpp b/src/comm_brick.cpp index 1af471bf37..8983637e5a 100644 --- a/src/comm_brick.cpp +++ b/src/comm_brick.cpp @@ -1510,7 +1510,7 @@ void *CommBrick::extract(const char *str, int &dim) double CommBrick::memory_usage() { double bytes = 0; - bytes += nprocs * sizeof(int); // grid2proc + bytes += (double)nprocs * sizeof(int); // grid2proc for (int i = 0; i < nswap; i++) bytes += memory->usage(sendlist[i],maxsendlist[i]); bytes += memory->usage(buf_send,maxsend+bufextra); diff --git a/src/compute_angmom_chunk.cpp b/src/compute_angmom_chunk.cpp index 03c65deb19..d35f274d7a 100644 --- a/src/compute_angmom_chunk.cpp +++ b/src/compute_angmom_chunk.cpp @@ -251,7 +251,7 @@ void ComputeAngmomChunk::allocate() double ComputeAngmomChunk::memory_usage() { double bytes = (bigint) maxchunk * 2 * sizeof(double); - bytes += (bigint) maxchunk * 2*3 * sizeof(double); - bytes += (bigint) maxchunk * 2*3 * sizeof(double); + bytes += (double) maxchunk * 2*3 * sizeof(double); + bytes += (double) maxchunk * 2*3 * sizeof(double); return bytes; } diff --git a/src/compute_centro_atom.cpp b/src/compute_centro_atom.cpp index da5e88030e..a8669efb28 100644 --- a/src/compute_centro_atom.cpp +++ b/src/compute_centro_atom.cpp @@ -437,6 +437,6 @@ void ComputeCentroAtom::select2(int k, int n, double *arr, int *iarr) double ComputeCentroAtom::memory_usage() { double bytes = nmax * sizeof(double); - if (axes_flag) bytes += size_peratom_cols*nmax * sizeof(double); + if (axes_flag) bytes += (double)size_peratom_cols*nmax * sizeof(double); return bytes; } diff --git a/src/compute_chunk_atom.cpp b/src/compute_chunk_atom.cpp index 7f3a6b21c9..057c6f02eb 100644 --- a/src/compute_chunk_atom.cpp +++ b/src/compute_chunk_atom.cpp @@ -1991,8 +1991,8 @@ void ComputeChunkAtom::set_arrays(int i) double ComputeChunkAtom::memory_usage() { double bytes = 2*MAX(nmaxint,0) * sizeof(int); // ichunk,exclude - bytes += nmax * sizeof(double); // chunk - bytes += ncoord*nchunk * sizeof(double); // coord - if (compress) bytes += nchunk * sizeof(int); // chunkID + bytes += (double)nmax * sizeof(double); // chunk + bytes += (double)ncoord*nchunk * sizeof(double); // coord + if (compress) bytes += (double)nchunk * sizeof(int); // chunkID return bytes; } diff --git a/src/compute_cna_atom.cpp b/src/compute_cna_atom.cpp index cfc649ec0b..f629508bde 100644 --- a/src/compute_cna_atom.cpp +++ b/src/compute_cna_atom.cpp @@ -356,7 +356,7 @@ void ComputeCNAAtom::compute_peratom() double ComputeCNAAtom::memory_usage() { double bytes = nmax * sizeof(int); - bytes += nmax * MAXNEAR * sizeof(int); - bytes += nmax * sizeof(double); + bytes += (double)nmax * MAXNEAR * sizeof(int); + bytes += (double)nmax * sizeof(double); return bytes; } diff --git a/src/compute_com_chunk.cpp b/src/compute_com_chunk.cpp index 57685cf5a5..54b2354d26 100644 --- a/src/compute_com_chunk.cpp +++ b/src/compute_com_chunk.cpp @@ -239,6 +239,6 @@ void ComputeCOMChunk::allocate() double ComputeCOMChunk::memory_usage() { double bytes = (bigint) maxchunk * 2 * sizeof(double); - bytes += (bigint) maxchunk * 2*3 * sizeof(double); + bytes += (double) maxchunk * 2*3 * sizeof(double); return bytes; } diff --git a/src/compute_dipole_chunk.cpp b/src/compute_dipole_chunk.cpp index 2197c8d598..540e533727 100644 --- a/src/compute_dipole_chunk.cpp +++ b/src/compute_dipole_chunk.cpp @@ -293,7 +293,7 @@ void ComputeDipoleChunk::allocate() double ComputeDipoleChunk::memory_usage() { double bytes = (bigint) maxchunk * 2 * sizeof(double); - bytes += (bigint) maxchunk * 2*3 * sizeof(double); - bytes += (bigint) maxchunk * 2*4 * sizeof(double); + bytes += (double)maxchunk * 2*3 * sizeof(double); + bytes += (double)maxchunk * 2*4 * sizeof(double); return bytes; } diff --git a/src/compute_displace_atom.cpp b/src/compute_displace_atom.cpp index d0912df6d3..cb1bb30275 100644 --- a/src/compute_displace_atom.cpp +++ b/src/compute_displace_atom.cpp @@ -248,6 +248,6 @@ void ComputeDisplaceAtom::refresh() double ComputeDisplaceAtom::memory_usage() { double bytes = nmax*4 * sizeof(double); - bytes += nvmax * sizeof(double); + bytes += (double)nvmax * sizeof(double); return bytes; } diff --git a/src/compute_fragment_atom.cpp b/src/compute_fragment_atom.cpp index c136c1aba8..b7ed6c31d1 100644 --- a/src/compute_fragment_atom.cpp +++ b/src/compute_fragment_atom.cpp @@ -286,6 +286,6 @@ void ComputeFragmentAtom::unpack_forward_comm(int n, int first, double *buf) double ComputeFragmentAtom::memory_usage() { double bytes = nmax * sizeof(double); - bytes += 3*nmax * sizeof(int); + bytes += (double)3*nmax * sizeof(int); return bytes; } diff --git a/src/compute_global_atom.cpp b/src/compute_global_atom.cpp index 969def7b97..cc5aaf24c4 100644 --- a/src/compute_global_atom.cpp +++ b/src/compute_global_atom.cpp @@ -484,8 +484,8 @@ void ComputeGlobalAtom::compute_peratom() double ComputeGlobalAtom::memory_usage() { double bytes = nmax*nvalues * sizeof(double); - bytes += nmax * sizeof(int); // indices - if (varatom) bytes += nmax * sizeof(double); // varatom - bytes += maxvector * sizeof(double); // vecglobal + bytes += (double)nmax * sizeof(int); // indices + if (varatom) bytes += (double)nmax * sizeof(double); // varatom + bytes += (double)maxvector * sizeof(double); // vecglobal return bytes; } diff --git a/src/compute_gyration_chunk.cpp b/src/compute_gyration_chunk.cpp index 94aac64623..d2af181eaf 100644 --- a/src/compute_gyration_chunk.cpp +++ b/src/compute_gyration_chunk.cpp @@ -357,8 +357,8 @@ void ComputeGyrationChunk::allocate() double ComputeGyrationChunk::memory_usage() { double bytes = (bigint) maxchunk * 2 * sizeof(double); - bytes += (bigint) maxchunk * 2*3 * sizeof(double); - if (tensor) bytes += (bigint) maxchunk * 2*6 * sizeof(double); - else bytes += (bigint) maxchunk * 2 * sizeof(double); + bytes += (double) maxchunk * 2*3 * sizeof(double); + if (tensor) bytes += (double) maxchunk * 2*6 * sizeof(double); + else bytes += (double) maxchunk * 2 * sizeof(double); return bytes; } diff --git a/src/compute_hexorder_atom.cpp b/src/compute_hexorder_atom.cpp index aae935815c..4c50b227ab 100644 --- a/src/compute_hexorder_atom.cpp +++ b/src/compute_hexorder_atom.cpp @@ -339,8 +339,8 @@ void ComputeHexOrderAtom::select2(int k, int n, double *arr, int *iarr) double ComputeHexOrderAtom::memory_usage() { double bytes = ncol*nmax * sizeof(double); - bytes += maxneigh * sizeof(double); - bytes += maxneigh * sizeof(int); + bytes += (double)maxneigh * sizeof(double); + bytes += (double)maxneigh * sizeof(int); return bytes; } diff --git a/src/compute_inertia_chunk.cpp b/src/compute_inertia_chunk.cpp index 8c0655f916..d2c6d345ce 100644 --- a/src/compute_inertia_chunk.cpp +++ b/src/compute_inertia_chunk.cpp @@ -253,7 +253,7 @@ void ComputeInertiaChunk::allocate() double ComputeInertiaChunk::memory_usage() { double bytes = (bigint) maxchunk * 2 * sizeof(double); - bytes += (bigint) maxchunk * 2*3 * sizeof(double); - bytes += (bigint) maxchunk * 2*6 * sizeof(double); + bytes += (double) maxchunk * 2*3 * sizeof(double); + bytes += (double) maxchunk * 2*6 * sizeof(double); return bytes; } diff --git a/src/compute_msd_chunk.cpp b/src/compute_msd_chunk.cpp index e0bb54c68f..9dc3281b78 100644 --- a/src/compute_msd_chunk.cpp +++ b/src/compute_msd_chunk.cpp @@ -296,7 +296,7 @@ void ComputeMSDChunk::allocate() double ComputeMSDChunk::memory_usage() { double bytes = (bigint) nchunk * 2 * sizeof(double); - bytes += (bigint) nchunk * 2*3 * sizeof(double); - bytes += (bigint) nchunk * 4 * sizeof(double); + bytes += (double) nchunk * 2*3 * sizeof(double); + bytes += (double) nchunk * 4 * sizeof(double); return bytes; } diff --git a/src/compute_omega_chunk.cpp b/src/compute_omega_chunk.cpp index 3619040737..b721f0efb5 100644 --- a/src/compute_omega_chunk.cpp +++ b/src/compute_omega_chunk.cpp @@ -382,9 +382,9 @@ void ComputeOmegaChunk::allocate() double ComputeOmegaChunk::memory_usage() { double bytes = (bigint) maxchunk * 2 * sizeof(double); - bytes += (bigint) maxchunk * 2*3 * sizeof(double); - bytes += (bigint) maxchunk * 2*6 * sizeof(double); - bytes += (bigint) maxchunk * 2*3 * sizeof(double); - bytes += (bigint) maxchunk * 3 * sizeof(double); + bytes += (double) maxchunk * 2*3 * sizeof(double); + bytes += (double) maxchunk * 2*6 * sizeof(double); + bytes += (double) maxchunk * 2*3 * sizeof(double); + bytes += (double) maxchunk * 3 * sizeof(double); return bytes; } diff --git a/src/compute_orientorder_atom.cpp b/src/compute_orientorder_atom.cpp index db72fa3935..21baaf008a 100644 --- a/src/compute_orientorder_atom.cpp +++ b/src/compute_orientorder_atom.cpp @@ -332,8 +332,8 @@ void ComputeOrientOrderAtom::compute_peratom() double ComputeOrientOrderAtom::memory_usage() { double bytes = ncol*nmax * sizeof(double); - bytes += (qmax*(2*qmax+1)+maxneigh*4) * sizeof(double); - bytes += (nqlist+maxneigh) * sizeof(int); + bytes += (double)(qmax*(2*qmax+1)+maxneigh*4) * sizeof(double); + bytes += (double)(nqlist+maxneigh) * sizeof(int); return bytes; } diff --git a/src/compute_property_chunk.cpp b/src/compute_property_chunk.cpp index 7fe4e3a611..d1588b61a3 100644 --- a/src/compute_property_chunk.cpp +++ b/src/compute_property_chunk.cpp @@ -256,7 +256,7 @@ void ComputePropertyChunk::allocate() double ComputePropertyChunk::memory_usage() { double bytes = (bigint) nchunk * nvalues * sizeof(double); - if (countflag) bytes += (bigint) nchunk * 2 * sizeof(int); + if (countflag) bytes += (double) nchunk * 2 * sizeof(int); return bytes; } diff --git a/src/compute_property_local.cpp b/src/compute_property_local.cpp index ccc60a510d..365995f863 100644 --- a/src/compute_property_local.cpp +++ b/src/compute_property_local.cpp @@ -651,7 +651,7 @@ void ComputePropertyLocal::reallocate(int n) double ComputePropertyLocal::memory_usage() { double bytes = nmax*nvalues * sizeof(double); - bytes += nmax*2 * sizeof(int); + bytes += (double)nmax*2 * sizeof(int); return bytes; } diff --git a/src/compute_reduce_chunk.cpp b/src/compute_reduce_chunk.cpp index e41d50fa3b..a09d37b9d8 100644 --- a/src/compute_reduce_chunk.cpp +++ b/src/compute_reduce_chunk.cpp @@ -499,7 +499,7 @@ void ComputeReduceChunk::unlock(Fix *fixptr) double ComputeReduceChunk::memory_usage() { double bytes = (bigint) maxatom * sizeof(double); - if (nvalues == 1) bytes += (bigint) maxchunk * 2 * sizeof(double); - else bytes += (bigint) maxchunk * nvalues * 2 * sizeof(double); + if (nvalues == 1) bytes += (double) maxchunk * 2 * sizeof(double); + else bytes += (double) maxchunk * nvalues * 2 * sizeof(double); return bytes; } diff --git a/src/compute_temp_chunk.cpp b/src/compute_temp_chunk.cpp index 7ded525f01..765effa6c0 100644 --- a/src/compute_temp_chunk.cpp +++ b/src/compute_temp_chunk.cpp @@ -852,11 +852,11 @@ void ComputeTempChunk::allocate() double ComputeTempChunk::memory_usage() { double bytes = (bigint) maxchunk * 2 * sizeof(double); - bytes += (bigint) maxchunk * 2 * sizeof(int); - bytes += (bigint) maxchunk * nvalues * sizeof(double); + bytes += (double) maxchunk * 2 * sizeof(int); + bytes += (double) maxchunk * nvalues * sizeof(double); if (comflag || nvalues) { - bytes += (bigint) maxchunk * 2 * sizeof(double); - bytes += (bigint) maxchunk * 2*3 * sizeof(double); + bytes += (double) maxchunk * 2 * sizeof(double); + bytes += (double) maxchunk * 2*3 * sizeof(double); } return bytes; } diff --git a/src/compute_temp_profile.cpp b/src/compute_temp_profile.cpp index 2d002be17a..6f705d077f 100644 --- a/src/compute_temp_profile.cpp +++ b/src/compute_temp_profile.cpp @@ -578,6 +578,6 @@ void ComputeTempProfile::bin_assign() double ComputeTempProfile::memory_usage() { double bytes = maxatom * sizeof(int); - bytes += nbins*ncount * sizeof(double); + bytes += (double)nbins*ncount * sizeof(double); return bytes; } diff --git a/src/compute_torque_chunk.cpp b/src/compute_torque_chunk.cpp index 672c8db094..d961c914e8 100644 --- a/src/compute_torque_chunk.cpp +++ b/src/compute_torque_chunk.cpp @@ -248,7 +248,7 @@ void ComputeTorqueChunk::allocate() double ComputeTorqueChunk::memory_usage() { double bytes = (bigint) maxchunk * 2 * sizeof(double); - bytes += (bigint) maxchunk * 2*3 * sizeof(double); - bytes += (bigint) maxchunk * 2*3 * sizeof(double); + bytes += (double) maxchunk * 2*3 * sizeof(double); + bytes += (double) maxchunk * 2*3 * sizeof(double); return bytes; } diff --git a/src/compute_vcm_chunk.cpp b/src/compute_vcm_chunk.cpp index e8531584ed..182e8191cb 100644 --- a/src/compute_vcm_chunk.cpp +++ b/src/compute_vcm_chunk.cpp @@ -234,6 +234,6 @@ void ComputeVCMChunk::allocate() double ComputeVCMChunk::memory_usage() { double bytes = (bigint) maxchunk * 2 * sizeof(double); - bytes += (bigint) maxchunk * 2*3 * sizeof(double); + bytes += (double) maxchunk * 2*3 * sizeof(double); return bytes; } diff --git a/src/dihedral.cpp b/src/dihedral.cpp index 4680b6f67d..2932bcbe2f 100644 --- a/src/dihedral.cpp +++ b/src/dihedral.cpp @@ -391,7 +391,7 @@ void Dihedral::ev_tally(int i1, int i2, int i3, int i4, double Dihedral::memory_usage() { double bytes = comm->nthreads*maxeatom * sizeof(double); - bytes += comm->nthreads*maxvatom*6 * sizeof(double); - bytes += comm->nthreads*maxcvatom*9 * sizeof(double); + bytes += (double)comm->nthreads*maxvatom*6 * sizeof(double); + bytes += (double)comm->nthreads*maxcvatom*9 * sizeof(double); return bytes; } diff --git a/src/dihedral_hybrid.cpp b/src/dihedral_hybrid.cpp index f7b8502ef4..dbad92868d 100644 --- a/src/dihedral_hybrid.cpp +++ b/src/dihedral_hybrid.cpp @@ -355,9 +355,9 @@ void DihedralHybrid::read_restart(FILE *fp) double DihedralHybrid::memory_usage() { double bytes = maxeatom * sizeof(double); - bytes += maxvatom*6 * sizeof(double); - bytes += maxcvatom*9 * sizeof(double); - for (int m = 0; m < nstyles; m++) bytes += maxdihedral[m]*5 * sizeof(int); + bytes += (double)maxvatom*6 * sizeof(double); + bytes += (double)maxcvatom*9 * sizeof(double); + for (int m = 0; m < nstyles; m++) bytes += (double)maxdihedral[m]*5 * sizeof(int); for (int m = 0; m < nstyles; m++) if (styles[m]) bytes += styles[m]->memory_usage(); return bytes; diff --git a/src/dump.cpp b/src/dump.cpp index cd7366194b..ab2a84ab22 100644 --- a/src/dump.cpp +++ b/src/dump.cpp @@ -1182,11 +1182,11 @@ double Dump::memory_usage() if (sortcol == 0) bytes += memory->usage(idsort,maxsort); bytes += memory->usage(index,maxsort); bytes += memory->usage(proclist,maxproc); - if (irregular) bytes += irregular->memory_usage(); + if (irregular) bytes += (double)irregular->memory_usage(); } if (pbcflag) { - bytes += 6*maxpbc * sizeof(double); - bytes += maxpbc * sizeof(imageint); + bytes += (double)6*maxpbc * sizeof(double); + bytes += (double)maxpbc * sizeof(imageint); } return bytes; } diff --git a/src/fix_ave_chunk.cpp b/src/fix_ave_chunk.cpp index 36fcb4af4f..32cba42c9c 100644 --- a/src/fix_ave_chunk.cpp +++ b/src/fix_ave_chunk.cpp @@ -1132,9 +1132,9 @@ bigint FixAveChunk::nextvalid() double FixAveChunk::memory_usage() { double bytes = maxvar * sizeof(double); // varatom - bytes += 4*maxchunk * sizeof(double); // count one,many,sum,total - bytes += nvalues*maxchunk * sizeof(double); // values one,many,sum,total - bytes += nwindow*maxchunk * sizeof(double); // count_list - bytes += nwindow*maxchunk*nvalues * sizeof(double); // values_list + bytes += (double)4*maxchunk * sizeof(double); // count one,many,sum,total + bytes += (double)nvalues*maxchunk * sizeof(double); // values one,many,sum,total + bytes += (double)nwindow*maxchunk * sizeof(double); // count_list + bytes += (double)nwindow*maxchunk*nvalues * sizeof(double); // values_list return bytes; } diff --git a/src/fix_langevin.cpp b/src/fix_langevin.cpp index 8bc2aa3976..51a40ef9d2 100644 --- a/src/fix_langevin.cpp +++ b/src/fix_langevin.cpp @@ -1114,9 +1114,9 @@ void *FixLangevin::extract(const char *str, int &dim) double FixLangevin::memory_usage() { double bytes = 0.0; - if (gjfflag) bytes += atom->nmax*6 * sizeof(double); - if (tallyflag || osflag) bytes += atom->nmax*3 * sizeof(double); - if (tforce) bytes += atom->nmax * sizeof(double); + if (gjfflag) bytes += (double)atom->nmax*6 * sizeof(double); + if (tallyflag || osflag) bytes += (double)atom->nmax*3 * sizeof(double); + if (tforce) bytes += (double)atom->nmax * sizeof(double); return bytes; } diff --git a/src/fix_minimize.cpp b/src/fix_minimize.cpp index 7e618be566..8aefe5ef5d 100644 --- a/src/fix_minimize.cpp +++ b/src/fix_minimize.cpp @@ -166,7 +166,7 @@ double FixMinimize::memory_usage() { double bytes = 0.0; for (int m = 0; m < nvector; m++) - bytes += atom->nmax*peratom[m]*sizeof(double); + bytes += (double)atom->nmax*peratom[m]*sizeof(double); return bytes; } diff --git a/src/fix_move.cpp b/src/fix_move.cpp index e3813d0a91..abea871935 100644 --- a/src/fix_move.cpp +++ b/src/fix_move.cpp @@ -965,10 +965,10 @@ void FixMove::final_integrate_respa(int ilevel, int /*iloop*/) double FixMove::memory_usage() { double bytes = atom->nmax*3 * sizeof(double); - if (theta_flag) bytes += atom->nmax * sizeof(double); - if (quat_flag) bytes += atom->nmax*4 * sizeof(double); - if (displaceflag) bytes += atom->nmax*3 * sizeof(double); - if (velocityflag) bytes += atom->nmax*3 * sizeof(double); + if (theta_flag) bytes += (double)atom->nmax * sizeof(double); + if (quat_flag) bytes += (double)atom->nmax*4 * sizeof(double); + if (displaceflag) bytes += (double)atom->nmax*3 * sizeof(double); + if (velocityflag) bytes += (double)atom->nmax*3 * sizeof(double); return bytes; } diff --git a/src/fix_neigh_history.cpp b/src/fix_neigh_history.cpp index 83ef0666c2..2098382161 100644 --- a/src/fix_neigh_history.cpp +++ b/src/fix_neigh_history.cpp @@ -673,10 +673,10 @@ double FixNeighHistory::memory_usage() { int nmax = atom->nmax; double bytes = nmax * sizeof(int); // npartner - bytes += nmax * sizeof(tagint *); // partner - bytes += nmax * sizeof(double *); // valuepartner - bytes += maxatom * sizeof(int *); // firstflag - bytes += maxatom * sizeof(double *); // firstvalue + bytes += (double)nmax * sizeof(tagint *); // partner + bytes += (double)nmax * sizeof(double *); // valuepartner + bytes += (double)maxatom * sizeof(int *); // firstflag + bytes += (double)maxatom * sizeof(double *); // firstvalue int nmypage = comm->nthreads; for (int i = 0; i < nmypage; i++) { diff --git a/src/fix_numdiff.cpp b/src/fix_numdiff.cpp index d2f70712ac..4be6d07d3d 100644 --- a/src/fix_numdiff.cpp +++ b/src/fix_numdiff.cpp @@ -339,6 +339,6 @@ void FixNumDiff::reallocate() double FixNumDiff::memory_usage() { double bytes = 0.0; - bytes += 3 * maxatom*3 * sizeof(double); + bytes += (double)3 * maxatom*3 * sizeof(double); return bytes; } diff --git a/src/fix_read_restart.cpp b/src/fix_read_restart.cpp index 04229d601f..7ff816ea37 100644 --- a/src/fix_read_restart.cpp +++ b/src/fix_read_restart.cpp @@ -77,7 +77,7 @@ int FixReadRestart::setmask() double FixReadRestart::memory_usage() { double bytes = atom->nmax*nextra * sizeof(double); - bytes += atom->nmax * sizeof(int); + bytes += (double)atom->nmax * sizeof(int); return bytes; } diff --git a/src/fix_respa.cpp b/src/fix_respa.cpp index 81f4acd100..f2dc7d69d3 100644 --- a/src/fix_respa.cpp +++ b/src/fix_respa.cpp @@ -75,7 +75,7 @@ int FixRespa::setmask() double FixRespa::memory_usage() { double bytes = atom->nmax*nlevels*3 * sizeof(double); - if (store_torque) bytes += atom->nmax*nlevels*3 * sizeof(double); + if (store_torque) bytes += (double)atom->nmax*nlevels*3 * sizeof(double); return bytes; } diff --git a/src/fix_store.cpp b/src/fix_store.cpp index 1fa2c637b7..9df9fcd3bd 100644 --- a/src/fix_store.cpp +++ b/src/fix_store.cpp @@ -340,7 +340,7 @@ int FixStore::size_restart(int /*nlocal*/) double FixStore::memory_usage() { double bytes = 0.0; - if (flavor == GLOBAL) bytes += nrow*ncol * sizeof(double); - if (flavor == PERATOM) bytes += atom->nmax*nvalues * sizeof(double); + if (flavor == GLOBAL) bytes += (double)nrow*ncol * sizeof(double); + if (flavor == PERATOM) bytes += (double)atom->nmax*nvalues * sizeof(double); return bytes; } diff --git a/src/force.cpp b/src/force.cpp index 1f03206f31..0073366c27 100644 --- a/src/force.cpp +++ b/src/force.cpp @@ -849,11 +849,11 @@ void Force::set_special(int narg, char **arg) double Force::memory_usage() { double bytes = 0; - if (pair) bytes += static_cast (pair->memory_usage()); - if (bond) bytes += static_cast (bond->memory_usage()); - if (angle) bytes += static_cast (angle->memory_usage()); - if (dihedral) bytes += static_cast (dihedral->memory_usage()); - if (improper) bytes += static_cast (improper->memory_usage()); - if (kspace) bytes += static_cast (kspace->memory_usage()); + if (pair) bytes += pair->memory_usage(); + if (bond) bytes += bond->memory_usage(); + if (angle) bytes += angle->memory_usage(); + if (dihedral) bytes += dihedral->memory_usage(); + if (improper) bytes += improper->memory_usage(); + if (kspace) bytes += kspace->memory_usage(); return bytes; } diff --git a/src/improper.cpp b/src/improper.cpp index 6e0f829733..8e24c98116 100644 --- a/src/improper.cpp +++ b/src/improper.cpp @@ -389,6 +389,6 @@ void Improper::ev_tally(int i1, int i2, int i3, int i4, double Improper::memory_usage() { double bytes = comm->nthreads*maxeatom * sizeof(double); - bytes += comm->nthreads*maxvatom*6 * sizeof(double); + bytes += (double)comm->nthreads*maxvatom*6 * sizeof(double); return bytes; } diff --git a/src/improper_hybrid.cpp b/src/improper_hybrid.cpp index 9dec9ae363..66ec692d4b 100644 --- a/src/improper_hybrid.cpp +++ b/src/improper_hybrid.cpp @@ -351,9 +351,9 @@ void ImproperHybrid::read_restart(FILE *fp) double ImproperHybrid::memory_usage() { double bytes = maxeatom * sizeof(double); - bytes += maxvatom*6 * sizeof(double); - bytes += maxcvatom*9 * sizeof(double); - for (int m = 0; m < nstyles; m++) bytes += maximproper[m]*5 * sizeof(int); + bytes += (double)maxvatom*6 * sizeof(double); + bytes += (double)maxcvatom*9 * sizeof(double); + for (int m = 0; m < nstyles; m++) bytes += (double)maximproper[m]*5 * sizeof(int); for (int m = 0; m < nstyles; m++) if (styles[m]) bytes += styles[m]->memory_usage(); return bytes; diff --git a/src/irregular.cpp b/src/irregular.cpp index 548b0e4097..330a96f514 100644 --- a/src/irregular.cpp +++ b/src/irregular.cpp @@ -1054,11 +1054,11 @@ void Irregular::grow_recv(int n) double Irregular::memory_usage() { double bytes = 0; - bytes += maxsend*sizeof(double); // buf_send - bytes += maxrecv*sizeof(double); // buf_recv - bytes += maxdbuf*sizeof(double); // dbuf - bytes += maxbuf; // buf - bytes += 2*maxlocal*sizeof(int); // mproclist,msizes - bytes += 2*nprocs*sizeof(int); // work1,work2 + bytes += (double)maxsend*sizeof(double); // buf_send + bytes += (double)maxrecv*sizeof(double); // buf_recv + bytes += (double)maxdbuf*sizeof(double); // dbuf + bytes += (double)maxbuf; // buf + bytes += (double)2*maxlocal*sizeof(int); // mproclist,msizes + bytes += (double)2*nprocs*sizeof(int); // work1,work2 return bytes; } diff --git a/src/lammps.cpp b/src/lammps.cpp index 69baec5557..0b38f09ef5 100644 --- a/src/lammps.cpp +++ b/src/lammps.cpp @@ -129,13 +129,13 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : init_pkg_lists(); - // check if -mpi is first arg + // check if -mpicolor is first arg // if so, then 2 apps were launched with one mpirun command // this means passed communicator (e.g. MPI_COMM_WORLD) is bigger than LAMMPS // e.g. for client/server coupling with another code // in the future LAMMPS might leverage this in other ways // universe communicator needs to shrink to be just LAMMPS - // syntax: -mpi color + // syntax: -mpicolor color // color = integer for this app, different than other app(s) // do the following: // perform an MPI_Comm_split() to create a new LAMMPS-only subcomm @@ -145,7 +145,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : // cscomm is used by CSLIB package to exchange messages w/ other app int iarg = 1; - if (narg-iarg >= 2 && (strcmp(arg[iarg],"-mpi") == 0 || + if (narg-iarg >= 2 && (strcmp(arg[iarg],"-mpicolor") == 0 || strcmp(arg[iarg],"-m") == 0)) { int me,nprocs; MPI_Comm_rank(communicator,&me); diff --git a/src/library.cpp b/src/library.cpp index 557d746226..71bf205d90 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -2693,7 +2693,7 @@ void lammps_gather(void *handle, char *name, int type, int count, void *data) void *vptr = lmp->atom->extract(name); - if (vptr==nullptr && strstr(name,"f_") == name) { // fix + if (vptr==nullptr && utils::strmatch(name,"^f_")) { // fix fcid = lmp->modify->find_fix(&name[2]); if (fcid < 0) { @@ -2726,7 +2726,7 @@ void lammps_gather(void *handle, char *name, int type, int count, void *data) else vptr = (void *) lmp->modify->fix[fcid]->array_atom; } - if (vptr==nullptr && strstr(name,"c_") == name) { // compute + if (vptr==nullptr && utils::strmatch(name,"^c_")) { // compute fcid = lmp->modify->find_compute(&name[2]); if (fcid < 0) { @@ -2756,9 +2756,10 @@ void lammps_gather(void *handle, char *name, int type, int count, void *data) } + // property / atom - if ( (vptr == nullptr) && ((strstr(name,"d_") == name) - || (strstr(name,"i_") == name))) { + + if ((vptr == nullptr) && (utils::strmatch(name,"^[di]_"))) { fcid = lmp->atom->find_custom(&name[2], ltype); if (fcid < 0) { if (lmp->comm->me == 0) @@ -2912,7 +2913,7 @@ void lammps_gather_concat(void *handle, char *name, int type, int count, void *d void *vptr = lmp->atom->extract(name); - if (vptr==nullptr && strstr(name,"f_") == name) { // fix + if (vptr==nullptr && utils::strmatch(name,"^f_")) { // fix fcid = lmp->modify->find_fix(&name[2]); if (fcid < 0) { @@ -2946,7 +2947,7 @@ void lammps_gather_concat(void *handle, char *name, int type, int count, void *d else vptr = (void *) lmp->modify->fix[fcid]->array_atom; } - if (vptr==nullptr && strstr(name,"c_") == name) { // compute + if (vptr==nullptr && utils::strmatch(name,"^c_")) { // compute fcid = lmp->modify->find_compute(&name[2]); if (fcid < 0) { @@ -2977,7 +2978,7 @@ void lammps_gather_concat(void *handle, char *name, int type, int count, void *d } - if (vptr==nullptr && strstr(name,"d_") == name) { // property / atom + if (vptr==nullptr && utils::strmatch(name,"^[di]_")) { // property / atom fcid = lmp->atom->find_custom(&name[2], ltype); if (fcid < 0) { @@ -3154,7 +3155,7 @@ void lammps_gather_subset(void *handle, char *name, void *vptr = lmp->atom->extract(name); - if (vptr==nullptr && strstr(name,"f_") == name) { // fix + if (vptr==nullptr && utils::strmatch(name,"^f_")) { // fix fcid = lmp->modify->find_fix(&name[2]); if (fcid < 0) { @@ -3187,7 +3188,7 @@ void lammps_gather_subset(void *handle, char *name, else vptr = (void *) lmp->modify->fix[fcid]->array_atom; } - if (vptr==nullptr && strstr(name,"c_") == name) { // compute + if (vptr==nullptr && utils::strmatch(name,"^c_")) { // compute fcid = lmp->modify->find_compute(&name[2]); if (fcid < 0) { @@ -3218,7 +3219,7 @@ void lammps_gather_subset(void *handle, char *name, } - if (vptr==nullptr && strstr(name,"d_") == name) { // property / atom + if (vptr==nullptr && utils::strmatch(name,"^[di]_")) { // property / atom fcid = lmp->atom->find_custom(&name[2], ltype); if (fcid < 0) { @@ -3392,7 +3393,7 @@ void lammps_scatter(void *handle, char *name, int type, int count, void *data) void *vptr = lmp->atom->extract(name); - if (vptr==nullptr && strstr(name,"f_") == name) { // fix + if (vptr==nullptr && utils::strmatch(name,"^f_")) { // fix fcid = lmp->modify->find_fix(&name[2]); if (fcid < 0) { @@ -3418,7 +3419,7 @@ void lammps_scatter(void *handle, char *name, int type, int count, void *data) else vptr = (void *) lmp->modify->fix[fcid]->array_atom; } - if (vptr==nullptr && strstr(name,"c_") == name) { // compute + if (vptr==nullptr && utils::strmatch(name,"^c_")) { // compute fcid = lmp->modify->find_compute(&name[2]); if (fcid < 0) { @@ -3449,7 +3450,7 @@ void lammps_scatter(void *handle, char *name, int type, int count, void *data) } - if (vptr==nullptr && strstr(name,"d_") == name) { // property / atom + if (vptr==nullptr && utils::strmatch(name,"^[di]_")) { // property / atom fcid = lmp->atom->find_custom(&name[2], ltype); if (fcid < 0) { @@ -3590,7 +3591,7 @@ void lammps_scatter_subset(void *handle, char *name,int type, int count, void *vptr = lmp->atom->extract(name); - if (vptr==nullptr && strstr(name,"f_") == name) { // fix + if (vptr==nullptr && utils::strmatch(name,"^f_")) { // fix fcid = lmp->modify->find_fix(&name[2]); if (fcid < 0) { @@ -3616,7 +3617,7 @@ void lammps_scatter_subset(void *handle, char *name,int type, int count, else vptr = (void *) lmp->modify->fix[fcid]->array_atom; } - if (vptr==nullptr && strstr(name,"c_") == name) { // compute + if (vptr==nullptr && utils::strmatch(name,"^c_")) { // compute fcid = lmp->modify->find_compute(&name[2]); if (fcid < 0) { @@ -3645,7 +3646,7 @@ void lammps_scatter_subset(void *handle, char *name,int type, int count, else vptr = (void *) lmp->modify->compute[fcid]->array_atom; } - if (vptr==nullptr && strstr(name,"d_") == name) { // property / atom + if (vptr==nullptr && utils::strmatch(name,"^[di]_")) { // property / atom fcid = lmp->atom->find_custom(&name[2], ltype); if (fcid < 0) { diff --git a/src/modify.cpp b/src/modify.cpp index eab2d82fcf..b74b48dbad 100644 --- a/src/modify.cpp +++ b/src/modify.cpp @@ -1697,8 +1697,8 @@ double Modify::memory_usage() { double bytes = 0; for (int i = 0; i < nfix; i++) - bytes += static_cast (fix[i]->memory_usage()); + bytes += fix[i]->memory_usage(); for (int i = 0; i < ncompute; i++) - bytes += static_cast (compute[i]->memory_usage()); + bytes += compute[i]->memory_usage(); return bytes; } diff --git a/src/my_pool_chunk.cpp b/src/my_pool_chunk.cpp index 4d0713991c..c58bb5c209 100644 --- a/src/my_pool_chunk.cpp +++ b/src/my_pool_chunk.cpp @@ -212,10 +212,10 @@ void MyPoolChunk::allocate(int ibin) { template double MyPoolChunk::size() const { double bytes = npage*chunkperpage*sizeof(int); - bytes += npage*sizeof(T *); - bytes += npage*sizeof(int); + bytes += (double)npage*sizeof(T *); + bytes += (double)npage*sizeof(int); for (int i=0; i < npage; ++i) - bytes += chunkperpage*chunksize[i]*sizeof(T); + bytes += (double)chunkperpage*chunksize[i]*sizeof(T); return bytes; } diff --git a/src/nbin.cpp b/src/nbin.cpp index 8f9b1c9f1c..e2024b81f8 100644 --- a/src/nbin.cpp +++ b/src/nbin.cpp @@ -156,7 +156,7 @@ int NBin::coord2bin(double *x) double NBin::memory_usage() { double bytes = 0; - bytes += maxbin*sizeof(int); - bytes += 2*maxatom*sizeof(int); + bytes += (double)maxbin*sizeof(int); + bytes += (double)2*maxatom*sizeof(int); return bytes; } diff --git a/src/neigh_list.cpp b/src/neigh_list.cpp index cc1ecdd0bd..308ecbbf6e 100644 --- a/src/neigh_list.cpp +++ b/src/neigh_list.cpp @@ -299,7 +299,7 @@ double NeighList::memory_usage() double bytes = 0; bytes += memory->usage(ilist,maxatom); bytes += memory->usage(numneigh,maxatom); - bytes += maxatom * sizeof(int *); + bytes += (double)maxatom * sizeof(int *); int nmypage = comm->nthreads; @@ -311,7 +311,7 @@ double NeighList::memory_usage() if (respainner) { bytes += memory->usage(ilist_inner,maxatom); bytes += memory->usage(numneigh_inner,maxatom); - bytes += maxatom * sizeof(int *); + bytes += (double)maxatom * sizeof(int *); if (ipage_inner) { for (int i = 0; i < nmypage; i++) bytes += ipage_inner[i].size(); @@ -321,7 +321,7 @@ double NeighList::memory_usage() if (respamiddle) { bytes += memory->usage(ilist_middle,maxatom); bytes += memory->usage(numneigh_middle,maxatom); - bytes += maxatom * sizeof(int *); + bytes += (double)maxatom * sizeof(int *); if (ipage_middle) { for (int i = 0; i < nmypage; i++) bytes += ipage_middle[i].size(); diff --git a/src/nstencil.cpp b/src/nstencil.cpp index bcfc0d4d9b..90de8dcf3c 100644 --- a/src/nstencil.cpp +++ b/src/nstencil.cpp @@ -229,8 +229,8 @@ double NStencil::memory_usage() bytes += memory->usage(stencil,maxstencil); bytes += memory->usage(stencilxyz,maxstencil,3); } else if (neighstyle == Neighbor::MULTI) { - bytes += atom->ntypes*maxstencil_multi * sizeof(int); - bytes += atom->ntypes*maxstencil_multi * sizeof(double); + bytes += (double)atom->ntypes*maxstencil_multi * sizeof(int); + bytes += (double)atom->ntypes*maxstencil_multi * sizeof(double); } return bytes; } diff --git a/src/ntopo.cpp b/src/ntopo.cpp index a4f8db7517..78b7cca1b0 100644 --- a/src/ntopo.cpp +++ b/src/ntopo.cpp @@ -209,10 +209,10 @@ void NTopo::dihedral_check(int nlist, int **list) double NTopo::memory_usage() { double bytes = 0; - bytes += 3*maxbond * sizeof(int); - bytes += 4*maxangle * sizeof(int); - bytes += 5*maxdihedral * sizeof(int); - bytes += 5*maximproper * sizeof(int); + bytes += (double)3*maxbond * sizeof(int); + bytes += (double)4*maxangle * sizeof(int); + bytes += (double)5*maxdihedral * sizeof(int); + bytes += (double)5*maximproper * sizeof(int); return bytes; } diff --git a/src/pair.cpp b/src/pair.cpp index afc5eb2785..d9e7304ba3 100644 --- a/src/pair.cpp +++ b/src/pair.cpp @@ -1837,8 +1837,8 @@ void Pair::hessian_twobody(double fforce, double dfac, double delr[3], double ph double Pair::memory_usage() { double bytes = comm->nthreads*maxeatom * sizeof(double); - bytes += comm->nthreads*maxvatom*6 * sizeof(double); - bytes += comm->nthreads*maxcvatom*9 * sizeof(double); + bytes += (double)comm->nthreads*maxvatom*6 * sizeof(double); + bytes += (double)comm->nthreads*maxcvatom*9 * sizeof(double); return bytes; } diff --git a/src/pair_coul_streitz.cpp b/src/pair_coul_streitz.cpp index de2f180d44..941bc8c83d 100644 --- a/src/pair_coul_streitz.cpp +++ b/src/pair_coul_streitz.cpp @@ -737,9 +737,9 @@ void PairCoulStreitz::ewald_sum(double qi, double qj, double zj, double r, double PairCoulStreitz::memory_usage() { double bytes = maxeatom * sizeof(double); - bytes += maxvatom*6 * sizeof(double); - bytes += nmax * sizeof(int); - bytes += MAXNEIGH * nmax * sizeof(int); + bytes += (double)maxvatom*6 * sizeof(double); + bytes += (double)nmax * sizeof(int); + bytes += (double)MAXNEIGH * nmax * sizeof(int); return bytes; } diff --git a/src/pair_hybrid.cpp b/src/pair_hybrid.cpp index 3026c9c741..fc8f24defd 100644 --- a/src/pair_hybrid.cpp +++ b/src/pair_hybrid.cpp @@ -1079,8 +1079,8 @@ int PairHybrid::check_ijtype(int itype, int jtype, char *substyle) double PairHybrid::memory_usage() { double bytes = maxeatom * sizeof(double); - bytes += maxvatom*6 * sizeof(double); - bytes += maxcvatom*9 * sizeof(double); + bytes += (double)maxvatom*6 * sizeof(double); + bytes += (double)maxcvatom*9 * sizeof(double); for (int m = 0; m < nstyles; m++) bytes += styles[m]->memory_usage(); return bytes; }