git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@11230 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -27,14 +27,15 @@ static SW<PRECISION,ACC_PRECISION> SWMF;
|
||||
// ---------------------------------------------------------------------------
|
||||
// Allocate memory on host and device and copy constants to device
|
||||
// ---------------------------------------------------------------------------
|
||||
int sw_gpu_init(const int inum, const int nall, const int max_nbors,
|
||||
int sw_gpu_init(const int ntypes, const int inum, const int nall, const int max_nbors,
|
||||
const double cell_size, int &gpu_mode, FILE *screen,
|
||||
const double sw_epsilon, const double sw_sigma,
|
||||
const double sw_lambda, const double sw_gamma,
|
||||
const double sw_costheta, const double sw_biga,
|
||||
const double sw_bigb, const double sw_powerp,
|
||||
const double sw_powerq, const double sw_cut,
|
||||
const double sw_cutsq) {
|
||||
int* host_map, const int nelements, int*** host_elem2param, const int nparams,
|
||||
const double* sw_epsilon, const double* sw_sigma,
|
||||
const double* sw_lambda, const double* sw_gamma,
|
||||
const double* sw_costheta, const double* sw_biga,
|
||||
const double* sw_bigb, const double* sw_powerp,
|
||||
const double* sw_powerq, const double* sw_cut,
|
||||
const double* sw_cutsq) {
|
||||
SWMF.clear();
|
||||
gpu_mode=SWMF.device->gpu_mode();
|
||||
double gpu_split=SWMF.device->particle_split();
|
||||
@ -55,13 +56,14 @@ int sw_gpu_init(const int inum, const int nall, const int max_nbors,
|
||||
message=true;
|
||||
|
||||
if (message) {
|
||||
fprintf(screen,"Initializing GPU and compiling on process 0...");
|
||||
fprintf(screen,"Initializing Device and compiling on process 0...");
|
||||
fflush(screen);
|
||||
}
|
||||
|
||||
int init_ok=0;
|
||||
if (world_me==0)
|
||||
init_ok=SWMF.init(inum, nall, 300, cell_size, gpu_split, screen,
|
||||
init_ok=SWMF.init(ntypes, inum, nall, 300, cell_size, gpu_split, screen,
|
||||
host_map, nelements, host_elem2param, nparams,
|
||||
sw_epsilon, sw_sigma, sw_lambda, sw_gamma, sw_costheta,
|
||||
sw_biga, sw_bigb, sw_powerp, sw_powerq, sw_cut, sw_cutsq);
|
||||
|
||||
@ -72,14 +74,15 @@ int sw_gpu_init(const int inum, const int nall, const int max_nbors,
|
||||
for (int i=0; i<procs_per_gpu; i++) {
|
||||
if (message) {
|
||||
if (last_gpu-first_gpu==0)
|
||||
fprintf(screen,"Initializing GPU %d on core %d...",first_gpu,i);
|
||||
fprintf(screen,"Initializing Device %d on core %d...",first_gpu,i);
|
||||
else
|
||||
fprintf(screen,"Initializing GPUs %d-%d on core %d...",first_gpu,
|
||||
fprintf(screen,"Initializing Devices %d-%d on core %d...",first_gpu,
|
||||
last_gpu,i);
|
||||
fflush(screen);
|
||||
}
|
||||
if (gpu_rank==i && world_me!=0)
|
||||
init_ok=SWMF.init(inum, nall, 300, cell_size, gpu_split, screen,
|
||||
init_ok=SWMF.init(ntypes, inum, nall, 300, cell_size, gpu_split, screen,
|
||||
host_map, nelements, host_elem2param, nparams,
|
||||
sw_epsilon, sw_sigma, sw_lambda, sw_gamma, sw_costheta,
|
||||
sw_biga, sw_bigb, sw_powerp, sw_powerq, sw_cut,
|
||||
sw_cutsq);
|
||||
|
||||
Reference in New Issue
Block a user