Fixing some bugs when using multiple GPU styles hybrid.

This commit is contained in:
W. Michael Brown
2011-03-01 17:45:14 -05:00
parent 3e6ab71fa7
commit fe88e353d5
5 changed files with 12 additions and 7 deletions

View File

@ -112,8 +112,7 @@ int * AtomicGPUMemoryT::reset_nbors(const int nall, const int inum, int *ilist,
success=true;
nbor_time_avail=true;
int mn=nbor->max_nbor_loop(inum,numj);
int mn=nbor->max_nbor_loop(inum,numj,ilist);
resize_atom(inum,nall,success);
resize_local(inum,mn,success);
if (!success)
@ -170,6 +169,7 @@ void AtomicGPUMemoryT::compute(const int f_ago, const int inum_full,
bool &success) {
acc_timers();
if (inum_full==0) {
host_start=0;
zero_timers();
return;
}
@ -208,6 +208,7 @@ int * AtomicGPUMemoryT::compute(const int ago, const int inum_full,
const double cpu_time, bool &success) {
acc_timers();
if (inum_full==0) {
host_start=0;
zero_timers();
return NULL;
}

View File

@ -114,7 +114,7 @@ int * ChargeGPUMemoryT::reset_nbors(const int nall, const int inum, int *ilist,
nbor_time_avail=true;
int mn=nbor->max_nbor_loop(inum,numj);
int mn=nbor->max_nbor_loop(inum,numj,ilist);
resize_atom(inum,nall,success);
resize_local(inum,mn,success);
if (!success)
@ -171,6 +171,7 @@ void ChargeGPUMemoryT::compute(const int f_ago, const int inum_full,
bool &success, double *host_q) {
acc_timers();
if (inum_full==0) {
host_start=0;
zero_timers();
return;
}
@ -213,6 +214,7 @@ int * ChargeGPUMemoryT::compute(const int ago, const int inum_full,
double *host_q) {
acc_timers();
if (inum_full==0) {
host_start=0;
zero_timers();
return NULL;
}

View File

@ -163,7 +163,7 @@ void _gb_gpu_reset_nbors(gbmtyp &gbm, const int nall,
gbm.nbor_time_avail=true;
int mn=gbm.nbor->max_nbor_loop(inum,numj);
int mn=gbm.nbor->max_nbor_loop(inum,numj,ilist);
gbm.resize_atom(inum,nall,success);
gbm.resize_local(inum,0,mn,osize,success);
if (!success)
@ -336,6 +336,7 @@ inline int * _gb_gpu_compute_n(gbmtyp &gbm, const int ago,
double **host_quat) {
gbm.acc_timers();
if (inum_full==0) {
host_start=0;
gbm.zero_timers();
return NULL;
}
@ -394,6 +395,7 @@ inline int * _gb_gpu_compute(gbmtyp &gbm, const int f_ago, const int inum_full,
bool &success, double **host_quat) {
gbm.acc_timers();
if (inum_full==0) {
host_start=0;
gbm.zero_timers();
return NULL;
}

View File

@ -126,10 +126,10 @@ class PairGPUNbor {
inline int max_nbors() const { return _max_nbors; }
/// Loop through neighbor count array and return maximum nbors for a particle
inline int max_nbor_loop(const int inum, int *numj) const {
inline int max_nbor_loop(const int inum, int *numj, int *ilist) const {
int mn=0;
for (int i=0; i<inum; i++)
mn=std::max(mn,numj[i]);
mn=std::max(mn,numj[ilist[i]]);
return mn;
}

View File

@ -92,7 +92,7 @@ void PairLJCutCoulCutGPU::compute(int eflag, int vflag)
int inum, host_start;
bool success = true;
if (gpu_mode == GPU_NEIGH) {
inum = atom->nlocal;
gpulist = ljc_gpu_compute_n(neighbor->ago, inum, nall, atom->x,