From ba76216025f68c8af55ab069b39af2a13ad1b681 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Mon, 1 Aug 2011 14:06:52 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@6572 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/USER-CUDA/compute_pressure_cuda.cpp | 2 +- src/USER-CUDA/domain_cuda.cpp | 1 + src/USER-CUDA/fix_nh_cuda.cpp | 5 +++-- src/USER-CUDA/pair_born_coul_long_cuda.cpp | 4 ++-- src/USER-CUDA/pair_buck_coul_cut_cuda.cpp | 4 ++-- src/USER-CUDA/pair_buck_coul_long_cuda.cpp | 4 ++-- src/USER-CUDA/pair_buck_cuda.cpp | 2 +- src/USER-CUDA/pair_cg_cmm_coul_cut_cuda.cpp | 4 ++-- src/USER-CUDA/pair_cg_cmm_coul_debye_cuda.cpp | 4 ++-- src/USER-CUDA/pair_cg_cmm_coul_long_cuda.cpp | 4 ++-- src/USER-CUDA/pair_cg_cmm_cuda.cpp | 4 ++-- src/USER-CUDA/pair_eam_cuda.cpp | 12 ++++++++++++ src/USER-CUDA/pair_eam_cuda.h | 1 + src/USER-CUDA/pair_lj96_cut_cuda.cpp | 4 ++-- src/USER-CUDA/pair_lj_charmm_coul_charmm_cuda.cpp | 5 +++-- .../pair_lj_charmm_coul_charmm_implicit_cuda.cpp | 5 +++-- src/USER-CUDA/pair_lj_charmm_coul_long_cuda.cpp | 5 +++-- src/USER-CUDA/pair_lj_class2_coul_cut_cuda.cpp | 4 ++-- src/USER-CUDA/pair_lj_class2_coul_long_cuda.cpp | 4 ++-- src/USER-CUDA/pair_lj_class2_cuda.cpp | 4 ++-- src/USER-CUDA/pair_lj_cut_coul_cut_cuda.cpp | 4 ++-- src/USER-CUDA/pair_lj_cut_coul_debye_cuda.cpp | 4 ++-- src/USER-CUDA/pair_lj_cut_coul_long_cuda.cpp | 4 ++-- src/USER-CUDA/pair_lj_cut_cuda.cpp | 4 ++-- src/USER-CUDA/pair_lj_cut_experimental_cuda.cpp | 4 ++-- src/USER-CUDA/pair_lj_expand_cuda.cpp | 4 ++-- src/USER-CUDA/pair_lj_gromacs_coul_gromacs_cuda.cpp | 5 +++-- src/USER-CUDA/pair_lj_gromacs_cuda.cpp | 5 +++-- src/USER-CUDA/pair_lj_smooth_cuda.cpp | 5 +++-- src/USER-CUDA/pair_morse_cuda.cpp | 4 ++-- src/USER-CUDA/pppm_cuda.cpp | 2 +- src/pair.h | 2 +- 32 files changed, 75 insertions(+), 54 deletions(-) diff --git a/src/USER-CUDA/compute_pressure_cuda.cpp b/src/USER-CUDA/compute_pressure_cuda.cpp index 8aeebf6a9d..aceb06a36d 100644 --- a/src/USER-CUDA/compute_pressure_cuda.cpp +++ b/src/USER-CUDA/compute_pressure_cuda.cpp @@ -75,7 +75,7 @@ ComputePressureCuda::ComputePressureCuda(LAMMPS *lmp, int narg, char **arg) : strcpy(id_temp,arg[3]); int icompute = modify->find_compute(id_temp); - delete id_temp; + delete [] id_temp; if (modify->compute[icompute]->cudable == 0) { error->warning("Compute pressure/cuda temperature ID is not cudable! Try a temp/cuda style."); diff --git a/src/USER-CUDA/domain_cuda.cpp b/src/USER-CUDA/domain_cuda.cpp index 7f5bc03699..37aa38c198 100644 --- a/src/USER-CUDA/domain_cuda.cpp +++ b/src/USER-CUDA/domain_cuda.cpp @@ -62,6 +62,7 @@ DomainCuda::DomainCuda(LAMMPS *lmp) : Domain(lmp) void DomainCuda::init() { + cuda->accelerator(0,NULL); Domain::init(); if(not cuda->finished_run) diff --git a/src/USER-CUDA/fix_nh_cuda.cpp b/src/USER-CUDA/fix_nh_cuda.cpp index 45cfd2616a..281ffaf0f6 100644 --- a/src/USER-CUDA/fix_nh_cuda.cpp +++ b/src/USER-CUDA/fix_nh_cuda.cpp @@ -65,6 +65,7 @@ FixNHCuda::FixNHCuda(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) extscalar = 1; extvector = 0; + triggerneighsq = -1; // default values pcouple = NONE; @@ -547,7 +548,7 @@ void FixNHCuda::init() if (force->kspace) kspace_flag = 1; else kspace_flag = 0; - if (strstr(update->integrate_style,"respa")) { + if (strcmp(update->integrate_style,"respa") == 0) { nlevels_respa = ((Respa *) update->integrate)->nlevels; step_respa = ((Respa *) update->integrate)->step; dto = 0.5*step_respa[0]; @@ -1550,7 +1551,7 @@ void FixNHCuda::reset_dt() // If using respa, then remap is performed in innermost level - if (strstr(update->integrate_style,"respa")) + if (strcmp(update->integrate_style,"respa") == 0) dto = 0.5*step_respa[0]; p_freq_max = 0.0; diff --git a/src/USER-CUDA/pair_born_coul_long_cuda.cpp b/src/USER-CUDA/pair_born_coul_long_cuda.cpp index 8e107a515b..1d8c656316 100644 --- a/src/USER-CUDA/pair_born_coul_long_cuda.cpp +++ b/src/USER-CUDA/pair_born_coul_long_cuda.cpp @@ -180,7 +180,7 @@ void PairBornCoulLongCuda::ev_setup(int eflag, int vflag) if (eflag_atom && atom->nmax > maxeatomold) {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax );} - if (eflag_atom && atom->nmax > maxeatomold) - {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.eatom , atom->nmax, 6 );} + if (vflag_atom && atom->nmax > maxeatomold) + {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6 );} } diff --git a/src/USER-CUDA/pair_buck_coul_cut_cuda.cpp b/src/USER-CUDA/pair_buck_coul_cut_cuda.cpp index 76d56d4263..4416a3d197 100644 --- a/src/USER-CUDA/pair_buck_coul_cut_cuda.cpp +++ b/src/USER-CUDA/pair_buck_coul_cut_cuda.cpp @@ -167,7 +167,7 @@ void PairBuckCoulCutCuda::ev_setup(int eflag, int vflag) if (eflag_atom && atom->nmax > maxeatomold) {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax );} - if (eflag_atom && atom->nmax > maxeatomold) - {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.eatom , atom->nmax, 6 );} + if (vflag_atom && atom->nmax > maxeatomold) + {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6 );} } diff --git a/src/USER-CUDA/pair_buck_coul_long_cuda.cpp b/src/USER-CUDA/pair_buck_coul_long_cuda.cpp index e825ee90bc..9044d2128c 100644 --- a/src/USER-CUDA/pair_buck_coul_long_cuda.cpp +++ b/src/USER-CUDA/pair_buck_coul_long_cuda.cpp @@ -178,7 +178,7 @@ void PairBuckCoulLongCuda::ev_setup(int eflag, int vflag) if (eflag_atom && atom->nmax > maxeatomold) {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax );} - if (eflag_atom && atom->nmax > maxeatomold) - {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.eatom , atom->nmax, 6 );} + if (vflag_atom && atom->nmax > maxeatomold) + {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6 );} } diff --git a/src/USER-CUDA/pair_buck_cuda.cpp b/src/USER-CUDA/pair_buck_cuda.cpp index a4c4f15bd3..e906783390 100644 --- a/src/USER-CUDA/pair_buck_cuda.cpp +++ b/src/USER-CUDA/pair_buck_cuda.cpp @@ -164,6 +164,6 @@ void PairBuckCuda::ev_setup(int eflag, int vflag) {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax );} if (eflag_atom && atom->nmax > maxeatomold) - {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.eatom , atom->nmax, 6 );} + {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6 );} } diff --git a/src/USER-CUDA/pair_cg_cmm_coul_cut_cuda.cpp b/src/USER-CUDA/pair_cg_cmm_coul_cut_cuda.cpp index 2a4f7d2a97..1c82a8d797 100644 --- a/src/USER-CUDA/pair_cg_cmm_coul_cut_cuda.cpp +++ b/src/USER-CUDA/pair_cg_cmm_coul_cut_cuda.cpp @@ -196,8 +196,8 @@ void PairCGCMMCoulCutCuda::ev_setup(int eflag, int vflag) if (eflag_atom && atom->nmax > maxeatomold) {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax );} - if (eflag_atom && atom->nmax > maxeatomold) - {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.eatom , atom->nmax, 6 );} + if (vflag_atom && atom->nmax > maxeatomold) + {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6 );} } diff --git a/src/USER-CUDA/pair_cg_cmm_coul_debye_cuda.cpp b/src/USER-CUDA/pair_cg_cmm_coul_debye_cuda.cpp index 12b9169dc5..280ec2638a 100644 --- a/src/USER-CUDA/pair_cg_cmm_coul_debye_cuda.cpp +++ b/src/USER-CUDA/pair_cg_cmm_coul_debye_cuda.cpp @@ -196,8 +196,8 @@ void PairCGCMMCoulDebyeCuda::ev_setup(int eflag, int vflag) if (eflag_atom && atom->nmax > maxeatomold) {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax );} - if (eflag_atom && atom->nmax > maxeatomold) - {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.eatom , atom->nmax, 6 );} + if (vflag_atom && atom->nmax > maxeatomold) + {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6 );} } diff --git a/src/USER-CUDA/pair_cg_cmm_coul_long_cuda.cpp b/src/USER-CUDA/pair_cg_cmm_coul_long_cuda.cpp index 2e8e2d0c90..3597691690 100644 --- a/src/USER-CUDA/pair_cg_cmm_coul_long_cuda.cpp +++ b/src/USER-CUDA/pair_cg_cmm_coul_long_cuda.cpp @@ -198,8 +198,8 @@ void PairCGCMMCoulLongCuda::ev_setup(int eflag, int vflag) if (eflag_atom && atom->nmax > maxeatomold) {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax );} - if (eflag_atom && atom->nmax > maxeatomold) - {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.eatom , atom->nmax, 6 );} + if (vflag_atom && atom->nmax > maxeatomold) + {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6 );} } diff --git a/src/USER-CUDA/pair_cg_cmm_cuda.cpp b/src/USER-CUDA/pair_cg_cmm_cuda.cpp index f7db7ef96b..5471d95f23 100644 --- a/src/USER-CUDA/pair_cg_cmm_cuda.cpp +++ b/src/USER-CUDA/pair_cg_cmm_cuda.cpp @@ -193,8 +193,8 @@ void PairCGCMMCuda::ev_setup(int eflag, int vflag) if (eflag_atom && atom->nmax > maxeatomold) {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax );} - if (eflag_atom && atom->nmax > maxeatomold) - {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.eatom , atom->nmax, 6 );} + if (vflag_atom && atom->nmax > maxeatomold) + {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6 );} } diff --git a/src/USER-CUDA/pair_eam_cuda.cpp b/src/USER-CUDA/pair_eam_cuda.cpp index d53b8ebbee..6d012a80a3 100644 --- a/src/USER-CUDA/pair_eam_cuda.cpp +++ b/src/USER-CUDA/pair_eam_cuda.cpp @@ -237,3 +237,15 @@ void PairEAMCuda::unpack_comm(int n, int first, double *buf) Cuda_PairEAMCuda_UnpackComm(&cuda->shared_data,n,first,buf,cu_fp->dev_data()); } +void PairEAMCuda::ev_setup(int eflag, int vflag) +{ + int maxeatomold=maxeatom; + PairEAM::ev_setup(eflag,vflag); + + if (eflag_atom && atom->nmax > maxeatomold) + {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax );} + + if (vflag_atom && atom->nmax > maxeatomold) + {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6 );} + +} diff --git a/src/USER-CUDA/pair_eam_cuda.h b/src/USER-CUDA/pair_eam_cuda.h index e560fabd62..2f1f251fac 100644 --- a/src/USER-CUDA/pair_eam_cuda.h +++ b/src/USER-CUDA/pair_eam_cuda.h @@ -63,6 +63,7 @@ class PairEAMCuda : public PairEAM class Cuda *cuda; void allocate(); bool allocated2; + virtual void ev_setup(int eflag, int vflag); class CudaNeighList* cuda_neigh_list; cCudaData* cu_rho; cCudaData* cu_fp; diff --git a/src/USER-CUDA/pair_lj96_cut_cuda.cpp b/src/USER-CUDA/pair_lj96_cut_cuda.cpp index c5ad2b1ad1..f60c61bf28 100644 --- a/src/USER-CUDA/pair_lj96_cut_cuda.cpp +++ b/src/USER-CUDA/pair_lj96_cut_cuda.cpp @@ -176,8 +176,8 @@ void PairLJ96CutCuda::ev_setup(int eflag, int vflag) if (eflag_atom && atom->nmax > maxeatomold) {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax );} - if (eflag_atom && atom->nmax > maxeatomold) - {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.eatom , atom->nmax, 6 );} + if (vflag_atom && atom->nmax > maxeatomold) + {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6 );} } diff --git a/src/USER-CUDA/pair_lj_charmm_coul_charmm_cuda.cpp b/src/USER-CUDA/pair_lj_charmm_coul_charmm_cuda.cpp index df6ea70248..a5a08046a9 100644 --- a/src/USER-CUDA/pair_lj_charmm_coul_charmm_cuda.cpp +++ b/src/USER-CUDA/pair_lj_charmm_coul_charmm_cuda.cpp @@ -72,6 +72,7 @@ void PairLJCharmmCoulCharmmCuda::allocate() if(! allocated) PairLJCharmmCoulCharmm::allocate(); if(! allocated2) { + cuda->accelerator(0,NULL); allocated2 = true; cuda->shared_data.pair.coeff1 = lj1; cuda->shared_data.pair.coeff2 = lj2; @@ -185,8 +186,8 @@ void PairLJCharmmCoulCharmmCuda::ev_setup(int eflag, int vflag) if (eflag_atom && atom->nmax > maxeatomold) {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax );} - if (eflag_atom && atom->nmax > maxeatomold) - {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.eatom , atom->nmax, 6 );} + if (vflag_atom && atom->nmax > maxeatomold) + {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6 );} } diff --git a/src/USER-CUDA/pair_lj_charmm_coul_charmm_implicit_cuda.cpp b/src/USER-CUDA/pair_lj_charmm_coul_charmm_implicit_cuda.cpp index 40e268cec2..f127d9e31a 100644 --- a/src/USER-CUDA/pair_lj_charmm_coul_charmm_implicit_cuda.cpp +++ b/src/USER-CUDA/pair_lj_charmm_coul_charmm_implicit_cuda.cpp @@ -72,6 +72,7 @@ void PairLJCharmmCoulCharmmImplicitCuda::allocate() if(! allocated) PairLJCharmmCoulCharmmImplicit::allocate(); if(! allocated2) { + cuda->accelerator(0,NULL); allocated2 = true; cuda->shared_data.pair.coeff1 = lj1; cuda->shared_data.pair.coeff2 = lj2; @@ -180,8 +181,8 @@ void PairLJCharmmCoulCharmmImplicitCuda::ev_setup(int eflag, int vflag) if (eflag_atom && atom->nmax > maxeatomold) {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax );} - if (eflag_atom && atom->nmax > maxeatomold) - {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.eatom , atom->nmax, 6 );} + if (vflag_atom && atom->nmax > maxeatomold) + {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6 );} } diff --git a/src/USER-CUDA/pair_lj_charmm_coul_long_cuda.cpp b/src/USER-CUDA/pair_lj_charmm_coul_long_cuda.cpp index 1e9df1ce3e..434f098f37 100644 --- a/src/USER-CUDA/pair_lj_charmm_coul_long_cuda.cpp +++ b/src/USER-CUDA/pair_lj_charmm_coul_long_cuda.cpp @@ -79,6 +79,7 @@ void PairLJCharmmCoulLongCuda::allocate() if(! allocated) PairLJCharmmCoulLong::allocate(); if(! allocated2) { + cuda->accelerator(0,NULL); allocated2 = true; //cuda->shared_data.pair.cut = cut_lj; cuda->shared_data.pair.coeff1 = lj1; @@ -193,8 +194,8 @@ void PairLJCharmmCoulLongCuda::ev_setup(int eflag, int vflag) if (eflag_atom && atom->nmax > maxeatomold) {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax );} - if (eflag_atom && atom->nmax > maxeatomold) - {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.eatom , atom->nmax, 6 );} + if (vflag_atom && atom->nmax > maxeatomold) + {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6 );} } diff --git a/src/USER-CUDA/pair_lj_class2_coul_cut_cuda.cpp b/src/USER-CUDA/pair_lj_class2_coul_cut_cuda.cpp index 2ebf3335f9..a75a70ba01 100644 --- a/src/USER-CUDA/pair_lj_class2_coul_cut_cuda.cpp +++ b/src/USER-CUDA/pair_lj_class2_coul_cut_cuda.cpp @@ -159,8 +159,8 @@ void PairLJClass2CoulCutCuda::ev_setup(int eflag, int vflag) if (eflag_atom && atom->nmax > maxeatomold) {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax );} - if (eflag_atom && atom->nmax > maxeatomold) - {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.eatom , atom->nmax, 6 );} + if (vflag_atom && atom->nmax > maxeatomold) + {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6 );} } diff --git a/src/USER-CUDA/pair_lj_class2_coul_long_cuda.cpp b/src/USER-CUDA/pair_lj_class2_coul_long_cuda.cpp index 053091798b..5c1d3a6fff 100644 --- a/src/USER-CUDA/pair_lj_class2_coul_long_cuda.cpp +++ b/src/USER-CUDA/pair_lj_class2_coul_long_cuda.cpp @@ -172,8 +172,8 @@ void PairLJClass2CoulLongCuda::ev_setup(int eflag, int vflag) if (eflag_atom && atom->nmax > maxeatomold) {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax );} - if (eflag_atom && atom->nmax > maxeatomold) - {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.eatom , atom->nmax, 6 );} + if (vflag_atom && atom->nmax > maxeatomold) + {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6 );} } diff --git a/src/USER-CUDA/pair_lj_class2_cuda.cpp b/src/USER-CUDA/pair_lj_class2_cuda.cpp index 299d0a1bdd..98d8d87468 100644 --- a/src/USER-CUDA/pair_lj_class2_cuda.cpp +++ b/src/USER-CUDA/pair_lj_class2_cuda.cpp @@ -164,8 +164,8 @@ void PairLJClass2Cuda::ev_setup(int eflag, int vflag) if (eflag_atom && atom->nmax > maxeatomold) {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax );} - if (eflag_atom && atom->nmax > maxeatomold) - {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.eatom , atom->nmax, 6 );} + if (vflag_atom && atom->nmax > maxeatomold) + {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6 );} } diff --git a/src/USER-CUDA/pair_lj_cut_coul_cut_cuda.cpp b/src/USER-CUDA/pair_lj_cut_coul_cut_cuda.cpp index f99678b058..ce2c36bc27 100644 --- a/src/USER-CUDA/pair_lj_cut_coul_cut_cuda.cpp +++ b/src/USER-CUDA/pair_lj_cut_coul_cut_cuda.cpp @@ -159,8 +159,8 @@ void PairLJCutCoulCutCuda::ev_setup(int eflag, int vflag) if (eflag_atom && atom->nmax > maxeatomold) {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax );} - if (eflag_atom && atom->nmax > maxeatomold) - {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.eatom , atom->nmax, 6 );} + if (vflag_atom && atom->nmax > maxeatomold) + {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6 );} } diff --git a/src/USER-CUDA/pair_lj_cut_coul_debye_cuda.cpp b/src/USER-CUDA/pair_lj_cut_coul_debye_cuda.cpp index 6c35d41a7b..a1e553d78d 100644 --- a/src/USER-CUDA/pair_lj_cut_coul_debye_cuda.cpp +++ b/src/USER-CUDA/pair_lj_cut_coul_debye_cuda.cpp @@ -160,8 +160,8 @@ void PairLJCutCoulDebyeCuda::ev_setup(int eflag, int vflag) if (eflag_atom && atom->nmax > maxeatomold) {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax );} - if (eflag_atom && atom->nmax > maxeatomold) - {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.eatom , atom->nmax, 6 );} + if (vflag_atom && atom->nmax > maxeatomold) + {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6 );} } diff --git a/src/USER-CUDA/pair_lj_cut_coul_long_cuda.cpp b/src/USER-CUDA/pair_lj_cut_coul_long_cuda.cpp index 3498421f17..80d0f7de3f 100644 --- a/src/USER-CUDA/pair_lj_cut_coul_long_cuda.cpp +++ b/src/USER-CUDA/pair_lj_cut_coul_long_cuda.cpp @@ -213,8 +213,8 @@ void PairLJCutCoulLongCuda::ev_setup(int eflag, int vflag) if (eflag_atom && atom->nmax > maxeatomold) {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax );} - if (eflag_atom && atom->nmax > maxeatomold) - {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.eatom , atom->nmax, 6 );} + if (vflag_atom && atom->nmax > maxeatomold) + {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6 );} } diff --git a/src/USER-CUDA/pair_lj_cut_cuda.cpp b/src/USER-CUDA/pair_lj_cut_cuda.cpp index 0d8304ad9b..29dfbb8145 100644 --- a/src/USER-CUDA/pair_lj_cut_cuda.cpp +++ b/src/USER-CUDA/pair_lj_cut_cuda.cpp @@ -176,8 +176,8 @@ void PairLJCutCuda::ev_setup(int eflag, int vflag) if (eflag_atom && atom->nmax > maxeatomold) {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax );} - if (eflag_atom && atom->nmax > maxeatomold) - {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.eatom , atom->nmax, 6 );} + if (vflag_atom && atom->nmax > maxeatomold) + {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6 );} } diff --git a/src/USER-CUDA/pair_lj_cut_experimental_cuda.cpp b/src/USER-CUDA/pair_lj_cut_experimental_cuda.cpp index 408eb21935..a8700008d6 100644 --- a/src/USER-CUDA/pair_lj_cut_experimental_cuda.cpp +++ b/src/USER-CUDA/pair_lj_cut_experimental_cuda.cpp @@ -175,8 +175,8 @@ void PairLJCutExperimentalCuda::ev_setup(int eflag, int vflag) if (eflag_atom && atom->nmax > maxeatomold) {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax );} - if (eflag_atom && atom->nmax > maxeatomold) - {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.eatom , atom->nmax, 6 );} + if (vflag_atom && atom->nmax > maxeatomold) + {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6 );} } diff --git a/src/USER-CUDA/pair_lj_expand_cuda.cpp b/src/USER-CUDA/pair_lj_expand_cuda.cpp index a326c633f5..f06f227aff 100644 --- a/src/USER-CUDA/pair_lj_expand_cuda.cpp +++ b/src/USER-CUDA/pair_lj_expand_cuda.cpp @@ -177,8 +177,8 @@ void PairLJExpandCuda::ev_setup(int eflag, int vflag) if (eflag_atom && atom->nmax > maxeatomold) {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax );} - if (eflag_atom && atom->nmax > maxeatomold) - {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.eatom , atom->nmax, 6 );} + if (vflag_atom && atom->nmax > maxeatomold) + {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6 );} } diff --git a/src/USER-CUDA/pair_lj_gromacs_coul_gromacs_cuda.cpp b/src/USER-CUDA/pair_lj_gromacs_coul_gromacs_cuda.cpp index caa93424c1..8e05acc4f1 100644 --- a/src/USER-CUDA/pair_lj_gromacs_coul_gromacs_cuda.cpp +++ b/src/USER-CUDA/pair_lj_gromacs_coul_gromacs_cuda.cpp @@ -72,6 +72,7 @@ void PairLJGromacsCoulGromacsCuda::allocate() if(! allocated) PairLJGromacsCoulGromacs::allocate(); if(! allocated2) { + cuda->accelerator(0,NULL); allocated2 = true; cuda->shared_data.pair.coeff1 = lj1; cuda->shared_data.pair.coeff2 = lj2; @@ -191,8 +192,8 @@ void PairLJGromacsCoulGromacsCuda::ev_setup(int eflag, int vflag) if (eflag_atom && atom->nmax > maxeatomold) {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax );} - if (eflag_atom && atom->nmax > maxeatomold) - {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.eatom , atom->nmax, 6 );} + if (vflag_atom && atom->nmax > maxeatomold) + {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6 );} } diff --git a/src/USER-CUDA/pair_lj_gromacs_cuda.cpp b/src/USER-CUDA/pair_lj_gromacs_cuda.cpp index 931397b436..97bf05aac4 100644 --- a/src/USER-CUDA/pair_lj_gromacs_cuda.cpp +++ b/src/USER-CUDA/pair_lj_gromacs_cuda.cpp @@ -72,6 +72,7 @@ void PairLJGromacsCuda::allocate() if(! allocated) PairLJGromacs::allocate(); if(! allocated2) { + cuda->accelerator(0,NULL); allocated2 = true; cuda->shared_data.pair.cut = cut; cuda->shared_data.pair.cut_inner = cut_inner; @@ -174,8 +175,8 @@ void PairLJGromacsCuda::ev_setup(int eflag, int vflag) if (eflag_atom && atom->nmax > maxeatomold) {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax );} - if (eflag_atom && atom->nmax > maxeatomold) - {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.eatom , atom->nmax, 6 );} + if (vflag_atom && atom->nmax > maxeatomold) + {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6 );} } diff --git a/src/USER-CUDA/pair_lj_smooth_cuda.cpp b/src/USER-CUDA/pair_lj_smooth_cuda.cpp index a9d67c1346..25f2c5059a 100644 --- a/src/USER-CUDA/pair_lj_smooth_cuda.cpp +++ b/src/USER-CUDA/pair_lj_smooth_cuda.cpp @@ -72,6 +72,7 @@ void PairLJSmoothCuda::allocate() if(! allocated) PairLJSmooth::allocate(); if(! allocated2) { + cuda->accelerator(0,NULL); allocated2 = true; cuda->shared_data.pair.cut = cut; cuda->shared_data.pair.cut_inner = cut_inner; @@ -174,8 +175,8 @@ void PairLJSmoothCuda::ev_setup(int eflag, int vflag) if (eflag_atom && atom->nmax > maxeatomold) {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax );} - if (eflag_atom && atom->nmax > maxeatomold) - {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.eatom , atom->nmax, 6 );} + if (vflag_atom && atom->nmax > maxeatomold) + {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6 );} } diff --git a/src/USER-CUDA/pair_morse_cuda.cpp b/src/USER-CUDA/pair_morse_cuda.cpp index 2ad2bb7ea4..befacd3413 100644 --- a/src/USER-CUDA/pair_morse_cuda.cpp +++ b/src/USER-CUDA/pair_morse_cuda.cpp @@ -174,8 +174,8 @@ void PairMorseCuda::ev_setup(int eflag, int vflag) if (eflag_atom && atom->nmax > maxeatomold) {delete cuda->cu_eatom; cuda->cu_eatom = new cCudaData ((double*)eatom, & cuda->shared_data.atom.eatom , atom->nmax );} - if (eflag_atom && atom->nmax > maxeatomold) - {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.eatom , atom->nmax, 6 );} + if (vflag_atom && atom->nmax > maxeatomold) + {delete cuda->cu_vatom; cuda->cu_vatom = new cCudaData ((double*)vatom, & cuda->shared_data.atom.vatom , atom->nmax, 6 );} } diff --git a/src/USER-CUDA/pppm_cuda.cpp b/src/USER-CUDA/pppm_cuda.cpp index 956c581c67..57698b104c 100644 --- a/src/USER-CUDA/pppm_cuda.cpp +++ b/src/USER-CUDA/pppm_cuda.cpp @@ -876,7 +876,7 @@ void PPPMCuda::compute(int eflag, int vflag) nmax = atom->nmax; memory->create(part2grid,nmax,3,"pppm:part2grid"); delete cu_part2grid; - delete adev_data_array; + delete [] adev_data_array; adev_data_array=new dev_array[1]; cu_part2grid = new cCudaData ((int*)part2grid,adev_data_array, nmax,3); diff --git a/src/pair.h b/src/pair.h index 8316ef1a3e..86b05da84d 100644 --- a/src/pair.h +++ b/src/pair.h @@ -127,7 +127,7 @@ class Pair : protected Pointers { int vflag_fdotr; int maxeatom,maxvatom; - void ev_setup(int, int); + virtual void ev_setup(int, int); void ev_tally(int, int, int, int, double, double, double, double, double, double); void ev_tally_full(int, double, double, double, double, double, double);