~ubuntu-branches/debian/sid/lammps/sid

« back to all changes in this revision

Viewing changes to src/GPU/pair_coul_long_gpu.cpp

  • Committer: Package Import Robot
  • Author(s): Anton Gladky
  • Date: 2015-04-29 23:44:49 UTC
  • mfrom: (5.1.3 experimental)
  • Revision ID: package-import@ubuntu.com-20150429234449-mbhy9utku6hp6oq8
Tags: 0~20150313.gitfa668e1-1
Upload into unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
 
49
49
// External functions from cuda library for atom decomposition
50
50
 
51
 
int cl_gpu_init(const int nlocal, const int nall, const int max_nbors,
 
51
int cl_gpu_init(const int ntypes, double **scale,
 
52
                const int nlocal, const int nall, const int max_nbors,
52
53
                const int maxspecial, const double cell_size, int &gpu_mode,
53
54
                FILE *screen, double host_cut_coulsq, double *host_special_coul,
54
55
                const double qqrd2e, const double g_ewald);
 
56
void cl_gpu_reinit(const int ntypes, double **scale);
55
57
void cl_gpu_clear();
56
58
int ** cl_gpu_compute_n(const int ago, const int inum,
57
59
                        const int nall, double **host_x, int *host_type,
143
145
    error->all(FLERR,"Cannot use newton pair with coul/long/gpu pair style");
144
146
 
145
147
  // Repeat cutsq calculation because done after call to init_style
146
 
  double cell_size = sqrt(cut_coul) + neighbor->skin;
 
148
  double cell_size = cut_coul + neighbor->skin;
147
149
 
148
150
  cut_coulsq = cut_coul * cut_coul;
149
151
 
160
162
  int maxspecial=0;
161
163
  if (atom->molecular)
162
164
    maxspecial=atom->maxspecial;
163
 
  int success = cl_gpu_init(atom->nlocal, atom->nlocal+atom->nghost, 300,
 
165
  int success = cl_gpu_init(atom->ntypes+1, scale,
 
166
                            atom->nlocal, atom->nlocal+atom->nghost, 300,
164
167
                            maxspecial, cell_size, gpu_mode, screen, cut_coulsq,
165
168
                            force->special_coul, force->qqrd2e, g_ewald);
166
169
 
167
170
  GPU_EXTRA::check_flag(success,error,world);
168
171
 
169
172
  if (gpu_mode == GPU_FORCE) {
170
 
    int irequest = neighbor->request(this);
 
173
    int irequest = neighbor->request(this,instance_me);
171
174
    neighbor->requests[irequest]->half = 0;
172
175
    neighbor->requests[irequest]->full = 1;
173
176
  }
175
178
 
176
179
/* ---------------------------------------------------------------------- */
177
180
 
 
181
void PairCoulLongGPU::reinit()
 
182
{
 
183
  Pair::reinit();
 
184
  
 
185
  cl_gpu_reinit(atom->ntypes+1, scale);
 
186
}
 
187
 
 
188
/* ---------------------------------------------------------------------- */
 
189
 
178
190
double PairCoulLongGPU::memory_usage()
179
191
{
180
192
  double bytes = Pair::memory_usage();