Commit c837659c authored by sjplimp's avatar sjplimp
Browse files

git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@5541 f3b2605a-c512-4ea7-a41b-209d697bcdaa
parent 52e87824
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -24,6 +24,11 @@ if (test $1 = 1) then
    cp pair_lj_cut_coul_long_gpu.h ..
  fi

  if (test -e ../pair_lj_charmm_coul_long.cpp) then
    cp pair_lj_charmm_coul_long_gpu.cpp ..
    cp pair_lj_charmm_coul_long_gpu.h ..
  fi

  if (test -e ../pair_cg_cmm.cpp) then
    cp pair_cg_cmm_gpu.cpp ..
    cp pair_cg_cmm_gpu.h ..
@@ -56,6 +61,7 @@ elif (test $1 = 0) then
  rm ../pair_lj96_cut_gpu.cpp
  rm ../pair_lj_cut_coul_cut_gpu.cpp
  rm ../pair_lj_cut_coul_long_gpu.cpp
  rm ../pair_lj_charmm_coul_long_gpu.cpp
  rm ../pair_cg_cmm_gpu.cpp
  rm ../pair_cg_cmm_coul_long_gpu.cpp
  rm ../fix_gpu.cpp
@@ -65,8 +71,10 @@ elif (test $1 = 0) then
  rm ../pair_lj96_cut_gpu.h
  rm ../pair_lj_cut_coul_cut_gpu.h
  rm ../pair_lj_cut_coul_long_gpu.h
  rm ../pair_lj_charmm_coul_long_gpu.h
  rm ../pair_cg_cmm_gpu.h
  rm ../pair_cg_cmm_coul_long_gpu.h
  rm ../fix_gpu.h
  
fi
+9 −5
Original line number Diff line number Diff line
@@ -23,13 +23,16 @@
#include "timer.h"
#include "modify.h"
#include "domain.h"
#include "universe.h"

using namespace LAMMPS_NS;

enum{GPU_FORCE, GPU_NEIGH};

extern bool lmp_init_device(const int first_gpu, const int last_gpu,
                            const int gpu_mode, const double particle_split);
extern bool lmp_init_device(MPI_Comm world, MPI_Comm replica,
                            const int first_gpu, const int last_gpu,
                            const int gpu_mode, const double particle_split,
                            const int nthreads);
extern void lmp_clear_device();
extern double lmp_gpu_forces(double **f, double **tor, double *eatom,
                             double **vatom, double *virial, double &ecoul);
@@ -39,7 +42,7 @@ extern double lmp_gpu_forces(double **f, double **tor, double *eatom,
FixGPU::FixGPU(LAMMPS *lmp, int narg, char **arg) :
  Fix(lmp, narg, arg)
{
  if (narg < 7) error->all("Illegal fix gpu command");
  if (narg != 7) error->all("Illegal fix gpu command");

  if (strcmp(arg[1],"all") != 0)
    error->all("Illegal fix gpu command");
@@ -63,7 +66,8 @@ FixGPU::FixGPU(LAMMPS *lmp, int narg, char **arg) :
  if (particle_split==0 || particle_split>1)
    error->all("Illegal fix gpu command.");
    
  if (!lmp_init_device(first_gpu,last_gpu,gpu_mode,particle_split))
  if (!lmp_init_device(universe->uworld,world,first_gpu,last_gpu,gpu_mode,
                       particle_split,1))
    error->one("Could not find or initialize a specified accelerator device.");
}

+1 −3
Original line number Diff line number Diff line
@@ -95,9 +95,7 @@ PairCGCMMCoulLongGPU::~PairCGCMMCoulLongGPU()

void PairCGCMMCoulLongGPU::compute(int eflag, int vflag)
{
  if (update->ntimestep > MAXSMALLINT)
    error->all("Timestep too big for GPU pair style");
  int ntimestep = update->ntimestep;
  int ntimestep = static_cast<int>(update->ntimestep % MAXSMALLINT);

  if (eflag || vflag) ev_setup(eflag,vflag);
  else evflag = vflag_fdotr = 0;
+1 −3
Original line number Diff line number Diff line
@@ -84,9 +84,7 @@ PairCGCMMGPU::~PairCGCMMGPU()

void PairCGCMMGPU::compute(int eflag, int vflag)
{
  if (update->ntimestep > MAXSMALLINT)
    error->all("Timestep too big for GPU pair style");
  int ntimestep = update->ntimestep;
  int ntimestep = static_cast<int>(update->ntimestep % MAXSMALLINT);

  if (eflag || vflag) ev_setup(eflag,vflag);
  else evflag = vflag_fdotr = 0;
+1 −3
Original line number Diff line number Diff line
@@ -89,9 +89,7 @@ PairGayBerneGPU::~PairGayBerneGPU()

void PairGayBerneGPU::compute(int eflag, int vflag)
{
  if (update->ntimestep > MAXSMALLINT)
    error->all("Timestep too big for GPU pair style");
  int ntimestep = update->ntimestep;
  int ntimestep = static_cast<int>(update->ntimestep % MAXSMALLINT);

  if (eflag || vflag) ev_setup(eflag,vflag);
  else evflag = vflag_fdotr = 0;
Loading