diff --git a/src/USER-CUDA/cuda.cpp b/src/USER-CUDA/cuda.cpp index fff5c78b96..50c896fbba 100644 --- a/src/USER-CUDA/cuda.cpp +++ b/src/USER-CUDA/cuda.cpp @@ -545,13 +545,26 @@ void Cuda::evsetup_eatom_vatom(int eflag_atom,int vflag_atom) { if(not cu_eatom) cu_eatom = new cCudaData (force->pair->eatom, & (shared_data.atom.eatom) , atom->nmax );// cu_eatom->set_buffer(&(copy_buffer),&(copy_buffersize),true);} + if(cu_eatom->get_dim()[0]!=atom->nmax) + { + //delete cu_eatom; + //cu_eatom = new cCudaData (force->pair->eatom, & (shared_data.atom.eatom) , atom->nmax );// cu_eatom->set_buffer(&(copy_buffer),&(copy_buffersize),true);} + shared_data.atom.update_nmax=2; + } + cu_eatom->set_host_data(force->pair->eatom); - cu_eatom->memset_device(0); + cu_eatom->memset_device(0); } if(vflag_atom) { if(not cu_vatom) cu_vatom = new cCudaData ((double*)force->pair->vatom, & (shared_data.atom.vatom) , atom->nmax ,6 );// cu_vatom->set_buffer(&(copy_buffer),&(copy_buffersize),true);} + if(cu_vatom->get_dim()[0]!=atom->nmax) + { + //delete cu_vatom; + //cu_vatom = new cCudaData ((double*)force->pair->vatom, & (shared_data.atom.vatom) , atom->nmax ,6 );// cu_vatom->set_buffer(&(copy_buffer),&(copy_buffersize),true);} + shared_data.atom.update_nmax=2; + } cu_vatom->set_host_data((double*)force->pair->vatom); cu_vatom->memset_device(0); } diff --git a/src/balance.cpp b/src/balance.cpp index 775fda0e80..ce1e71f4e9 100644 --- a/src/balance.cpp +++ b/src/balance.cpp @@ -32,8 +32,6 @@ enum{NONE,UNIFORM,USER,DYNAMIC}; enum{X,Y,Z}; enum{EXPAND,CONTRACT}; -#define BIG - #define BALANCE_DEBUG 1 /* ---------------------------------------------------------------------- */ @@ -92,6 +90,8 @@ void Balance::command(int narg, char **arg) // parse arguments + if (narg < 1) error->all(FLERR,"Illegal balance command"); + int dimension = domain->dimension; int *procgrid = comm->procgrid; xflag = yflag = zflag = NONE;