forked from lijiext/lammps
Merge pull request #1776 from Vsevak/tip4p_gpu
GPU support for lj/cut/tip4p/long pair style
This commit is contained in:
commit
481c647889
|
@ -102,6 +102,9 @@ pair\_style lj/cut/tip4p/long/omp command
|
|||
pair\_style lj/cut/tip4p/long/opt command
|
||||
=========================================
|
||||
|
||||
pair\_style lj/cut/tip4p/long/gpu command
|
||||
=====================================
|
||||
|
||||
Syntax
|
||||
""""""
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
../../rdf-adf/data.spce
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,49 @@
|
|||
# sample script to compare and debug GPU accelerated tip4p water
|
||||
# use '-sf gpu' to enables the GPU accelerated pair style
|
||||
# without it the original lj/cut/tip4p/long from module KSPACE will be used
|
||||
|
||||
units real
|
||||
boundary p p p
|
||||
|
||||
atom_style full
|
||||
bond_style harmonic
|
||||
angle_style harmonic
|
||||
atom_modify map array
|
||||
|
||||
pair_style lj/cut/tip4p/long 1 2 1 1 0.1546 9.0 9.0
|
||||
pair_modify table 0
|
||||
|
||||
#long-range solver for TIP4P from module KSPACE works on CPU
|
||||
suffix off
|
||||
newton on
|
||||
kspace_style pppm/tip4p 1.0e-5
|
||||
suffix on
|
||||
|
||||
read_data data.spce
|
||||
|
||||
pair_coeff * * 0.0 0.0
|
||||
pair_coeff 1 1 0.1852 3.1589
|
||||
|
||||
bond_coeff 1 0.0 0.9572
|
||||
angle_coeff 1 0.0 104.52
|
||||
|
||||
group water type 1 2
|
||||
|
||||
#maintain the water molecule rigid
|
||||
fix 1 water shake 1.0e-4 200 0 b 1 a 1
|
||||
fix 2 water nve
|
||||
|
||||
thermo 100
|
||||
thermo_style custom step etotal ke pe temp evdwl ecoul elong press
|
||||
thermo_modify format float "%.15g"
|
||||
|
||||
velocity water create 300 123
|
||||
|
||||
if $(is_active(package,gpu)) &
|
||||
then "dump 11 all custom 1 dump.force_gpu id type x y z fx fy fz"&
|
||||
else "dump 11 all custom 1 dump.force_cpu id type x y z fx fy fz"
|
||||
dump_modify 11 sort id
|
||||
|
||||
timestep 1
|
||||
|
||||
run 1
|
|
@ -0,0 +1,127 @@
|
|||
LAMMPS (30 Oct 2019)
|
||||
#
|
||||
|
||||
units real
|
||||
boundary p p p
|
||||
|
||||
atom_style full
|
||||
bond_style harmonic
|
||||
angle_style harmonic
|
||||
atom_modify map array
|
||||
|
||||
pair_style lj/cut/tip4p/long 1 2 1 1 0.1546 9.0 9.0
|
||||
pair_modify table 0
|
||||
|
||||
#long-range solver for TIP4P from module KSPACE works on CPU
|
||||
suffix off
|
||||
newton on
|
||||
kspace_style pppm/tip4p 1.0e-5
|
||||
suffix on
|
||||
|
||||
read_data data.spce
|
||||
orthogonal box = (0.02645 0.02645 0.02641) to (35.5328 35.5328 35.4736)
|
||||
1 by 1 by 1 MPI processor grid
|
||||
reading atoms ...
|
||||
4500 atoms
|
||||
scanning bonds ...
|
||||
2 = max bonds/atom
|
||||
scanning angles ...
|
||||
1 = max angles/atom
|
||||
reading bonds ...
|
||||
3000 bonds
|
||||
reading angles ...
|
||||
1500 angles
|
||||
2 = max # of 1-2 neighbors
|
||||
1 = max # of 1-3 neighbors
|
||||
1 = max # of 1-4 neighbors
|
||||
2 = max # of special neighbors
|
||||
special bonds CPU = 0.00143709 secs
|
||||
read_data CPU = 0.0185545 secs
|
||||
|
||||
pair_coeff * * 0.0 0.0
|
||||
pair_coeff 1 1 0.1852 3.1589
|
||||
|
||||
bond_coeff 1 0.0 0.9572
|
||||
angle_coeff 1 0.0 104.52
|
||||
|
||||
group water type 1 2
|
||||
4500 atoms in group water
|
||||
|
||||
#maintain the water molecule rigid
|
||||
fix 1 water shake 1.0e-4 200 0 b 1 a 1
|
||||
0 = # of size 2 clusters
|
||||
0 = # of size 3 clusters
|
||||
0 = # of size 4 clusters
|
||||
1500 = # of frozen angles
|
||||
fix 2 water nve
|
||||
|
||||
thermo 100
|
||||
thermo_style custom step etotal ke pe temp evdwl ecoul elong press
|
||||
thermo_modify format float "%.15g"
|
||||
|
||||
velocity water create 300 123
|
||||
|
||||
if $(is_active(package,gpu)) then "dump 11 all custom 1 dump.force_gpu id type x y z fx fy fz" else "dump 11 all custom 1 dump.force_cpu id type x y z fx fy fz"
|
||||
if 0 then "dump 11 all custom 1 dump.force_gpu id type x y z fx fy fz" else "dump 11 all custom 1 dump.force_cpu id type x y z fx fy fz"
|
||||
dump 11 all custom 1 dump.force_cpu id type x y z fx fy fz
|
||||
dump_modify 11 sort id
|
||||
|
||||
timestep 1
|
||||
|
||||
run 1
|
||||
PPPM initialization ...
|
||||
extracting TIP4P info from pair style
|
||||
using polynomial approximation for long-range coulomb (../kspace.cpp:323)
|
||||
G vector (1/distance) = 0.342797
|
||||
grid = 36 36 36
|
||||
stencil order = 5
|
||||
estimated absolute RMS force accuracy = 0.00261362
|
||||
estimated relative force accuracy = 7.87083e-06
|
||||
using double precision KISS FFT
|
||||
3d grid and FFT values/proc = 79507 46656
|
||||
Neighbor list info ...
|
||||
update every 1 steps, delay 10 steps, check yes
|
||||
max neighbors/atom: 2000, page size: 100000
|
||||
master list distance cutoff = 11.3092
|
||||
ghost atom cutoff = 11.3092
|
||||
binsize = 5.6546, bins = 7 7 7
|
||||
1 neighbor lists, perpetual/occasional/extra = 1 0 0
|
||||
(1) pair lj/cut/tip4p/long, perpetual
|
||||
attributes: half, newton on
|
||||
pair build: half/bin/newton
|
||||
stencil: half/bin/3d/newton
|
||||
bin: standard
|
||||
Per MPI rank memory allocation (min/avg/max) = 30.18 | 30.18 | 30.18 Mbytes
|
||||
Step TotEng KinEng PotEng Temp E_vdwl E_coul E_long Press
|
||||
0 -6581.1098053463 2681.834801985 -9262.9446073313 300 3652.16918734499 90723.8782743546 -103638.992069031 20828.2770003273
|
||||
1 -6293.09711304554 1787.55263217222 -8080.64974521776 199.96227554909 3652.66537554581 91910.2042281151 -103643.519348879 20986.2037813061
|
||||
Loop time of 0.0943946 on 1 procs for 1 steps with 4500 atoms
|
||||
|
||||
Performance: 0.915 ns/day, 26.221 hours/ns, 10.594 timesteps/s
|
||||
101.7% CPU use with 1 MPI tasks x no OpenMP threads
|
||||
|
||||
MPI task timing breakdown:
|
||||
Section | min time | avg time | max time |%varavg| %total
|
||||
---------------------------------------------------------------
|
||||
Pair | 0.071838 | 0.071838 | 0.071838 | 0.0 | 76.10
|
||||
Bond | 1.974e-06 | 1.974e-06 | 1.974e-06 | 0.0 | 0.00
|
||||
Kspace | 0.012686 | 0.012686 | 0.012686 | 0.0 | 13.44
|
||||
Neigh | 0 | 0 | 0 | 0.0 | 0.00
|
||||
Comm | 0.00012462 | 0.00012462 | 0.00012462 | 0.0 | 0.13
|
||||
Output | 0.0093175 | 0.0093175 | 0.0093175 | 0.0 | 9.87
|
||||
Modify | 0.00038138 | 0.00038138 | 0.00038138 | 0.0 | 0.40
|
||||
Other | | 4.484e-05 | | | 0.05
|
||||
|
||||
Nlocal: 4500 ave 4500 max 4500 min
|
||||
Histogram: 1 0 0 0 0 0 0 0 0 0
|
||||
Nghost: 15219 ave 15219 max 15219 min
|
||||
Histogram: 1 0 0 0 0 0 0 0 0 0
|
||||
Neighs: 1.37151e+06 ave 1.37151e+06 max 1.37151e+06 min
|
||||
Histogram: 1 0 0 0 0 0 0 0 0 0
|
||||
|
||||
Total # of neighbors = 1371514
|
||||
Ave neighs/atom = 304.781
|
||||
Ave special neighs/atom = 2
|
||||
Neighbor list builds = 0
|
||||
Dangerous builds = 0
|
||||
Total wall time: 0:00:00
|
|
@ -0,0 +1,120 @@
|
|||
LAMMPS (30 Oct 2019)
|
||||
package gpu 1
|
||||
#
|
||||
|
||||
units real
|
||||
boundary p p p
|
||||
|
||||
atom_style full
|
||||
bond_style harmonic
|
||||
angle_style harmonic
|
||||
atom_modify map array
|
||||
|
||||
pair_style lj/cut/tip4p/long 1 2 1 1 0.1546 9.0 9.0
|
||||
pair_modify table 0
|
||||
|
||||
#long-range solver for TIP4P from module KSPACE works on CPU
|
||||
suffix off
|
||||
newton on
|
||||
kspace_style pppm/tip4p 1.0e-5
|
||||
suffix on
|
||||
|
||||
read_data data.spce
|
||||
orthogonal box = (0.02645 0.02645 0.02641) to (35.5328 35.5328 35.4736)
|
||||
1 by 1 by 1 MPI processor grid
|
||||
reading atoms ...
|
||||
4500 atoms
|
||||
scanning bonds ...
|
||||
2 = max bonds/atom
|
||||
scanning angles ...
|
||||
1 = max angles/atom
|
||||
reading bonds ...
|
||||
3000 bonds
|
||||
reading angles ...
|
||||
1500 angles
|
||||
2 = max # of 1-2 neighbors
|
||||
1 = max # of 1-3 neighbors
|
||||
1 = max # of 1-4 neighbors
|
||||
2 = max # of special neighbors
|
||||
special bonds CPU = 0.000921346 secs
|
||||
read_data CPU = 0.0115216 secs
|
||||
|
||||
pair_coeff * * 0.0 0.0
|
||||
pair_coeff 1 1 0.1852 3.1589
|
||||
|
||||
bond_coeff 1 0.0 0.9572
|
||||
angle_coeff 1 0.0 104.52
|
||||
|
||||
group water type 1 2
|
||||
4500 atoms in group water
|
||||
|
||||
#maintain the water molecule rigid
|
||||
fix 1 water shake 1.0e-4 200 0 b 1 a 1
|
||||
0 = # of size 2 clusters
|
||||
0 = # of size 3 clusters
|
||||
0 = # of size 4 clusters
|
||||
1500 = # of frozen angles
|
||||
fix 2 water nve
|
||||
|
||||
thermo 100
|
||||
thermo_style custom step etotal ke pe temp evdwl ecoul elong press
|
||||
thermo_modify format float "%.15g"
|
||||
|
||||
velocity water create 300 123
|
||||
|
||||
if $(is_active(package,gpu)) then "dump 11 all custom 1 dump.force_gpu id type x y z fx fy fz" else "dump 11 all custom 1 dump.force_cpu id type x y z fx fy fz"
|
||||
if 1 then "dump 11 all custom 1 dump.force_gpu id type x y z fx fy fz" else "dump 11 all custom 1 dump.force_cpu id type x y z fx fy fz"
|
||||
dump 11 all custom 1 dump.force_gpu id type x y z fx fy fz
|
||||
dump_modify 11 sort id
|
||||
|
||||
timestep 1
|
||||
|
||||
run 1
|
||||
PPPM initialization ...
|
||||
extracting TIP4P info from pair style
|
||||
using polynomial approximation for long-range coulomb (../kspace.cpp:323)
|
||||
G vector (1/distance) = 0.342797
|
||||
grid = 36 36 36
|
||||
stencil order = 5
|
||||
estimated absolute RMS force accuracy = 0.00261362
|
||||
estimated relative force accuracy = 7.87083e-06
|
||||
using double precision KISS FFT
|
||||
3d grid and FFT values/proc = 79507 46656
|
||||
WARNING: Increasing communication cutoff for TIP4P GPU style (../pair_lj_cut_tip4p_long_gpu.cpp:220)
|
||||
Per MPI rank memory allocation (min/avg/max) = 25.12 | 25.12 | 25.12 Mbytes
|
||||
Step TotEng KinEng PotEng Temp E_vdwl E_coul E_long Press
|
||||
0 -6581.10980534572 2681.834801985 -9262.94460733072 300 3652.169187345 90723.8782743551 -103638.992069031 20828.2770003278
|
||||
1 -6293.09711304691 1787.55263217221 -8080.64974521913 199.96227554909 3652.6653755458 91910.2042281137 -103643.519348879 20986.203781307
|
||||
Loop time of 0.0230916 on 1 procs for 1 steps with 4500 atoms
|
||||
|
||||
Performance: 3.742 ns/day, 6.414 hours/ns, 43.306 timesteps/s
|
||||
103.9% CPU use with 1 MPI tasks x no OpenMP threads
|
||||
|
||||
MPI task timing breakdown:
|
||||
Section | min time | avg time | max time |%varavg| %total
|
||||
---------------------------------------------------------------
|
||||
Pair | 0.000606 | 0.000606 | 0.000606 | 0.0 | 2.62
|
||||
Bond | 1.682e-06 | 1.682e-06 | 1.682e-06 | 0.0 | 0.01
|
||||
Kspace | 0.012588 | 0.012588 | 0.012588 | 0.0 | 54.51
|
||||
Neigh | 0 | 0 | 0 | 0.0 | 0.00
|
||||
Comm | 0.00015025 | 0.00015025 | 0.00015025 | 0.0 | 0.65
|
||||
Output | 0.0093124 | 0.0093124 | 0.0093124 | 0.0 | 40.33
|
||||
Modify | 0.00039674 | 0.00039674 | 0.00039674 | 0.0 | 1.72
|
||||
Other | | 3.623e-05 | | | 0.16
|
||||
|
||||
Nlocal: 4500 ave 4500 max 4500 min
|
||||
Histogram: 1 0 0 0 0 0 0 0 0 0
|
||||
Nghost: 16834 ave 16834 max 16834 min
|
||||
Histogram: 1 0 0 0 0 0 0 0 0 0
|
||||
Neighs: 0 ave 0 max 0 min
|
||||
Histogram: 1 0 0 0 0 0 0 0 0 0
|
||||
|
||||
Total # of neighbors = 0
|
||||
Ave neighs/atom = 0
|
||||
Ave special neighs/atom = 2
|
||||
Neighbor list builds = 0
|
||||
Dangerous builds = 0
|
||||
|
||||
Please see the log.cite file for references relevant to this simulation
|
||||
|
||||
Total wall time: 0:00:00
|
|
@ -82,7 +82,8 @@ OBJS = $(OBJ_DIR)/lal_atom.o $(OBJ_DIR)/lal_ans.o \
|
|||
$(OBJ_DIR)/lal_lj_expand_coul_long.o $(OBJ_DIR)/lal_lj_expand_coul_long_ext.o \
|
||||
$(OBJ_DIR)/lal_coul_long_cs.o $(OBJ_DIR)/lal_coul_long_cs_ext.o \
|
||||
$(OBJ_DIR)/lal_born_coul_long_cs.o $(OBJ_DIR)/lal_born_coul_long_cs_ext.o \
|
||||
$(OBJ_DIR)/lal_born_coul_wolf_cs.o $(OBJ_DIR)/lal_born_coul_wolf_cs_ext.o
|
||||
$(OBJ_DIR)/lal_born_coul_wolf_cs.o $(OBJ_DIR)/lal_born_coul_wolf_cs_ext.o \
|
||||
$(OBJ_DIR)/lal_lj_tip4p_long.o $(OBJ_DIR)/lal_lj_tip4p_long_ext.o
|
||||
|
||||
CBNS = $(OBJ_DIR)/device.cubin $(OBJ_DIR)/device_cubin.h \
|
||||
$(OBJ_DIR)/atom.cubin $(OBJ_DIR)/atom_cubin.h \
|
||||
|
@ -143,7 +144,8 @@ CBNS = $(OBJ_DIR)/device.cubin $(OBJ_DIR)/device_cubin.h \
|
|||
$(OBJ_DIR)/lj_expand_coul_long.cubin $(OBJ_DIR)/lj_expand_coul_long_cubin.h \
|
||||
$(OBJ_DIR)/coul_long_cs.cubin $(OBJ_DIR)/coul_long_cs_cubin.h \
|
||||
$(OBJ_DIR)/born_coul_long_cs.cubin $(OBJ_DIR)/born_coul_long_cs_cubin.h \
|
||||
$(OBJ_DIR)/born_coul_wolf_cs.cubin $(OBJ_DIR)/born_coul_wolf_cs_cubin.h
|
||||
$(OBJ_DIR)/born_coul_wolf_cs.cubin $(OBJ_DIR)/born_coul_wolf_cs_cubin.h \
|
||||
$(OBJ_DIR)/lj_tip4p_long.cubin $(OBJ_DIR)/lj_tip4p_long_cubin.h
|
||||
|
||||
all: $(OBJ_DIR) $(GPU_LIB) $(EXECS)
|
||||
|
||||
|
@ -297,6 +299,18 @@ $(OBJ_DIR)/lal_lj.o: $(ALL_H) lal_lj.h lal_lj.cpp $(OBJ_DIR)/lj_cubin.h $(OBJ_DI
|
|||
$(OBJ_DIR)/lal_lj_ext.o: $(ALL_H) lal_lj.h lal_lj_ext.cpp lal_base_atomic.h
|
||||
$(CUDR) -o $@ -c lal_lj_ext.cpp -I$(OBJ_DIR)
|
||||
|
||||
$(OBJ_DIR)/lj_tip4p_long.cubin: lal_lj_tip4p_long.cu lal_precision.h lal_preprocessor.h
|
||||
$(CUDA) --cubin -DNV_KERNEL -o $@ lal_lj_tip4p_long.cu
|
||||
|
||||
$(OBJ_DIR)/lj_tip4p_long_cubin.h: $(OBJ_DIR)/lj_tip4p_long.cubin $(OBJ_DIR)/lj_tip4p_long.cubin
|
||||
$(BIN2C) -c -n lj_tip4p_long $(OBJ_DIR)/lj_tip4p_long.cubin > $(OBJ_DIR)/lj_tip4p_long_cubin.h
|
||||
|
||||
$(OBJ_DIR)/lal_lj_tip4p_long.o: $(ALL_H) lal_lj_tip4p_long.h lal_lj_tip4p_long.cpp $(OBJ_DIR)/lj_tip4p_long_cubin.h $(OBJ_DIR)/lal_base_atomic.o
|
||||
$(CUDR) -o $@ -c lal_lj_tip4p_long.cpp -I$(OBJ_DIR)
|
||||
|
||||
$(OBJ_DIR)/lal_lj_tip4p_long_ext.o: $(ALL_H) lal_lj_tip4p_long.h lal_lj_tip4p_long_ext.cpp lal_base_atomic.h
|
||||
$(CUDR) -o $@ -c lal_lj_tip4p_long_ext.cpp -I$(OBJ_DIR)
|
||||
|
||||
$(OBJ_DIR)/lj_coul.cubin: lal_lj_coul.cu lal_precision.h lal_preprocessor.h
|
||||
$(CUDA) --cubin -DNV_KERNEL -o $@ lal_lj_coul.cu
|
||||
|
||||
|
|
|
@ -71,7 +71,8 @@ OBJS = $(OBJ_DIR)/lal_atom.o $(OBJ_DIR)/lal_answer.o \
|
|||
$(OBJ_DIR)/lal_lj_expand_coul_long.o $(OBJ_DIR)/lal_lj_expand_coul_long_ext.o \
|
||||
$(OBJ_DIR)/lal_coul_long_cs.o $(OBJ_DIR)/lal_coul_long_cs_ext.o \
|
||||
$(OBJ_DIR)/lal_born_coul_long_cs.o $(OBJ_DIR)/lal_born_coul_long_cs_ext.o \
|
||||
$(OBJ_DIR)/lal_born_coul_wolf_cs.o $(OBJ_DIR)/lal_born_coul_wolf_cs_ext.o
|
||||
$(OBJ_DIR)/lal_born_coul_wolf_cs.o $(OBJ_DIR)/lal_born_coul_wolf_cs_ext.o \
|
||||
$(OBJ_DIR)/lal_lj_tip4p_long.o $(OBJ_DIR)/lal_lj_tip4p_long_ext.o
|
||||
|
||||
KERS = $(OBJ_DIR)/device_cl.h $(OBJ_DIR)/atom_cl.h \
|
||||
$(OBJ_DIR)/neighbor_cpu_cl.h $(OBJ_DIR)/pppm_cl.h \
|
||||
|
@ -102,7 +103,8 @@ KERS = $(OBJ_DIR)/device_cl.h $(OBJ_DIR)/atom_cl.h \
|
|||
$(OBJ_DIR)/lj_cubic_cl.h $(OBJ_DIR)/vashishta_cl.h \
|
||||
$(OBJ_DIR)/ufm_cl.h $(OBJ_DIR)/dipole_long_lj_cl.h \
|
||||
$(OBJ_DIR)/lj_expand_coul_long_cl.h $(OBJ_DIR)/coul_long_cs_cl.h \
|
||||
$(OBJ_DIR)/born_coul_long_cs_cl.h $(OBJ_DIR)/born_coul_wolf_cs_cl.h
|
||||
$(OBJ_DIR)/born_coul_long_cs_cl.h $(OBJ_DIR)/born_coul_wolf_cs_cl.h \
|
||||
$(OBJ_DIR)/lj_tip4p_long_cl.h
|
||||
|
||||
|
||||
OCL_EXECS = $(BIN_DIR)/ocl_get_devices
|
||||
|
@ -202,6 +204,15 @@ $(OBJ_DIR)/lal_lj.o: $(ALL_H) lal_lj.h lal_lj.cpp $(OBJ_DIR)/lj_cl.h $(OBJ_DIR)
|
|||
$(OBJ_DIR)/lal_lj_ext.o: $(ALL_H) lal_lj.h lal_lj_ext.cpp lal_base_atomic.h
|
||||
$(OCL) -o $@ -c lal_lj_ext.cpp -I$(OBJ_DIR)
|
||||
|
||||
$(OBJ_DIR)/lj_tip4p_long_cl.h: lal_lj_tip4p_long.cu $(PRE1_H)
|
||||
$(BSH) ./geryon/file_to_cstr.sh lj_tip4p_long $(PRE1_H) lal_lj_tip4p_long.cu $(OBJ_DIR)/lj_tip4p_long_cl.h;
|
||||
|
||||
$(OBJ_DIR)/lal_lj_tip4p_long.o: $(ALL_H) lal_lj_tip4p_long.h lal_lj_tip4p_long.cpp $(OBJ_DIR)/lj_tip4p_long_cl.h $(OBJ_DIR)/lj_tip4p_long_cl.h $(OBJ_DIR)/lal_base_atomic.o
|
||||
$(OCL) -o $@ -c lal_lj_tip4p_long.cpp -I$(OBJ_DIR)
|
||||
|
||||
$(OBJ_DIR)/lal_lj_tip4p_long_ext.o: $(ALL_H) lal_lj_tip4p_long.h lal_lj_tip4p_long_ext.cpp lal_base_atomic.h
|
||||
$(OCL) -o $@ -c lal_lj_tip4p_long_ext.cpp -I$(OBJ_DIR)
|
||||
|
||||
$(OBJ_DIR)/lj_coul_cl.h: lal_lj_coul.cu $(PRE1_H)
|
||||
$(BSH) ./geryon/file_to_cstr.sh lj_coul $(PRE1_H) lal_lj_coul.cu $(OBJ_DIR)/lj_coul_cl.h;
|
||||
|
||||
|
|
|
@ -0,0 +1,372 @@
|
|||
/**************************************************************************
|
||||
lj_tip4p_long.cpp
|
||||
-------------------
|
||||
V. Nikolskiy (HSE)
|
||||
|
||||
Class for acceleration of the lj/tip4p/long pair style
|
||||
|
||||
__________________________________________________________________________
|
||||
This file is part of the LAMMPS Accelerator Library (LAMMPS_AL)
|
||||
__________________________________________________________________________
|
||||
|
||||
begin :
|
||||
email : thevsevak@gmail.com
|
||||
***************************************************************************/
|
||||
|
||||
#if defined(USE_OPENCL)
|
||||
#include "lj_tip4p_long_cl.h"
|
||||
#elif defined(USE_CUDART)
|
||||
const char *lj_tip4p=0;
|
||||
#else
|
||||
#include "lj_tip4p_long_cubin.h"
|
||||
#endif
|
||||
|
||||
#include "lal_lj_tip4p_long.h"
|
||||
#include <cassert>
|
||||
using namespace LAMMPS_AL;
|
||||
#define LJTIP4PLongT LJ_TIP4PLong<numtyp, acctyp>
|
||||
|
||||
extern Device<PRECISION,ACC_PRECISION> device;
|
||||
|
||||
template <class numtyp, class acctyp>
|
||||
LJTIP4PLongT::LJ_TIP4PLong(): BaseCharge<numtyp,acctyp>(), _allocated(false) {
|
||||
}
|
||||
|
||||
template <class numtyp, class acctyp>
|
||||
LJTIP4PLongT::~LJ_TIP4PLong() {
|
||||
clear();
|
||||
}
|
||||
|
||||
template <class numtyp, class acctyp>
|
||||
int LJTIP4PLongT::bytes_per_atom(const int max_nbors) const {
|
||||
return this->bytes_per_atom_atomic(max_nbors);
|
||||
}
|
||||
|
||||
template <class numtyp, class acctyp>
|
||||
int LJTIP4PLongT::init(const int ntypes,
|
||||
double **host_cutsq, double **host_lj1,
|
||||
double **host_lj2, double **host_lj3,
|
||||
double **host_lj4, double **host_offset,
|
||||
double *host_special_lj, const int nlocal,
|
||||
const int tH, const int tO,
|
||||
const double a, const double qd,
|
||||
const int nall, const int max_nbors,
|
||||
const int maxspecial, const double cell_size,
|
||||
const double gpu_split, FILE *_screen,
|
||||
double **host_cut_ljsq,
|
||||
const double host_cut_coulsq, const double host_cut_coulsqplus,
|
||||
double *host_special_coul, const double qqrd2e,
|
||||
const double g_ewald, int map_size, int max_same) {
|
||||
int success;
|
||||
success=this->init_atomic(nlocal,nall,max_nbors,maxspecial,cell_size,gpu_split,
|
||||
_screen,lj_tip4p_long,"k_lj_tip4p_long");
|
||||
if (success!=0)
|
||||
return success;
|
||||
k_pair_distrib.set_function(*this->pair_program,"k_lj_tip4p_long_distrib");
|
||||
k_pair_reneigh.set_function(*this->pair_program,"k_lj_tip4p_reneigh");
|
||||
k_pair_newsite.set_function(*this->pair_program,"k_lj_tip4p_newsite");
|
||||
|
||||
TypeH = tH;
|
||||
TypeO = tO;
|
||||
alpha = a;
|
||||
qdist = qd;
|
||||
|
||||
// If atom type constants fit in shared memory use fast kernel
|
||||
int lj_types=ntypes;
|
||||
shared_types=false;
|
||||
// int max_shared_types=this->device->max_shared_types();
|
||||
// if (lj_types<=max_shared_types && this->_block_size>=max_shared_types) {
|
||||
// lj_types=max_shared_types;
|
||||
// shared_types=true;
|
||||
// }
|
||||
_lj_types=lj_types;
|
||||
|
||||
// Allocate a host write buffer for data initialization
|
||||
UCL_H_Vec<numtyp> host_write(lj_types*lj_types*32,*(this->ucl_device),
|
||||
UCL_WRITE_ONLY);
|
||||
|
||||
for (int i=0; i<lj_types*lj_types; i++)
|
||||
host_write[i]=0.0;
|
||||
|
||||
lj1.alloc(lj_types*lj_types,*(this->ucl_device),UCL_READ_ONLY);
|
||||
this->atom->type_pack4(ntypes,lj_types,lj1,host_write,host_lj1,host_lj2,
|
||||
host_cut_ljsq);
|
||||
|
||||
lj3.alloc(lj_types*lj_types,*(this->ucl_device),UCL_READ_ONLY);
|
||||
this->atom->type_pack4(ntypes,lj_types,lj3,host_write,host_lj3,host_lj4,
|
||||
host_offset);
|
||||
|
||||
cutsq.alloc(lj_types*lj_types,*(this->ucl_device),UCL_READ_ONLY);
|
||||
this->atom->type_pack1(ntypes,lj_types,cutsq,host_write,host_cutsq);
|
||||
|
||||
sp_lj.alloc(8,*(this->ucl_device),UCL_READ_ONLY);
|
||||
for (int i=0; i<4; i++) {
|
||||
host_write[i]=host_special_lj[i];
|
||||
host_write[i+4]=host_special_coul[i];
|
||||
}
|
||||
ucl_copy(sp_lj,host_write,8,false);
|
||||
|
||||
//force_comp.alloc(72*72, *(this->ucl_device), UCL_READ_WRITE);
|
||||
|
||||
_qqrd2e=qqrd2e;
|
||||
_g_ewald=g_ewald;
|
||||
cut_coulsq = host_cut_coulsq;
|
||||
cut_coulsqplus = host_cut_coulsqplus;
|
||||
|
||||
hneight.alloc(nall*4,*(this->ucl_device), UCL_READ_WRITE);
|
||||
m.alloc(nall,*(this->ucl_device), UCL_READ_WRITE);
|
||||
ansO.alloc(nall,*(this->ucl_device), UCL_READ_WRITE);
|
||||
|
||||
this->tag.alloc(nall,*(this->ucl_device), UCL_READ_ONLY);
|
||||
this->atom_sametag.alloc(max_same, *(this->ucl_device), UCL_READ_ONLY);
|
||||
this->map_array.alloc(map_size,*(this->ucl_device), UCL_READ_ONLY);
|
||||
|
||||
_allocated=true;
|
||||
this->_max_bytes=lj1.row_bytes()+lj3.row_bytes()+cutsq.row_bytes()+
|
||||
sp_lj.row_bytes() + hneight.row_bytes()+m.row_bytes()+
|
||||
this->tag.row_bytes()+this->atom_sametag.row_bytes() +
|
||||
this->map_array.row_bytes();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
template <class numtyp, class acctyp>
|
||||
void LJTIP4PLongT::clear() {
|
||||
if (!_allocated)
|
||||
return;
|
||||
_allocated=false;
|
||||
|
||||
lj1.clear();
|
||||
lj3.clear();
|
||||
sp_lj.clear();
|
||||
cutsq.clear();
|
||||
hneight.clear();
|
||||
m.clear();
|
||||
tag.clear();
|
||||
atom_sametag.clear();
|
||||
map_array.clear();
|
||||
ansO.clear();
|
||||
//force_comp.clear();
|
||||
|
||||
k_pair_distrib.clear();
|
||||
k_pair_reneigh.clear();
|
||||
k_pair_newsite.clear();
|
||||
|
||||
this->clear_atomic();
|
||||
}
|
||||
|
||||
template <class numtyp, class acctyp>
|
||||
double LJTIP4PLongT::host_memory_usage() const {
|
||||
return this->host_memory_usage_atomic()+sizeof(LJ_TIP4PLong<numtyp,acctyp>);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Calculate energies, forces, and torques
|
||||
// ---------------------------------------------------------------------------
|
||||
template <class numtyp, class acctyp>
|
||||
void LJTIP4PLongT::loop(const bool _eflag, const bool _vflag) {
|
||||
// Compute the block size and grid size to keep all cores busy
|
||||
const int BX=this->block_size();
|
||||
int eflag, vflag;
|
||||
if (_eflag)
|
||||
eflag=1;
|
||||
else
|
||||
eflag=0;
|
||||
|
||||
if (_vflag)
|
||||
vflag=1;
|
||||
else
|
||||
vflag=0;
|
||||
|
||||
int ainum=this->ans->inum();
|
||||
const int nall = this->atom->nall();
|
||||
int nbor_pitch=this->nbor->nbor_pitch();
|
||||
this->time_pair.start();
|
||||
int GX;
|
||||
GX=static_cast<int>(ceil(static_cast<double>(nall)/BX));
|
||||
if (t_ago == 0) {
|
||||
this->k_pair_reneigh.set_size(GX,BX);
|
||||
this->k_pair_reneigh.run(&this->atom->x,
|
||||
&this->nbor->dev_nbor, &this->_nbor_data->begin(),
|
||||
&nall, &ainum,&nbor_pitch, &this->_threads_per_atom,
|
||||
&hneight, &m, &TypeO, &TypeH,
|
||||
&tag, &map_array, &atom_sametag);
|
||||
}
|
||||
this->k_pair_newsite.set_size(GX,BX);
|
||||
this->k_pair_newsite.run(&this->atom->x,
|
||||
&this->nbor->dev_nbor, &this->_nbor_data->begin(),
|
||||
&nall, &ainum,
|
||||
&nbor_pitch, &this->_threads_per_atom,
|
||||
&hneight, &m, &TypeO, &TypeH, &alpha,
|
||||
&this->atom->q, &tag, &map_array,
|
||||
&atom_sametag);
|
||||
|
||||
GX=static_cast<int>(ceil(static_cast<double>(this->ans->inum())/
|
||||
(BX/this->_threads_per_atom)));
|
||||
this->k_pair.set_size(GX,BX);
|
||||
if (vflag){
|
||||
this->ansO.resize_ib(ainum*3);
|
||||
} else {
|
||||
this->ansO.resize_ib(ainum);
|
||||
}
|
||||
this->ansO.zero();
|
||||
this->device->gpu->sync();
|
||||
this->k_pair.run(&this->atom->x, &lj1, &lj3, &_lj_types, &sp_lj,
|
||||
&this->nbor->dev_nbor, &this->_nbor_data->begin(),
|
||||
&this->ans->force, &this->ans->engv, &eflag, &vflag,
|
||||
&ainum, &nbor_pitch, &this->_threads_per_atom,
|
||||
&hneight, &m, &TypeO, &TypeH, &alpha,
|
||||
&this->atom->q, &cutsq, &_qqrd2e, &_g_ewald,
|
||||
&cut_coulsq, &cut_coulsqplus, &tag, &map_array,
|
||||
&atom_sametag, &this->ansO);
|
||||
GX=static_cast<int>(ceil(static_cast<double>(this->ans->inum())/BX));
|
||||
this->k_pair_distrib.set_size(GX,BX);
|
||||
this->k_pair_distrib.run(&this->atom->x, &this->ans->force, &this->ans->engv,
|
||||
&eflag, &vflag, &ainum, &nbor_pitch, &this->_threads_per_atom,
|
||||
&hneight, &m, &TypeO, &TypeH, &alpha,&this->atom->q, &this->ansO);
|
||||
this->time_pair.stop();
|
||||
}
|
||||
|
||||
|
||||
template <class numtyp, class acctyp>
|
||||
void LJTIP4PLongT::copy_relations_data(int n, int* tag, int *map_array,
|
||||
int map_size, int *sametag, int max_same, int ago){
|
||||
int nall = n;
|
||||
const int hn_sz = n*4; // matrix size = col size * col number
|
||||
hneight.resize_ib(hn_sz);
|
||||
if (ago == 0)
|
||||
hneight.zero();
|
||||
m.resize_ib(n);
|
||||
m.zero();
|
||||
|
||||
UCL_H_Vec<int> host_tag_write(nall,*(this->ucl_device),UCL_WRITE_ONLY);
|
||||
this->tag.resize_ib(nall);
|
||||
for(int i=0; i<nall; ++i) host_tag_write[i] = tag[i];
|
||||
ucl_copy(this->tag, host_tag_write, nall, false);
|
||||
|
||||
host_tag_write.resize_ib(max_same);
|
||||
this->atom_sametag.resize_ib(max_same);
|
||||
for(int i=0; i<max_same; ++i) host_tag_write[i] = sametag[i];
|
||||
ucl_copy(this->atom_sametag, host_tag_write, max_same, false);
|
||||
|
||||
host_tag_write.resize_ib(map_size);
|
||||
this->map_array.resize_ib(map_size);
|
||||
for(int i=0; i<map_size; ++i) host_tag_write[i] = map_array[i];
|
||||
ucl_copy(this->map_array, host_tag_write, map_size, false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Copy nbor list from host if necessary and then calculate forces, virials,..
|
||||
// ---------------------------------------------------------------------------
|
||||
template <class numtyp, class acctyp>
|
||||
void LJTIP4PLongT::compute(const int f_ago, const int inum_full,
|
||||
const int nall, double **host_x, int *host_type,
|
||||
int *ilist, int *numj, int **firstneigh,
|
||||
const bool eflag, const bool vflag,
|
||||
const bool eatom, const bool vatom,
|
||||
int &host_start, const double cpu_time,
|
||||
bool &success, double *host_q,
|
||||
const int nlocal, double *boxlo, double *prd) {
|
||||
this->acc_timers();
|
||||
if (inum_full==0) {
|
||||
host_start=0;
|
||||
// Make sure textures are correct if realloc by a different hybrid style
|
||||
this->resize_atom(0,nall,success);
|
||||
this->zero_timers();
|
||||
return;
|
||||
}
|
||||
|
||||
int ago=this->hd_balancer.ago_first(f_ago);
|
||||
int inum=this->hd_balancer.balance(ago,inum_full,cpu_time);
|
||||
this->ans->inum(inum);
|
||||
host_start=inum;
|
||||
|
||||
if (ago==0) {
|
||||
this->reset_nbors(nall, inum, ilist, numj, firstneigh, success);
|
||||
if (!success)
|
||||
return;
|
||||
}
|
||||
|
||||
this->atom->cast_x_data(host_x,host_type);
|
||||
this->atom->cast_q_data(host_q);
|
||||
this->hd_balancer.start_timer();
|
||||
this->atom->add_x_data(host_x,host_type);
|
||||
this->atom->add_q_data();
|
||||
|
||||
this->device->precompute(f_ago,nlocal,nall,host_x,host_type,success,host_q,
|
||||
boxlo, prd);
|
||||
|
||||
t_ago = ago;
|
||||
loop(eflag,vflag);
|
||||
this->ans->copy_answers(eflag,vflag,eatom,vatom,ilist);
|
||||
this->device->add_ans_object(this->ans);
|
||||
this->hd_balancer.stop_timer();
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Reneighbor on GPU if necessary and then compute forces, virials, energies
|
||||
// ---------------------------------------------------------------------------
|
||||
template <class numtyp, class acctyp>
|
||||
int** LJTIP4PLongT::compute(const int ago, const int inum_full,
|
||||
const int nall, double **host_x, int *host_type,
|
||||
double *sublo, double *subhi, tagint *tag,
|
||||
int *map_array, int map_size, int *sametag, int max_same,
|
||||
int **nspecial, tagint **special, const bool eflag,
|
||||
const bool vflag, const bool eatom,
|
||||
const bool vatom, int &host_start,
|
||||
int **ilist, int **jnum,
|
||||
const double cpu_time, bool &success,
|
||||
double *host_q, double *boxlo, double *prd) {
|
||||
this->acc_timers();
|
||||
if (inum_full==0) {
|
||||
host_start=0;
|
||||
// Make sure textures are correct if realloc by a different hybrid style
|
||||
this->resize_atom(0,nall,success);
|
||||
this->zero_timers();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
this->hd_balancer.balance(cpu_time);
|
||||
int inum=this->hd_balancer.get_gpu_count(ago,inum_full);
|
||||
this->ans->inum(inum);
|
||||
host_start=inum;
|
||||
|
||||
// Build neighbor list on GPU if necessary
|
||||
if (ago==0) {
|
||||
this->build_nbor_list(inum, inum_full-inum, nall, host_x, host_type,
|
||||
sublo, subhi, tag, nspecial, special, success);
|
||||
if (!success)
|
||||
return NULL;
|
||||
this->atom->cast_q_data(host_q);
|
||||
this->hd_balancer.start_timer();
|
||||
} else {
|
||||
this->atom->cast_x_data(host_x,host_type);
|
||||
this->atom->cast_q_data(host_q);
|
||||
this->hd_balancer.start_timer();
|
||||
this->atom->add_x_data(host_x,host_type);
|
||||
}
|
||||
this->atom->add_q_data();
|
||||
*ilist=this->nbor->host_ilist.begin();
|
||||
*jnum=this->nbor->host_acc.begin();
|
||||
|
||||
copy_relations_data(nall, tag, map_array, map_size, sametag, max_same, ago);
|
||||
|
||||
this->device->precompute(ago,inum_full,nall,host_x,host_type,success,host_q,
|
||||
boxlo, prd);
|
||||
|
||||
t_ago = ago;
|
||||
loop(eflag,vflag);
|
||||
this->ans->copy_answers(eflag,vflag,eatom,vatom);
|
||||
this->device->add_ans_object(this->ans);
|
||||
this->hd_balancer.stop_timer();
|
||||
|
||||
return this->nbor->host_jlist.begin()-host_start;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
template class LJ_TIP4PLong<PRECISION,ACC_PRECISION>;
|
|
@ -0,0 +1,568 @@
|
|||
// **************************************************************************
|
||||
// lj_tip4p_long.cu
|
||||
// -------------------
|
||||
// V. Nikolskiy (HSE)
|
||||
//
|
||||
// Device code for acceleration of the lj/tip4p/long pair style
|
||||
//
|
||||
// __________________________________________________________________________
|
||||
// This file is part of the LAMMPS Accelerator Library (LAMMPS_AL)
|
||||
// __________________________________________________________________________
|
||||
//
|
||||
// begin :
|
||||
// email : thevsevak@gmail.com
|
||||
// ***************************************************************************/
|
||||
|
||||
#ifdef NV_KERNEL
|
||||
|
||||
#include "lal_aux_fun1.h"
|
||||
#ifndef _DOUBLE_DOUBLE
|
||||
texture<float4> pos_tex;
|
||||
texture<float> q_tex;
|
||||
#else
|
||||
texture<int4,1> pos_tex;
|
||||
texture<int2> q_tex;
|
||||
#endif
|
||||
|
||||
#else
|
||||
#define pos_tex x_
|
||||
#define q_tex q_
|
||||
#endif
|
||||
|
||||
ucl_inline int atom_mapping(const __global int *map, int glob){
|
||||
return map[glob];
|
||||
}
|
||||
|
||||
ucl_inline int closest_image(int i, int j, const __global int* sametag,
|
||||
const __global numtyp4 *restrict x_)
|
||||
{
|
||||
if (j < 0) return j;
|
||||
|
||||
numtyp4 xi; fetch4(xi,i,pos_tex); // = x[i];
|
||||
numtyp4 xj; fetch4(xj,j,pos_tex);
|
||||
|
||||
int closest = j;
|
||||
numtyp delx = xi.x - xj.x;
|
||||
numtyp dely = xi.y - xj.y;
|
||||
numtyp delz = xi.z - xj.z;
|
||||
numtyp rsqmin = delx*delx + dely*dely + delz*delz;
|
||||
numtyp rsq;
|
||||
|
||||
while (sametag[j] >= 0) {
|
||||
j = sametag[j];
|
||||
fetch4(xj,j,pos_tex);
|
||||
delx = xi.x - xj.x;
|
||||
dely = xi.y - xj.y;
|
||||
delz = xi.z - xj.z;
|
||||
rsq = delx*delx + dely*dely + delz*delz;
|
||||
if (rsq < rsqmin) {
|
||||
rsqmin = rsq;
|
||||
closest = j;
|
||||
}
|
||||
}
|
||||
|
||||
return closest;
|
||||
}
|
||||
|
||||
ucl_inline void compute_newsite(int iO, int iH1, int iH2,
|
||||
__global numtyp4 *xM, numtyp q,
|
||||
numtyp alpha, const __global numtyp4 *restrict x_){
|
||||
numtyp4 xO; fetch4(xO,iO,pos_tex);
|
||||
numtyp4 xH1; fetch4(xH1,iH1,pos_tex);
|
||||
numtyp4 xH2; fetch4(xH2,iH2,pos_tex);
|
||||
numtyp4 M;
|
||||
|
||||
numtyp delx1 = xH1.x - xO.x;
|
||||
numtyp dely1 = xH1.y - xO.y;
|
||||
numtyp delz1 = xH1.z - xO.z;
|
||||
|
||||
numtyp delx2 = xH2.x - xO.x;
|
||||
numtyp dely2 = xH2.y - xO.y;
|
||||
numtyp delz2 = xH2.z - xO.z;
|
||||
|
||||
numtyp ap = alpha * (numtyp)0.5;
|
||||
|
||||
M.x = xO.x + ap * (delx1 + delx2);
|
||||
M.y = xO.y + ap * (dely1 + dely2);
|
||||
M.z = xO.z + ap * (delz1 + delz2);
|
||||
M.w = q;
|
||||
|
||||
*xM = M;
|
||||
}
|
||||
|
||||
__kernel void k_lj_tip4p_long_distrib(const __global numtyp4 *restrict x_,
|
||||
__global acctyp4 *restrict ans,
|
||||
__global acctyp *restrict engv,
|
||||
const int eflag, const int vflag, const int inum,
|
||||
const int nbor_pitch, const int t_per_atom,
|
||||
__global int *restrict hneigh,
|
||||
__global numtyp4 *restrict m,
|
||||
const int typeO, const int typeH,
|
||||
const numtyp alpha,
|
||||
const __global numtyp *restrict q_, const __global acctyp4 *restrict ansO) {
|
||||
int tid, ii, offset;
|
||||
atom_info(t_per_atom,ii,tid,offset);
|
||||
int i = BLOCK_ID_X*(BLOCK_SIZE_X)+tid;
|
||||
|
||||
acctyp4 f;
|
||||
f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0;
|
||||
|
||||
if (i<inum) {
|
||||
numtyp4 ix; fetch4(ix,i,pos_tex);// = x_[i];
|
||||
int itype = ix.w;
|
||||
acctyp4 fM, vM;
|
||||
acctyp eM;
|
||||
if (itype == typeH) {
|
||||
int iO = hneigh[i*4];
|
||||
if (iO < inum) {
|
||||
fM = ansO[iO];
|
||||
f.x += fM.x * (acctyp)0.5 * alpha;
|
||||
f.y += fM.y * (acctyp)0.5 * alpha;
|
||||
f.z += fM.z * (acctyp)0.5 * alpha;
|
||||
if (vflag > 0) {
|
||||
vM = ansO[inum +iO];
|
||||
engv[inum*2 + i] += vM.x * (acctyp)0.5 * alpha;
|
||||
engv[inum*3 + i] += vM.y * (acctyp)0.5 * alpha;
|
||||
engv[inum*4 + i] += vM.z * (acctyp)0.5 * alpha;
|
||||
vM = ansO[inum*2+iO];
|
||||
engv[inum*5 + i] += vM.x * (acctyp)0.5 * alpha;
|
||||
engv[inum*6 + i] += vM.y * (acctyp)0.5 * alpha;
|
||||
engv[inum*7 + i] += vM.z * (acctyp)0.5 * alpha;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
fM = ansO[i];
|
||||
int iH1 = hneigh[i*4 ];
|
||||
int iH2 = hneigh[i*4+1];
|
||||
f.x += fM.x * (acctyp)(1 - alpha);
|
||||
f.y += fM.y * (acctyp)(1 - alpha);
|
||||
f.z += fM.z * (acctyp)(1 - alpha);
|
||||
if (eflag > 0) {
|
||||
eM = engv[i+inum];
|
||||
engv[inum+i] = eM*(acctyp)(1 - alpha);
|
||||
if (iH1 < inum) engv[inum+iH1] += eM * (acctyp)0.5 * alpha;
|
||||
if (iH2 < inum) engv[inum+iH2] += eM * (acctyp)0.5 * alpha;
|
||||
}
|
||||
if (vflag > 0) {
|
||||
vM = ansO[inum + i];
|
||||
engv[inum*2 + i] += vM.x * (acctyp)(1 - alpha);
|
||||
engv[inum*3 + i] += vM.y * (acctyp)(1 - alpha);
|
||||
engv[inum*4 + i] += vM.z * (acctyp)(1 - alpha);
|
||||
vM = ansO[inum*2 + i];
|
||||
engv[inum*5 + i] += vM.x * (acctyp)(1 - alpha);
|
||||
engv[inum*6 + i] += vM.y * (acctyp)(1 - alpha);
|
||||
engv[inum*7 + i] += vM.z * (acctyp)(1 - alpha);
|
||||
}
|
||||
}
|
||||
acctyp4 old=ans[i];
|
||||
old.x+=f.x;
|
||||
old.y+=f.y;
|
||||
old.z+=f.z;
|
||||
ans[i]=old;
|
||||
} // if ii
|
||||
}
|
||||
|
||||
__kernel void k_lj_tip4p_reneigh(const __global numtyp4 *restrict x_,
|
||||
const __global int * dev_nbor,
|
||||
const __global int * dev_packed,
|
||||
const int nall, const int inum,
|
||||
const int nbor_pitch, const int t_per_atom,
|
||||
__global int *restrict hneigh,
|
||||
__global numtyp4 *restrict m,
|
||||
const int typeO, const int typeH,
|
||||
const __global int *restrict tag, const __global int *restrict map,
|
||||
const __global int *restrict sametag) {
|
||||
int tid, ii, offset;
|
||||
atom_info(t_per_atom,ii,tid,offset);
|
||||
int i = BLOCK_ID_X*(BLOCK_SIZE_X)+tid;
|
||||
|
||||
if (i<nall) {
|
||||
numtyp4 ix; fetch4(ix,i,pos_tex); //x_[i];
|
||||
|
||||
int iH1, iH2, iO;
|
||||
int itype = ix.w;
|
||||
if(itype == typeO) {
|
||||
iO = i;
|
||||
if (hneigh[i*4+2] != -1) {
|
||||
iH1 = atom_mapping(map, tag[i] + 1);
|
||||
iH2 = atom_mapping(map, tag[i] + 2);
|
||||
// set iH1,iH2 to closest image to O
|
||||
iH1 = closest_image(i, iH1, sametag, x_);
|
||||
iH2 = closest_image(i, iH2, sametag, x_);
|
||||
hneigh[i*4 ] = iH1;
|
||||
hneigh[i*4+1] = iH2;
|
||||
hneigh[i*4+2] = -1;
|
||||
}
|
||||
} else {
|
||||
if (hneigh[i*4+2] != -1) {
|
||||
int iI, iH;
|
||||
iI = atom_mapping(map,tag[i] - 1);
|
||||
numtyp4 iIx; fetch4(iIx,iI,pos_tex); //x_[iI];
|
||||
if ((int)iIx.w == typeH) {
|
||||
iO = atom_mapping(map,tag[i] - 2);
|
||||
iO = closest_image(i, iO, sametag, x_);
|
||||
iH1 = closest_image(i, iI, sametag, x_);
|
||||
iH2 = i;
|
||||
} else { //if ((int)iIx.w == typeO)
|
||||
iH = atom_mapping(map, tag[i] + 1);
|
||||
iO = closest_image(i,iI,sametag, x_);
|
||||
iH1 = i;
|
||||
iH2 = closest_image(i,iH,sametag, x_);
|
||||
}
|
||||
hneigh[i*4+0] = iO;
|
||||
hneigh[i*4+1] += -1;
|
||||
hneigh[i*4+2] = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
__kernel void k_lj_tip4p_newsite(const __global numtyp4 *restrict x_,
|
||||
const __global int * dev_nbor,
|
||||
const __global int * dev_packed,
|
||||
const int nall, const int inum,
|
||||
const int nbor_pitch, const int t_per_atom,
|
||||
__global int *restrict hneigh,
|
||||
__global numtyp4 *restrict m,
|
||||
const int typeO, const int typeH,
|
||||
const numtyp alpha, const __global numtyp *restrict q_,
|
||||
const __global int *restrict tag, const __global int *restrict map,
|
||||
const __global int *restrict sametag) {
|
||||
int tid, ii, offset;
|
||||
atom_info(t_per_atom,ii,tid,offset);
|
||||
int i = BLOCK_ID_X*(BLOCK_SIZE_X)+tid;
|
||||
|
||||
if (i<nall) {
|
||||
int iO, iH1, iH2;
|
||||
iO = i;
|
||||
numtyp4 ix; fetch4(ix,i,pos_tex); //x_[i];
|
||||
int itype = ix.w;
|
||||
if (itype == typeO){
|
||||
int iH1, iH2, iO;
|
||||
iH1 = hneigh[i*4 ];
|
||||
iH2 = hneigh[i*4+1];
|
||||
iO = i;
|
||||
numtyp qO; fetch(qO,iO,q_tex);
|
||||
compute_newsite(iO,iH1,iH2, &m[iO], qO, alpha, x_);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
__kernel void k_lj_tip4p_long(const __global numtyp4 *restrict x_,
|
||||
const __global numtyp4 *restrict lj1,
|
||||
const __global numtyp4 *restrict lj3,
|
||||
const int lj_types,
|
||||
const __global numtyp *restrict sp_lj,
|
||||
const __global int * dev_nbor,
|
||||
const __global int * dev_packed,
|
||||
__global acctyp4 *restrict ans,
|
||||
__global acctyp *restrict engv,
|
||||
const int eflag, const int vflag, const int inum,
|
||||
const int nbor_pitch, const int t_per_atom,
|
||||
__global int *restrict hneigh,
|
||||
__global numtyp4 *restrict m,
|
||||
const int typeO, const int typeH,
|
||||
const numtyp alpha,
|
||||
const __global numtyp *restrict q_,
|
||||
const __global numtyp *restrict cutsq,
|
||||
const numtyp qqrd2e, const numtyp g_ewald,
|
||||
const numtyp cut_coulsq, const numtyp cut_coulsqplus,
|
||||
const __global int *restrict tag, const __global int *restrict map,
|
||||
const __global int *restrict sametag, __global acctyp4 *restrict ansO) {
|
||||
int tid, ii, offset;
|
||||
atom_info(t_per_atom,ii,tid,offset);
|
||||
|
||||
const numtyp eq_zero = 1e-6;
|
||||
|
||||
acctyp energy = (acctyp)0;
|
||||
acctyp e_coul = (acctyp)0;
|
||||
acctyp4 f, fO;
|
||||
f.x=(acctyp)0; f.y=(acctyp)0; f.z=(acctyp)0;
|
||||
fO.x=(acctyp)0; fO.y=(acctyp)0; fO.z=(acctyp)0;
|
||||
acctyp virial[6],vO[6];
|
||||
for (int i=0; i<6; i++) {
|
||||
virial[i]=(acctyp)0;
|
||||
vO[i]=(acctyp)0;
|
||||
}
|
||||
|
||||
if (ii<inum) {
|
||||
int i, numj, nbor, nbor_end;
|
||||
__local int n_stride;
|
||||
nbor_info(dev_nbor,dev_packed,nbor_pitch,t_per_atom,ii,offset,i,numj,
|
||||
n_stride,nbor_end,nbor);
|
||||
|
||||
numtyp4 ix; fetch4(ix,i,pos_tex); //x_[i];
|
||||
numtyp qtmp; fetch(qtmp,i,q_tex);
|
||||
int itype = ix.w;
|
||||
numtyp4 x1 = ix;
|
||||
|
||||
int non_local_oxy = 0;
|
||||
int iH1, iH2, iO;
|
||||
|
||||
if(itype == typeO) {
|
||||
iO = i;
|
||||
iH1 = hneigh[i*4 ];
|
||||
iH2 = hneigh[i*4+1];
|
||||
x1 = m[iO];
|
||||
} else {
|
||||
iO = hneigh[i *4 ];
|
||||
iH1 = hneigh[iO*4 ];
|
||||
iH2 = hneigh[iO*4+1];
|
||||
if (iO >= inum) {
|
||||
non_local_oxy = 1;
|
||||
}
|
||||
}
|
||||
|
||||
for ( ; nbor<nbor_end; nbor+=n_stride) {
|
||||
int j=dev_packed[nbor];
|
||||
|
||||
numtyp factor_lj,factor_coul;
|
||||
factor_lj = sp_lj[sbmask(j)];
|
||||
factor_coul = (numtyp)1.0-sp_lj[sbmask(j)+4];
|
||||
j &= NEIGHMASK;
|
||||
|
||||
numtyp4 jx; fetch4(jx,j,pos_tex); //x_[j];
|
||||
int jtype = jx.w;
|
||||
|
||||
// Compute r12
|
||||
numtyp delx = ix.x-jx.x;
|
||||
numtyp dely = ix.y-jx.y;
|
||||
numtyp delz = ix.z-jx.z;
|
||||
numtyp rsq = delx*delx+dely*dely+delz*delz;
|
||||
|
||||
int mtype = itype*lj_types+jtype;
|
||||
if (rsq < lj1[mtype].z) { // cut_ljsq
|
||||
numtyp r2inv = ucl_recip(rsq);
|
||||
numtyp r6inv = r2inv*r2inv*r2inv;
|
||||
numtyp forcelj = r6inv*(lj1[mtype].x*r6inv-lj1[mtype].y);
|
||||
forcelj *= r2inv*factor_lj;
|
||||
|
||||
f.x += delx*forcelj;
|
||||
f.y += dely*forcelj;
|
||||
f.z += delz*forcelj;
|
||||
|
||||
if (eflag>0) {
|
||||
numtyp e = r6inv * (lj3[mtype].x*r6inv-lj3[mtype].y);
|
||||
energy += factor_lj * (e - lj3[mtype].z);
|
||||
}
|
||||
if (vflag>0) {
|
||||
virial[0] += delx*delx*forcelj;
|
||||
virial[1] += dely*dely*forcelj;
|
||||
virial[2] += delz*delz*forcelj;
|
||||
virial[3] += delx*dely*forcelj;
|
||||
virial[4] += delx*delz*forcelj;
|
||||
virial[5] += dely*delz*forcelj;
|
||||
}
|
||||
} // if LJ
|
||||
|
||||
if (rsq < cut_coulsqplus) { //cut_coulsqplus
|
||||
int jH1, jH2, jO;
|
||||
numtyp qj; fetch(qj,j,q_tex);
|
||||
numtyp4 x2 = jx;
|
||||
if(itype == typeO || jtype == typeO) {
|
||||
if (jtype == typeO) {
|
||||
jO = j;
|
||||
jH1 = hneigh[j*4 ];
|
||||
jH2 = hneigh[j*4+1];
|
||||
x2 = m[j];
|
||||
}
|
||||
delx = x1.x-x2.x;
|
||||
dely = x1.y-x2.y;
|
||||
delz = x1.z-x2.z;
|
||||
rsq = delx*delx+dely*dely+delz*delz;
|
||||
}
|
||||
if (rsq < cut_coulsq) {
|
||||
numtyp r2inv = ucl_recip(rsq);
|
||||
numtyp r = ucl_rsqrt(r2inv);
|
||||
numtyp grij = g_ewald * r;
|
||||
numtyp expm2 = ucl_exp(-grij*grij);
|
||||
numtyp t = ucl_recip((numtyp)1.0 + EWALD_P*grij);
|
||||
numtyp _erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
|
||||
|
||||
numtyp prefactor = qj;
|
||||
prefactor *= qqrd2e*qtmp/r;
|
||||
numtyp force_coul = r2inv*prefactor * (_erfc + EWALD_F*grij*expm2 - factor_coul);
|
||||
|
||||
if (itype == typeH) {
|
||||
f.x += delx * force_coul;
|
||||
f.y += dely * force_coul;
|
||||
f.z += delz * force_coul;
|
||||
f.w += 0;
|
||||
} else {
|
||||
fO.x += delx * force_coul;
|
||||
fO.y += dely * force_coul;
|
||||
fO.z += delz * force_coul;
|
||||
fO.w += 0;
|
||||
}
|
||||
if (eflag>0) {
|
||||
e_coul += prefactor*(_erfc-factor_coul);
|
||||
}
|
||||
if (vflag>0) {
|
||||
acctyp4 fd;
|
||||
fd.x = delx*force_coul;
|
||||
fd.y = dely*force_coul;
|
||||
fd.z = delz*force_coul;
|
||||
if (itype == typeH) {
|
||||
if (jtype == typeH){
|
||||
virial[0] += delx*fd.x;
|
||||
virial[1] += dely*fd.y;
|
||||
virial[2] += delz*fd.z;
|
||||
virial[3] += delx*fd.y;
|
||||
virial[4] += delx*fd.z;
|
||||
virial[5] += dely*fd.z;
|
||||
} else {
|
||||
numtyp cO = 1 - alpha, cH = 0.5*alpha;
|
||||
numtyp4 vdj;
|
||||
numtyp4 xjH1; fetch4(xjH1,jH1,pos_tex);
|
||||
numtyp4 xjH2; fetch4(xjH2,jH2,pos_tex);
|
||||
numtyp4 xjO; fetch4(xjO,jO,pos_tex);
|
||||
vdj.x = xjO.x*cO + xjH1.x*cH + xjH2.x*cH;
|
||||
vdj.y = xjO.y*cO + xjH1.y*cH + xjH2.y*cH;
|
||||
vdj.z = xjO.z*cO + xjH1.z*cH + xjH2.z*cH;
|
||||
//vdj.w = vdj.w;
|
||||
virial[0] += (ix.x - vdj.x)*fd.x;
|
||||
virial[1] += (ix.y - vdj.y)*fd.y;
|
||||
virial[2] += (ix.z - vdj.z)*fd.z;
|
||||
virial[3] += (ix.x - vdj.x)*fd.y;
|
||||
virial[4] += (ix.x - vdj.x)*fd.z;
|
||||
virial[5] += (ix.y - vdj.y)*fd.z;
|
||||
}
|
||||
} else {
|
||||
numtyp cO = 1 - alpha, cH = 0.5*alpha;
|
||||
numtyp4 vdi, vdj;
|
||||
numtyp4 xH1; fetch4(xH1,iH1,pos_tex);
|
||||
numtyp4 xH2; fetch4(xH2,iH2,pos_tex);
|
||||
numtyp4 xO; fetch4(xO,iO,pos_tex);
|
||||
vdi.x = xO.x*cO + xH1.x*cH + xH2.x*cH;
|
||||
vdi.y = xO.y*cO + xH1.y*cH + xH2.y*cH;
|
||||
vdi.z = xO.z*cO + xH1.z*cH + xH2.z*cH;
|
||||
//vdi.w = vdi.w;
|
||||
if (jtype != typeH){
|
||||
numtyp4 xjH1; fetch4(xjH1,jH1,pos_tex);
|
||||
numtyp4 xjH2; fetch4(xjH2,jH2,pos_tex);
|
||||
numtyp4 xjO; fetch4(xjO,jO,pos_tex);
|
||||
vdj.x = xjO.x*cO + xjH1.x*cH + xjH2.x*cH;
|
||||
vdj.y = xjO.y*cO + xjH1.y*cH + xjH2.y*cH;
|
||||
vdj.z = xjO.z*cO + xjH1.z*cH + xjH2.z*cH;
|
||||
//vdj.w = vdj.w;
|
||||
} else vdj = jx;
|
||||
vO[0] += 0.5*(vdi.x - vdj.x)*fd.x;
|
||||
vO[1] += 0.5*(vdi.y - vdj.y)*fd.y;
|
||||
vO[2] += 0.5*(vdi.z - vdj.z)*fd.z;
|
||||
vO[3] += 0.5*(vdi.x - vdj.x)*fd.y;
|
||||
vO[4] += 0.5*(vdi.x - vdj.x)*fd.z;
|
||||
vO[5] += 0.5*(vdi.y - vdj.y)*fd.z;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (non_local_oxy == 1) {
|
||||
if (iO == j) {
|
||||
x2 = ix;
|
||||
qj = qtmp;
|
||||
}
|
||||
numtyp4 x1m = m[iO];
|
||||
delx = x1m.x-x2.x;
|
||||
dely = x1m.y-x2.y;
|
||||
delz = x1m.z-x2.z;
|
||||
rsq = delx*delx+dely*dely+delz*delz;
|
||||
if (rsq < cut_coulsq) {
|
||||
numtyp r2inv = ucl_recip(rsq);
|
||||
numtyp r = ucl_rsqrt(r2inv);
|
||||
numtyp grij = g_ewald * r;
|
||||
numtyp expm2 = ucl_exp(-grij*grij);
|
||||
numtyp t = ucl_recip((numtyp)1.0 + EWALD_P*grij);
|
||||
numtyp _erfc = t * (A1+t*(A2+t*(A3+t*(A4+t*A5)))) * expm2;
|
||||
|
||||
numtyp prefactor = qj;
|
||||
prefactor *= qqrd2e*x1m.w/r;
|
||||
numtyp force_coul = r2inv*prefactor * (_erfc + EWALD_F*grij*expm2 - factor_coul);
|
||||
|
||||
numtyp cO = 1 - alpha, cH = 0.5*alpha;
|
||||
numtyp4 fd;
|
||||
fd.x = delx * force_coul * cH;
|
||||
fd.y = dely * force_coul * cH;
|
||||
fd.z = delz * force_coul * cH;
|
||||
|
||||
f.x += fd.x;
|
||||
f.y += fd.y;
|
||||
f.z += fd.z;
|
||||
|
||||
if (eflag>0) {
|
||||
e_coul += prefactor*(_erfc-factor_coul) * (acctyp)0.5 * alpha;
|
||||
}
|
||||
if (vflag>0) {
|
||||
numtyp4 xH1; fetch4(xH1,iH1,pos_tex);
|
||||
numtyp4 xH2; fetch4(xH2,iH2,pos_tex);
|
||||
numtyp4 xO; fetch4(xO,iO,pos_tex);
|
||||
|
||||
virial[0] += ((xO.x*cO + xH1.x*cH + xH2.x*cH) - x2.x) * fd.x;
|
||||
virial[1] += ((xO.y*cO + xH1.y*cH + xH2.y*cH) - x2.y) * fd.y;
|
||||
virial[2] += ((xO.z*cO + xH1.z*cH + xH2.z*cH) - x2.z) * fd.z;
|
||||
virial[3] += ((xO.x*cO + xH1.x*cH + xH2.x*cH) - x2.x) * fd.y;
|
||||
virial[4] += ((xO.x*cO + xH1.x*cH + xH2.x*cH) - x2.x) * fd.z;
|
||||
virial[5] += ((xO.y*cO + xH1.y*cH + xH2.y*cH) - x2.y) * fd.z;
|
||||
}
|
||||
}
|
||||
}
|
||||
} // if cut_coulsqplus
|
||||
} // for nbor
|
||||
if (t_per_atom>1) {
|
||||
#if (ARCH < 300)
|
||||
__local acctyp red_acc[6][BLOCK_PAIR];
|
||||
red_acc[0][tid]=fO.x;
|
||||
red_acc[1][tid]=fO.y;
|
||||
red_acc[2][tid]=fO.z;
|
||||
red_acc[3][tid]=fO.w;
|
||||
for (unsigned int s=t_per_atom/2; s>0; s>>=1) {
|
||||
if (offset < s) {
|
||||
for (int r=0; r<4; r++)
|
||||
red_acc[r][tid] += red_acc[r][tid+s];
|
||||
}
|
||||
}
|
||||
fO.x=red_acc[0][tid];
|
||||
fO.y=red_acc[1][tid];
|
||||
fO.z=red_acc[2][tid];
|
||||
fO.w=red_acc[3][tid];
|
||||
if (vflag>0) {
|
||||
for (int r=0; r<6; r++) red_acc[r][tid]=vO[r];
|
||||
for (unsigned int s=t_per_atom/2; s>0; s>>=1) {
|
||||
if (offset < s) {
|
||||
for (int r=0; r<6; r++)
|
||||
red_acc[r][tid] += red_acc[r][tid+s];
|
||||
}
|
||||
}
|
||||
for (int r=0; r<6; r++) vO[r]=red_acc[r][tid];
|
||||
}
|
||||
#else
|
||||
for (unsigned int s=t_per_atom/2; s>0; s>>=1) {
|
||||
fO.x += shfl_xor(fO.x, s, t_per_atom);
|
||||
fO.y += shfl_xor(fO.y, s, t_per_atom);
|
||||
fO.z += shfl_xor(fO.z, s, t_per_atom);
|
||||
fO.w += shfl_xor(fO.w, s, t_per_atom);
|
||||
}
|
||||
if (vflag>0) {
|
||||
for (unsigned int s=t_per_atom/2; s>0; s>>=1) {
|
||||
for (int r=0; r<6; r++)
|
||||
vO[r] += shfl_xor(vO[r], s, t_per_atom);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
if(offset == 0) {
|
||||
ansO[i] = fO;
|
||||
if (vflag>0) {
|
||||
ansO[inum + i].x = vO[0];
|
||||
ansO[inum + i].y = vO[1];
|
||||
ansO[inum + i].z = vO[2];
|
||||
ansO[inum*2 + i].x = vO[3];
|
||||
ansO[inum*2 + i].y = vO[4];
|
||||
ansO[inum*2 + i].z = vO[5];
|
||||
}
|
||||
}
|
||||
store_answers_q(f,energy,e_coul,virial,ii,inum,tid,t_per_atom,offset,eflag,
|
||||
vflag,ans,engv);
|
||||
} // if ii
|
||||
}
|
||||
|
||||
__kernel void k_lj_tip4p_long_fast(){}
|
|
@ -0,0 +1,127 @@
|
|||
/**************************************************************************
|
||||
lj_tip4p_long.h
|
||||
-------------------
|
||||
V. Nikolskiy (HSE)
|
||||
|
||||
Class for acceleration of the lj/tip4p/long pair style
|
||||
|
||||
__________________________________________________________________________
|
||||
This file is part of the LAMMPS Accelerator Library (LAMMPS_AL)
|
||||
__________________________________________________________________________
|
||||
|
||||
begin :
|
||||
email : thevsevak@gmail.com
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef LAL_LJ_TIP4P_LONG_H
|
||||
#define LAL_LJ_TIP4P_LONG_H
|
||||
|
||||
#include "lal_base_charge.h"
|
||||
|
||||
namespace LAMMPS_AL {
|
||||
|
||||
template <class numtyp, class acctyp>
|
||||
class LJ_TIP4PLong : public BaseCharge<numtyp, acctyp> {
|
||||
public:
|
||||
LJ_TIP4PLong();
|
||||
~LJ_TIP4PLong();
|
||||
|
||||
/// Clear any previous data and set up for a new LAMMPS run
|
||||
/** \param max_nbors initial number of rows in the neighbor matrix
|
||||
* \param cell_size cutoff + skin
|
||||
* \param gpu_split fraction of particles handled by device
|
||||
*
|
||||
* Returns:
|
||||
* - 0 if successfull
|
||||
* - -1 if fix gpu not found
|
||||
* - -3 if there is an out of memory error
|
||||
* - -4 if the GPU library was not compiled for GPU
|
||||
* - -5 Double precision is not supported on card **/
|
||||
int init(const int ntypes, double **host_cutsq,
|
||||
double **host_lj1, double **host_lj2, double **host_lj3,
|
||||
double **host_lj4, double **host_offset, double *host_special_lj,
|
||||
const int nlocal, const int tH, const int tO,
|
||||
const double alpha, const double qdist,
|
||||
const int nall, const int max_nbors,
|
||||
const int maxspecial, const double cell_size,
|
||||
const double gpu_split, FILE *screen,
|
||||
double **host_cut_ljsq,
|
||||
const double host_cut_coulsq, const double host_cut_coulsqplus,
|
||||
double *host_special_coul, const double qqrd2e,
|
||||
const double g_ewald, int map_size,int max_same);
|
||||
|
||||
/// Clear all host and device data
|
||||
/** \note This is called at the beginning of the init() routine **/
|
||||
void clear();
|
||||
|
||||
/// Returns memory usage on device per atom
|
||||
int bytes_per_atom(const int max_nbors) const;
|
||||
|
||||
/// Total host memory used by library for pair style
|
||||
double host_memory_usage() const;
|
||||
|
||||
/// Copy data from LAMMPS_NS
|
||||
void copy_relations_data(int n,int* tag, int *map_array, int map_size,
|
||||
int *sametag, int max_same, int ago);
|
||||
|
||||
/// Reimplement BaseCharge pair loop with host neighboring
|
||||
void compute(const int f_ago, const int inum_full, const int nall,
|
||||
double **host_x, int *host_type, int *ilist, int *numj,
|
||||
int **firstneigh, const bool eflag, const bool vflag,
|
||||
const bool eatom, const bool vatom, int &host_start,
|
||||
const double cpu_time, bool &success, double *charge,
|
||||
const int nlocal, double *boxlo, double *prd);
|
||||
|
||||
/// Reimplement BaseCharge pair loop with device neighboring
|
||||
int** compute(const int ago, const int inum_full, const int nall,
|
||||
double **host_x, int *host_type, double *sublo,
|
||||
double *subhi, tagint *tag,int *map_array, int map_size, int *sametag, int max_same,
|
||||
int **nspecial,
|
||||
tagint **special, const bool eflag, const bool vflag,
|
||||
const bool eatom, const bool vatom, int &host_start,
|
||||
int **ilist, int **numj, const double cpu_time, bool &success,
|
||||
double *charge, double *boxlo, double *prd);
|
||||
|
||||
|
||||
// --------------------------- TYPE DATA --------------------------
|
||||
|
||||
/// lj1.x = lj1, lj1.y = lj2, lj1.z = cutsq_vdw
|
||||
UCL_D_Vec<numtyp4> lj1;
|
||||
/// lj3.x = lj3, lj3.y = lj4, lj3.z = offset
|
||||
UCL_D_Vec<numtyp4> lj3;
|
||||
/// cutsq
|
||||
UCL_D_Vec<numtyp> cutsq;
|
||||
/// Special LJ values [0-3] and Special Coul values [4-7]
|
||||
UCL_D_Vec<numtyp> sp_lj;
|
||||
|
||||
bool shared_types;
|
||||
|
||||
/// Number of atom types
|
||||
int _lj_types;
|
||||
|
||||
numtyp _qqrd2e, _g_ewald;
|
||||
/// TIP4P water parameters
|
||||
int TypeO, TypeH;
|
||||
numtyp alpha, qdist;
|
||||
numtyp cut_coulsq, cut_coulsqplus;
|
||||
|
||||
UCL_D_Vec<int> hneight;
|
||||
UCL_D_Vec<numtyp4> m; // position and charge of virtual particle
|
||||
UCL_D_Vec<acctyp4> ansO; // force applied to virtual particle
|
||||
// UCL_D_Vec<acctyp4> force_comp;
|
||||
|
||||
UCL_D_Vec<int> tag;
|
||||
UCL_D_Vec<int> map_array;
|
||||
UCL_D_Vec<int> atom_sametag;
|
||||
|
||||
UCL_Kernel k_pair_distrib, k_pair_reneigh, k_pair_newsite;
|
||||
|
||||
private:
|
||||
bool _allocated;
|
||||
int t_ago;
|
||||
void loop(const bool _eflag, const bool _vflag);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
#endif
|
|
@ -0,0 +1,147 @@
|
|||
/***************************************************************************
|
||||
lj_tip4p_long_ext.cpp
|
||||
-------------------
|
||||
V. Nikolskiy (HSE)
|
||||
|
||||
Functions for LAMMPS access to lj/tip4p/long acceleration functions
|
||||
|
||||
__________________________________________________________________________
|
||||
This file is part of the LAMMPS Accelerator Library (LAMMPS_AL)
|
||||
__________________________________________________________________________
|
||||
|
||||
begin :
|
||||
email : thevsevak@gmail.com
|
||||
***************************************************************************/
|
||||
|
||||
#include <iostream>
|
||||
#include <cassert>
|
||||
#include <cmath>
|
||||
|
||||
#include "lal_lj_tip4p_long.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace LAMMPS_AL;
|
||||
|
||||
static LJ_TIP4PLong<PRECISION,ACC_PRECISION> LJTIP4PLMF;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Allocate memory on host and device and copy constants to device
|
||||
// ---------------------------------------------------------------------------
|
||||
int ljtip4p_long_gpu_init(const int ntypes, double **cutsq, double **host_lj1,
|
||||
double **host_lj2, double **host_lj3, double **host_lj4,
|
||||
double **offset, double *special_lj, const int inum,
|
||||
const int tH, const int tO,
|
||||
const double alpha, const double qdist,
|
||||
const int nall, const int max_nbors, const int maxspecial,
|
||||
const double cell_size, int &gpu_mode, FILE *screen,
|
||||
double **host_cut_ljsq,
|
||||
const double host_cut_coulsq, const double host_cut_coulsqplus,
|
||||
double *host_special_coul, const double qqrd2e,
|
||||
const double g_ewald, int map_size,int max_same) {
|
||||
LJTIP4PLMF.clear();
|
||||
gpu_mode=LJTIP4PLMF.device->gpu_mode();
|
||||
double gpu_split=LJTIP4PLMF.device->particle_split();
|
||||
int first_gpu=LJTIP4PLMF.device->first_device();
|
||||
int last_gpu=LJTIP4PLMF.device->last_device();
|
||||
int world_me=LJTIP4PLMF.device->world_me();
|
||||
int gpu_rank=LJTIP4PLMF.device->gpu_rank();
|
||||
int procs_per_gpu=LJTIP4PLMF.device->procs_per_gpu();
|
||||
|
||||
LJTIP4PLMF.device->init_message(screen,"lj/cut/tip4p/long/gpu",first_gpu,last_gpu);
|
||||
|
||||
bool message=false;
|
||||
if (LJTIP4PLMF.device->replica_me()==0 && screen)
|
||||
message=true;
|
||||
|
||||
if (message) {
|
||||
fprintf(screen,"Initializing Device and compiling on process 0...");
|
||||
fflush(screen);
|
||||
}
|
||||
|
||||
int init_ok=0;
|
||||
if (world_me==0)
|
||||
init_ok=LJTIP4PLMF.init(ntypes, cutsq, host_lj1, host_lj2, host_lj3,
|
||||
host_lj4, offset, special_lj, inum,
|
||||
tH, tO, alpha, qdist, nall, 300,
|
||||
maxspecial, cell_size, gpu_split, screen,
|
||||
host_cut_ljsq, host_cut_coulsq, host_cut_coulsqplus,
|
||||
host_special_coul, qqrd2e, g_ewald, map_size, max_same);
|
||||
|
||||
LJTIP4PLMF.device->world_barrier();
|
||||
if (message)
|
||||
fprintf(screen,"Done.\n");
|
||||
|
||||
for (int i=0; i<procs_per_gpu; i++) {
|
||||
if (message) {
|
||||
if (last_gpu-first_gpu==0)
|
||||
fprintf(screen,"Initializing Device %d on core %d...",first_gpu,i);
|
||||
else
|
||||
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=LJTIP4PLMF.init(ntypes, cutsq, host_lj1, host_lj2, host_lj3, host_lj4,
|
||||
offset, special_lj, inum,
|
||||
tH, tO, alpha, qdist, nall, 300, maxspecial,
|
||||
cell_size, gpu_split, screen, host_cut_ljsq,
|
||||
host_cut_coulsq, host_cut_coulsqplus,
|
||||
host_special_coul, qqrd2e,
|
||||
g_ewald, map_size, max_same);
|
||||
|
||||
LJTIP4PLMF.device->gpu_barrier();
|
||||
if (message)
|
||||
fprintf(screen,"Done.\n");
|
||||
}
|
||||
if (message)
|
||||
fprintf(screen,"\n");
|
||||
|
||||
if (init_ok==0)
|
||||
LJTIP4PLMF.estimate_gpu_overhead();
|
||||
return init_ok;
|
||||
}
|
||||
|
||||
void ljtip4p_long_gpu_clear() {
|
||||
LJTIP4PLMF.clear();
|
||||
}
|
||||
|
||||
int ** ljtip4p_long_gpu_compute_n(const int ago, const int inum_full,
|
||||
const int nall, double **host_x, int *host_type,
|
||||
double *sublo, double *subhi,
|
||||
tagint *tag, int *map_array, int map_size,
|
||||
int *sametag, int max_same,
|
||||
int **nspecial,
|
||||
tagint **special, const bool eflag, const bool vflag,
|
||||
const bool eatom, const bool vatom, int &host_start,
|
||||
int **ilist, int **jnum, const double cpu_time,
|
||||
bool &success, double *host_q, double *boxlo,
|
||||
double *prd) {
|
||||
return LJTIP4PLMF.compute(ago, inum_full, nall, host_x, host_type, sublo,
|
||||
subhi, tag, map_array, map_size, sametag, max_same,
|
||||
nspecial, special, eflag, vflag, eatom,
|
||||
vatom, host_start, ilist, jnum, cpu_time, success,
|
||||
host_q,boxlo, prd);
|
||||
}
|
||||
|
||||
void ljtip4p_long_gpu_compute(const int ago, const int inum_full, const int nall,
|
||||
double **host_x, int *host_type, int *ilist, int *numj,
|
||||
int **firstneigh, const bool eflag, const bool vflag,
|
||||
const bool eatom, const bool vatom, int &host_start,
|
||||
const double cpu_time, bool &success,double *host_q,
|
||||
const int nlocal, double *boxlo, double *prd) {
|
||||
LJTIP4PLMF.compute(ago,inum_full,nall,host_x,host_type,ilist,numj,
|
||||
firstneigh,eflag,vflag,eatom,vatom,host_start,cpu_time,success,host_q,
|
||||
nlocal,boxlo,prd);
|
||||
}
|
||||
|
||||
double ljtip4p_long_gpu_bytes() {
|
||||
return LJTIP4PLMF.host_memory_usage();
|
||||
}
|
||||
|
||||
void ljtip4p_long_copy_molecule_data(int n, int* tag,
|
||||
int *map_array, int map_size,
|
||||
int *sametag, int max_same, int ago){
|
||||
LJTIP4PLMF.copy_relations_data(n, tag, map_array, map_size, sametag, max_same, ago);
|
||||
}
|
||||
|
||||
|
|
@ -143,6 +143,8 @@ action pair_ufm_gpu.cpp
|
|||
action pair_ufm_gpu.h
|
||||
action pair_lj_cut_dipole_long_gpu.cpp pair_lj_cut_dipole_long.cpp
|
||||
action pair_lj_cut_dipole_long_gpu.h pair_lj_cut_dipole_long.cpp
|
||||
action pair_lj_cut_tip4p_long_gpu.h
|
||||
action pair_lj_cut_tip4p_long_gpu.cpp
|
||||
|
||||
# edit 2 Makefile.package files to include/exclude package info
|
||||
|
||||
|
|
|
@ -0,0 +1,250 @@
|
|||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
http://lammps.sandia.gov, Sandia National Laboratories
|
||||
Steve Plimpton, sjplimp@sandia.gov
|
||||
|
||||
Copyright (2003) Sandia Corporation. Under the terms of Contract
|
||||
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
|
||||
certain rights in this software. This software is distributed under
|
||||
the GNU General Public License.
|
||||
|
||||
See the README file in the top-level LAMMPS directory.
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
Contributing author: Vsevolod Nikolskiy (HSE)
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#include <cmath>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <cstring>
|
||||
#include "pair_lj_cut_tip4p_long_gpu.h"
|
||||
#include "atom.h"
|
||||
#include "atom_vec.h"
|
||||
#include "comm.h"
|
||||
#include "force.h"
|
||||
#include "neighbor.h"
|
||||
#include "neigh_list.h"
|
||||
#include "integrate.h"
|
||||
#include "memory.h"
|
||||
#include "error.h"
|
||||
#include "neigh_request.h"
|
||||
#include "universe.h"
|
||||
#include "update.h"
|
||||
#include "domain.h"
|
||||
#include "kspace.h"
|
||||
#include "angle.h"
|
||||
#include "bond.h"
|
||||
#include "gpu_extra.h"
|
||||
|
||||
#define EWALD_F 1.12837917
|
||||
#define EWALD_P 0.3275911
|
||||
#define A1 0.254829592
|
||||
#define A2 -0.284496736
|
||||
#define A3 1.421413741
|
||||
#define A4 -1.453152027
|
||||
#define A5 1.061405429
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
|
||||
// External functions from cuda library for atom decomposition
|
||||
|
||||
int ljtip4p_long_gpu_init(const int ntypes, double **cutsq, double **host_lj1,
|
||||
double **host_lj2, double **host_lj3, double **host_lj4,
|
||||
double **offset, double *special_lj, const int nlocal,
|
||||
const int tH, const int tO, const double alpha, const double qdist,
|
||||
const int nall, const int max_nbors, const int maxspecial,
|
||||
const double cell_size, int &gpu_mode, FILE *screen,
|
||||
double **host_cut_ljsq, const double host_cut_coulsq,
|
||||
const double host_cut_coulsqplus, double *host_special_coul,
|
||||
const double qqrd2e, const double g_ewald,
|
||||
int map_size, int max_same);
|
||||
void ljtip4p_long_gpu_clear();
|
||||
int ** ljtip4p_long_gpu_compute_n(const int ago, const int inum,
|
||||
const int nall, double **host_x, int *host_type,
|
||||
double *sublo, double *subhi,
|
||||
tagint *tag, int *map_array, int map_size,
|
||||
int *sametag, int max_same,
|
||||
int **nspecial,
|
||||
tagint **special, const bool eflag, const bool vflag,
|
||||
const bool eatom, const bool vatom, int &host_start,
|
||||
int **ilist, int **jnum,
|
||||
const double cpu_time, bool &success, double *host_q,
|
||||
double *boxlo, double *prd);
|
||||
void ljtip4p_long_gpu_compute(const int ago, const int inum, const int nall,
|
||||
double **host_x, int *host_type, int *ilist, int *numj,
|
||||
int **firstneigh, const bool eflag, const bool vflag,
|
||||
const bool eatom, const bool vatom, int &host_start,
|
||||
const double cpu_time,
|
||||
bool &success, double *host_q, const int nlocal,
|
||||
double *boxlo, double *prd);
|
||||
double ljtip4p_long_gpu_bytes();
|
||||
void ljtip4p_long_copy_molecule_data(int, int* , int *,
|
||||
int, int *, int , int);
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
PairLJCutTIP4PLongGPU::PairLJCutTIP4PLongGPU(LAMMPS *lmp)
|
||||
: PairLJCutTIP4PLong(lmp), gpu_mode(GPU_FORCE)
|
||||
{
|
||||
respa_enable = 0;
|
||||
reinitflag = 0;
|
||||
cpu_time = 0.0;
|
||||
GPU_EXTRA::gpu_ready(lmp->modify, lmp->error);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
free all arrays
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
PairLJCutTIP4PLongGPU::~PairLJCutTIP4PLongGPU()
|
||||
{
|
||||
ljtip4p_long_gpu_clear();
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void PairLJCutTIP4PLongGPU::compute(int eflag, int vflag)
|
||||
{
|
||||
|
||||
if (eflag || vflag) ev_setup(eflag,vflag);
|
||||
else evflag = vflag_fdotr = 0;
|
||||
|
||||
int nall = atom->nlocal + atom->nghost;
|
||||
int inum, host_start;
|
||||
|
||||
bool success = true;
|
||||
int *ilist, *numneigh, **firstneigh;
|
||||
if (gpu_mode != GPU_FORCE) {
|
||||
inum = atom->nlocal;
|
||||
firstneigh = ljtip4p_long_gpu_compute_n(neighbor->ago, inum, nall,
|
||||
atom->x, atom->type, domain->sublo,
|
||||
domain->subhi,
|
||||
atom->tag, atom->get_map_array(), atom->get_map_size(),
|
||||
atom->sametag, atom->get_max_same(),
|
||||
atom->nspecial,
|
||||
atom->special, eflag, vflag, eflag_atom,
|
||||
vflag_atom, host_start, &ilist, &numneigh,
|
||||
cpu_time, success, atom->q, domain->boxlo,
|
||||
domain->prd);
|
||||
} else {
|
||||
inum = list->inum;
|
||||
ilist = list->ilist;
|
||||
numneigh = list->numneigh;
|
||||
firstneigh = list->firstneigh;
|
||||
ljtip4p_long_copy_molecule_data(nall, atom->tag,
|
||||
atom->get_map_array(), atom->get_map_size(),
|
||||
atom->sametag, atom->get_max_same(), neighbor->ago);
|
||||
ljtip4p_long_gpu_compute(neighbor->ago, inum, nall, atom->x, atom->type,
|
||||
ilist, numneigh, firstneigh, eflag, vflag, eflag_atom,
|
||||
vflag_atom, host_start, cpu_time, success, atom->q,
|
||||
atom->nlocal, domain->boxlo, domain->prd);
|
||||
}
|
||||
if (!success)
|
||||
error->one(FLERR,"Insufficient memory on accelerator");
|
||||
|
||||
// if (host_start<inum) {
|
||||
// cpu_time = MPI_Wtime();
|
||||
// cpu_compute(host_start, inum, eflag, vflag, ilist, numneigh, firstneigh);
|
||||
// cpu_time = MPI_Wtime() - cpu_time;
|
||||
// }
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
init specific to this pair style
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void PairLJCutTIP4PLongGPU::init_style()
|
||||
{
|
||||
|
||||
cut_respa = NULL;
|
||||
if (atom->tag_enable == 0)
|
||||
error->all(FLERR,"Pair style lj/cut/tip4p/long/gpu requires atom IDs");
|
||||
if (!atom->q_flag)
|
||||
error->all(FLERR,
|
||||
"Pair style lj/cut/tip4p/long/gpu requires atom attribute q");
|
||||
if (force->bond == NULL)
|
||||
error->all(FLERR,"Must use a bond style with TIP4P potential");
|
||||
if (force->angle == NULL)
|
||||
error->all(FLERR,"Must use an angle style with TIP4P potential");
|
||||
|
||||
if (atom->map_style == 2)
|
||||
error->all(FLERR,"GPU-accelerated lj/cut/tip4p/long currently"
|
||||
" requires map style 'array' (atom_modify map array)");
|
||||
|
||||
//PairLJCutCoulLong::init_style();
|
||||
// Repeat cutsq calculation because done after call to init_style
|
||||
double maxcut = -1.0;
|
||||
double cut;
|
||||
for (int i = 1; i <= atom->ntypes; i++) {
|
||||
for (int j = i; j <= atom->ntypes; j++) {
|
||||
if (setflag[i][j] != 0 || (setflag[i][i] != 0 && setflag[j][j] != 0)) {
|
||||
cut = init_one(i,j);
|
||||
cut *= cut;
|
||||
if (cut > maxcut)
|
||||
maxcut = cut;
|
||||
cutsq[i][j] = cutsq[j][i] = cut;
|
||||
} else
|
||||
cutsq[i][j] = cutsq[j][i] = 0.0;
|
||||
}
|
||||
}
|
||||
double cell_size = sqrt(maxcut) + neighbor->skin;
|
||||
|
||||
// insure use of KSpace long-range solver, set g_ewald
|
||||
if (force->kspace == NULL)
|
||||
error->all(FLERR,"Pair style requires a KSpace style");
|
||||
g_ewald = force->kspace->g_ewald;
|
||||
|
||||
// setup force tables
|
||||
if (ncoultablebits) init_tables(cut_coul,cut_respa);
|
||||
|
||||
int maxspecial=0;
|
||||
if (atom->molecular)
|
||||
maxspecial=atom->maxspecial;
|
||||
|
||||
// set alpha parameter
|
||||
double theta = force->angle->equilibrium_angle(typeA);
|
||||
double blen = force->bond->equilibrium_distance(typeB);
|
||||
alpha = qdist / (cos(0.5*theta) * blen);
|
||||
|
||||
cut_coulsq = cut_coul * cut_coul;
|
||||
double cut_coulsqplus = (cut_coul+qdist+blen) * (cut_coul+qdist+blen);
|
||||
if (maxcut < cut_coulsqplus) {
|
||||
cell_size = (cut_coul+qdist+blen) + neighbor->skin;
|
||||
}
|
||||
if (comm->cutghostuser < cell_size) {
|
||||
comm->cutghostuser = cell_size;
|
||||
if (comm->me == 0)
|
||||
error->warning(FLERR,"Increasing communication cutoff for TIP4P GPU style");
|
||||
}
|
||||
|
||||
int success = ljtip4p_long_gpu_init(atom->ntypes+1, cutsq, lj1, lj2, lj3, lj4,
|
||||
offset, force->special_lj, atom->nlocal,
|
||||
typeH, typeO, alpha, qdist,
|
||||
atom->nlocal+atom->nghost, 300, maxspecial,
|
||||
cell_size, gpu_mode, screen, cut_ljsq,
|
||||
cut_coulsq, cut_coulsqplus,
|
||||
force->special_coul, force->qqrd2e,
|
||||
g_ewald, atom->get_map_size(),
|
||||
atom->get_max_same());
|
||||
GPU_EXTRA::check_flag(success,error,world);
|
||||
if (gpu_mode == GPU_FORCE) {
|
||||
int irequest = neighbor->request(this,instance_me);
|
||||
neighbor->requests[irequest]->half = 0;
|
||||
neighbor->requests[irequest]->full = 1;
|
||||
neighbor->requests[irequest]->cut = 1;
|
||||
neighbor->requests[irequest]->cutoff = cut_coul+qdist+blen + neighbor->skin;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
double PairLJCutTIP4PLongGPU::memory_usage()
|
||||
{
|
||||
double bytes = PairLJCutTIP4PLong::memory_usage();
|
||||
return bytes + ljtip4p_long_gpu_bytes();
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
/* ----------------------------------------------------------------------
|
||||
LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator
|
||||
http://lammps.sandia.gov, Sandia National Laboratories
|
||||
Steve Plimpton, sjplimp@sandia.gov
|
||||
|
||||
Copyright (2003) Sandia Corporation. Under the terms of Contract
|
||||
DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains
|
||||
certain rights in this software. This software is distributed under
|
||||
the GNU General Public License.
|
||||
|
||||
See the README file in the top-level LAMMPS directory.
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
Contributing author: Vsevolod Nikolskiy (HSE)
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef PAIR_CLASS
|
||||
|
||||
PairStyle(lj/cut/tip4p/long/gpu,PairLJCutTIP4PLongGPU)
|
||||
|
||||
#else
|
||||
|
||||
#ifndef LMP_PAIR_LJ_TIP4P_LONG_GPU_H
|
||||
#define LMP_PAIR_LJ_TIP4P_LONG_GPU_H
|
||||
|
||||
#include "pair_lj_cut_tip4p_long.h"
|
||||
|
||||
namespace LAMMPS_NS {
|
||||
|
||||
class PairLJCutTIP4PLongGPU : public PairLJCutTIP4PLong {
|
||||
public:
|
||||
PairLJCutTIP4PLongGPU(LAMMPS *lmp);
|
||||
~PairLJCutTIP4PLongGPU();
|
||||
void compute(int, int);
|
||||
void init_style();
|
||||
double memory_usage();
|
||||
|
||||
enum { GPU_FORCE, GPU_NEIGH, GPU_HYB_NEIGH };
|
||||
|
||||
private:
|
||||
int gpu_mode;
|
||||
double cpu_time;
|
||||
};
|
||||
|
||||
}
|
||||
#endif
|
||||
#endif
|
|
@ -287,6 +287,7 @@ class Atom : protected Pointers {
|
|||
|
||||
inline int* get_map_array() {return map_array;};
|
||||
inline int get_map_size() {return map_tag_max+1;};
|
||||
inline int get_max_same() {return max_same;};
|
||||
inline int get_map_maxarray() {return map_maxarray+1;};
|
||||
|
||||
bigint memory_usage();
|
||||
|
|
Loading…
Reference in New Issue