forked from lijiext/lammps
Merge branch 'master' into next_patch_version
This commit is contained in:
commit
a3fd7345a7
.github
doc
examples
TIP4P/gpu_dump
data.spcedump.force_cpu.19Dec19.tip4p.g++.1dump.force_gpu.19Dec19.tip4p.g++.1.gtx1070.dpin.tip4plog.19Dec19.tip4p.g++.1log.19Dec19.tip4p.g++.1.gtx1070.dp
rigid
lib/gpu
Nvidia.makefileOpencl.makefile
geryon
lal_base_atomic.cpplal_base_charge.cpplal_base_dipole.cpplal_base_dpd.cpplal_base_ellipsoid.cpplal_base_three.cpplal_lj_tip4p_long.cpplal_lj_tip4p_long.culal_lj_tip4p_long.hlal_lj_tip4p_long_ext.cpppotentials
src
CLASS2
GPU
RIGID
USER-INTEL
USER-MEAMC
USER-OMP
USER-PHONON
atom.hfix_gravity.cppfix_gravity.hpair.hread_dump.cpp
|
@ -111,6 +111,7 @@ src/exceptions.h @rbberger
|
|||
src/fix_nh.* @athomps
|
||||
src/info.* @akohlmey @rbberger
|
||||
src/timer.* @akohlmey
|
||||
src/min* @sjplimp @stanmoore1
|
||||
|
||||
# tools
|
||||
tools/msi2lmp/* @akohlmey
|
||||
|
|
|
@ -88,7 +88,7 @@ command creates a per-atom array with 6 columns:
|
|||
|
||||
compute my_stress all stress/atom NULL
|
||||
fix 1 all ave/atom 10 20 1000 c_my_stress[\*]
|
||||
fix 1 all ave/atom 10 20 1000 c_my_stress[1] c_my_stress[1] &
|
||||
fix 1 all ave/atom 10 20 1000 c_my_stress[1] c_my_stress[2] &
|
||||
c_my_stress[3] c_my_stress[4] &
|
||||
c_my_stress[5] c_my_stress[6]
|
||||
|
||||
|
|
|
@ -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
|
||||
""""""
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ command creates a per-atom array with 6 columns:
|
|||
|
||||
compute my_stress all stress/atom NULL
|
||||
fix 1 all ave/atom 10 20 1000 c_my_stress\[*\]
|
||||
fix 1 all ave/atom 10 20 1000 c_my_stress\[1\] c_my_stress\[1\] &
|
||||
fix 1 all ave/atom 10 20 1000 c_my_stress\[1\] c_my_stress\[2\] &
|
||||
c_my_stress\[3\] c_my_stress\[4\] &
|
||||
c_my_stress\[5\] c_my_stress\[6\] :pre
|
||||
|
||||
|
|
|
@ -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
|
|
@ -0,0 +1,63 @@
|
|||
#Pour composite granular particles on flat wall
|
||||
|
||||
newton on
|
||||
atom_style sphere
|
||||
atom_modify map array sort 0 0
|
||||
|
||||
thermo_modify flush yes
|
||||
units si
|
||||
|
||||
variable minrad equal 0.5
|
||||
variable maxrad equal 1.4
|
||||
|
||||
variable skin equal 0.3*${maxrad}
|
||||
|
||||
boundary p p f
|
||||
region reg block 0 20 0 20 0 200 units box
|
||||
create_box 1 reg
|
||||
|
||||
fix prop all property/atom mol ghost yes
|
||||
|
||||
variable dumpfreq equal 1000
|
||||
variable logfreq equal 1000
|
||||
|
||||
pair_style gran/hooke/history 4e5 NULL 1e2 NULL 0.5 0
|
||||
pair_coeff * *
|
||||
|
||||
timestep 0.0001
|
||||
|
||||
group particles type 1
|
||||
atom_modify first particles
|
||||
|
||||
neighbor ${skin} bin
|
||||
group rigid type 1
|
||||
neigh_modify every 1 delay 0 check yes exclude molecule/intra all
|
||||
|
||||
thermo ${logfreq}
|
||||
thermo_style custom step cpu atoms ke
|
||||
thermo_modify flush yes lost warn
|
||||
|
||||
comm_modify vel yes cutoff 3
|
||||
|
||||
molecule mymol molecule.data
|
||||
region pourreg block 5 15 5 15 80 100 side in units box
|
||||
|
||||
#Note: in versions prior to 1/2020, the 'disable' keyword to fix/gravity
|
||||
# and the 'gravity' keyword to fix rigid/small were not available.
|
||||
# These settings produce undesirable behavior, where gravity can induce
|
||||
# torque on rigid bodies.
|
||||
#fix gravfix all gravity 9.8 vector 0 0 -1 #disable
|
||||
#fix rigidfix all rigid/small molecule mol mymol #gravity gravfix
|
||||
|
||||
#The correct behavior is recovered with the following settings:
|
||||
fix gravfix all gravity 9.8 vector 0 0 -1 disable
|
||||
fix rigidfix all rigid/small molecule mol mymol gravity gravfix
|
||||
|
||||
fix pourfix all pour 5 0 1234 region pourreg mol mymol rigid rigidfix
|
||||
|
||||
fix zwall all wall/gran hooke/history 4000.0 NULL 100.0 NULL 0.5 0 zplane 0.1 NULL
|
||||
|
||||
#dump 1 all custom 1000 molecule_pour.dump id type mass radius x y z fx fy fz
|
||||
|
||||
run 100000
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
LAMMPS data file created for rigid body molecule template
|
||||
|
||||
5 atoms
|
||||
|
||||
2.3388800000000005 mass
|
||||
|
||||
6.002239704473936 4.99 4.989999999999999 com
|
||||
|
||||
116.79265620480001 144.26721336320003 144.26721336320006 -70.05220681600004 -70.05220681600002 -58.238345888000005 inertia
|
||||
|
||||
Coords
|
||||
|
||||
1 5 5 5
|
||||
2 5.1 5.0 5.0
|
||||
3 5.2 5.0 5.0
|
||||
4 6.2 5.0 5.0
|
||||
5 7.2 5.0 5.0
|
||||
|
||||
Types
|
||||
|
||||
1 1
|
||||
2 1
|
||||
3 1
|
||||
4 1
|
||||
5 1
|
||||
|
||||
Diameters
|
||||
|
||||
1 1.0
|
||||
2 0.9
|
||||
3 1.2
|
||||
4 1.2
|
||||
5 1.0
|
||||
|
||||
Masses
|
||||
|
||||
1 0.5235987755982988
|
||||
2 0.3817035074111599
|
||||
3 0.9047786842338602
|
||||
4 0.9047786842338602
|
||||
5 0.5235987755982988
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -28,6 +28,14 @@
|
|||
#include <vector>
|
||||
#include <iostream>
|
||||
|
||||
/* We default to OpenCL 1.2 as target version for now as
|
||||
* there are known issues with OpenCL 2.0 and later.
|
||||
* This is also to silence warnings from generic OpenCL headers */
|
||||
|
||||
#if !defined(CL_TARGET_OPENCL_VERSION)
|
||||
#define CL_TARGET_OPENCL_VERSION 120
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <OpenCL/cl.h>
|
||||
#include <OpenCL/cl_platform.h>
|
||||
|
|
|
@ -4,6 +4,14 @@
|
|||
#include <cstdio>
|
||||
#include <cassert>
|
||||
|
||||
/* We default to OpenCL 1.2 as target version for now as
|
||||
* there are known issues with OpenCL 2.0 and later.
|
||||
* This is also to silence warnings from generic OpenCL headers */
|
||||
|
||||
#if !defined(CL_TARGET_OPENCL_VERSION)
|
||||
#define CL_TARGET_OPENCL_VERSION 120
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <OpenCL/cl.h>
|
||||
#else
|
||||
|
|
|
@ -26,15 +26,16 @@ BaseAtomicT::BaseAtomic() : _compiled(false), _max_bytes(0) {
|
|||
ans=new Answer<numtyp,acctyp>();
|
||||
nbor=new Neighbor();
|
||||
pair_program=NULL;
|
||||
ucl_device=NULL;
|
||||
}
|
||||
|
||||
template <class numtyp, class acctyp>
|
||||
BaseAtomicT::~BaseAtomic() {
|
||||
delete ans;
|
||||
delete nbor;
|
||||
if (pair_program) delete pair_program;
|
||||
k_pair_fast.clear();
|
||||
k_pair.clear();
|
||||
if (pair_program) delete pair_program;
|
||||
}
|
||||
|
||||
template <class numtyp, class acctyp>
|
||||
|
@ -78,6 +79,8 @@ int BaseAtomicT::init_atomic(const int nlocal, const int nall,
|
|||
if (success!=0)
|
||||
return success;
|
||||
|
||||
if (ucl_device!=device->gpu) _compiled=false;
|
||||
|
||||
ucl_device=device->gpu;
|
||||
atom=&device->atom;
|
||||
|
||||
|
|
|
@ -26,15 +26,16 @@ BaseChargeT::BaseCharge() : _compiled(false), _max_bytes(0) {
|
|||
ans=new Answer<numtyp,acctyp>();
|
||||
nbor=new Neighbor();
|
||||
pair_program=NULL;
|
||||
ucl_device=NULL;
|
||||
}
|
||||
|
||||
template <class numtyp, class acctyp>
|
||||
BaseChargeT::~BaseCharge() {
|
||||
delete ans;
|
||||
delete nbor;
|
||||
if (pair_program) delete pair_program;
|
||||
k_pair_fast.clear();
|
||||
k_pair.clear();
|
||||
if (pair_program) delete pair_program;
|
||||
}
|
||||
|
||||
template <class numtyp, class acctyp>
|
||||
|
@ -78,6 +79,8 @@ int BaseChargeT::init_atomic(const int nlocal, const int nall,
|
|||
if (success!=0)
|
||||
return success;
|
||||
|
||||
if (ucl_device!=device->gpu) _compiled=false;
|
||||
|
||||
ucl_device=device->gpu;
|
||||
atom=&device->atom;
|
||||
|
||||
|
|
|
@ -26,15 +26,16 @@ BaseDipoleT::BaseDipole() : _compiled(false), _max_bytes(0) {
|
|||
ans=new Answer<numtyp,acctyp>();
|
||||
nbor=new Neighbor();
|
||||
pair_program=NULL;
|
||||
ucl_device=NULL;
|
||||
}
|
||||
|
||||
template <class numtyp, class acctyp>
|
||||
BaseDipoleT::~BaseDipole() {
|
||||
delete ans;
|
||||
delete nbor;
|
||||
if (pair_program) delete pair_program;
|
||||
k_pair_fast.clear();
|
||||
k_pair.clear();
|
||||
if (pair_program) delete pair_program;
|
||||
}
|
||||
|
||||
template <class numtyp, class acctyp>
|
||||
|
@ -79,6 +80,8 @@ int BaseDipoleT::init_atomic(const int nlocal, const int nall,
|
|||
if (success!=0)
|
||||
return success;
|
||||
|
||||
if (ucl_device!=device->gpu) _compiled=false;
|
||||
|
||||
ucl_device=device->gpu;
|
||||
atom=&device->atom;
|
||||
|
||||
|
|
|
@ -26,15 +26,16 @@ BaseDPDT::BaseDPD() : _compiled(false), _max_bytes(0) {
|
|||
ans=new Answer<numtyp,acctyp>();
|
||||
nbor=new Neighbor();
|
||||
pair_program=NULL;
|
||||
ucl_device=NULL;
|
||||
}
|
||||
|
||||
template <class numtyp, class acctyp>
|
||||
BaseDPDT::~BaseDPD() {
|
||||
delete ans;
|
||||
delete nbor;
|
||||
if (pair_program) delete pair_program;
|
||||
k_pair_fast.clear();
|
||||
k_pair.clear();
|
||||
if (pair_program) delete pair_program;
|
||||
}
|
||||
|
||||
template <class numtyp, class acctyp>
|
||||
|
@ -79,6 +80,8 @@ int BaseDPDT::init_atomic(const int nlocal, const int nall,
|
|||
if (success!=0)
|
||||
return success;
|
||||
|
||||
if (ucl_device!=device->gpu) _compiled=false;
|
||||
|
||||
ucl_device=device->gpu;
|
||||
atom=&device->atom;
|
||||
|
||||
|
|
|
@ -36,6 +36,7 @@ BaseEllipsoidT::BaseEllipsoid() : _compiled(false), _max_bytes(0) {
|
|||
nbor_program=NULL;
|
||||
ellipsoid_program=NULL;
|
||||
lj_program=NULL;
|
||||
ucl_device=NULL;
|
||||
}
|
||||
|
||||
template <class numtyp, class acctyp>
|
||||
|
@ -92,7 +93,9 @@ int BaseEllipsoidT::init_base(const int nlocal, const int nall,
|
|||
max_nbors,cell_size,true,1);
|
||||
if (success!=0)
|
||||
return success;
|
||||
|
||||
|
||||
if (ucl_device!=device->gpu) _compiled=false;
|
||||
|
||||
ucl_device=device->gpu;
|
||||
atom=&device->atom;
|
||||
|
||||
|
|
|
@ -28,6 +28,7 @@ BaseThreeT::BaseThree() : _compiled(false), _max_bytes(0) {
|
|||
ans2=new Answer<numtyp,acctyp>();
|
||||
#endif
|
||||
pair_program=NULL;
|
||||
ucl_device=NULL;
|
||||
}
|
||||
|
||||
template <class numtyp, class acctyp>
|
||||
|
@ -37,12 +38,12 @@ BaseThreeT::~BaseThree() {
|
|||
#ifdef THREE_CONCURRENT
|
||||
delete ans2;
|
||||
#endif
|
||||
if (pair_program) delete pair_program;
|
||||
k_three_center.clear();
|
||||
k_three_end.clear();
|
||||
k_three_end_vatom.clear();
|
||||
k_pair.clear();
|
||||
k_short_nbor.clear();
|
||||
if (pair_program) delete pair_program;
|
||||
}
|
||||
|
||||
template <class numtyp, class acctyp>
|
||||
|
@ -94,6 +95,8 @@ int BaseThreeT::init_three(const int nlocal, const int nall,
|
|||
if (success!=0)
|
||||
return success;
|
||||
|
||||
if (ucl_device!=device->gpu) _compiled=false;
|
||||
|
||||
ucl_device=device->gpu;
|
||||
atom=&device->atom;
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
# DATE: 2015-07-06 CONTRIBUTOR: X. W. Zhou, xzhou@sandia.gov, Don Ward, donward@sandia.gov, CITATION: Zhou, Ward, and Foster, Phys. Chem. Chem. Phys., under consideration
|
||||
# DATE: 2015-07-06 CONTRIBUTOR: X. W. Zhou, xzhou@sandia.gov, Don Ward, donward@sandia.gov, CITATION: Zhou, Ward, and Foster, J. Alloys Compd., 680, 752 (2016).
|
||||
2
|
||||
13 2.69800000e+01 Al
|
||||
29 6.35500000e+01 Cu
|
||||
|
@ -4835,7 +4835,7 @@
|
|||
0.00000000e+00
|
||||
0.00000000e+00
|
||||
0.00000000e+00
|
||||
4.90000000e+00
|
||||
0.00000000e+00
|
||||
0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
|
@ -5681,4 +5681,359 @@
|
|||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00 0.00000000e+00
|
||||
|
|
|
@ -48,6 +48,7 @@ PairLJClass2CoulLong::PairLJClass2CoulLong(LAMMPS *lmp) : Pair(lmp)
|
|||
respa_enable = 1;
|
||||
writedata = 1;
|
||||
ftable = NULL;
|
||||
cut_respa = NULL;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -88,6 +88,12 @@ static const char cite_gpu_package[] =
|
|||
" year = 2017,\n"
|
||||
" volume = 212,\n"
|
||||
" pages = {113--122}\n"
|
||||
"}\n\n"
|
||||
"@Article{Nikolskiy19,\n"
|
||||
" author = {V. Nikolskiy, V. Stegailov},\n"
|
||||
" title = {GPU acceleration of four-site water models in LAMMPS},\n"
|
||||
" journal = {Proceeding of the International Conference on Parallel Computing (ParCo 2019), Prague, Czech Republic},\n"
|
||||
" year = 2019\n"
|
||||
"}\n\n";
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
|
|
@ -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
|
|
@ -52,8 +52,8 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) :
|
|||
torque(NULL), quat(NULL), imagebody(NULL), fflag(NULL),
|
||||
tflag(NULL), langextra(NULL), sum(NULL), all(NULL),
|
||||
remapflag(NULL), xcmimage(NULL), eflags(NULL), orient(NULL),
|
||||
dorient(NULL), id_dilate(NULL), random(NULL), avec_ellipsoid(NULL),
|
||||
avec_line(NULL), avec_tri(NULL)
|
||||
dorient(NULL), id_dilate(NULL), id_gravity(NULL), random(NULL),
|
||||
avec_ellipsoid(NULL), avec_line(NULL), avec_tri(NULL)
|
||||
{
|
||||
int i,ibody;
|
||||
|
||||
|
@ -124,14 +124,17 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) :
|
|||
if (custom_flag) {
|
||||
if (narg < 5) error->all(FLERR,"Illegal fix rigid command");
|
||||
|
||||
// determine whether atom-style variable or atom property is used.
|
||||
// determine whether atom-style variable or atom property is used
|
||||
|
||||
if (strstr(arg[4],"i_") == arg[4]) {
|
||||
int is_double=0;
|
||||
int custom_index = atom->find_custom(arg[4]+2,is_double);
|
||||
if (custom_index == -1)
|
||||
error->all(FLERR,"Fix rigid custom requires previously defined property/atom");
|
||||
error->all(FLERR,"Fix rigid custom requires "
|
||||
"previously defined property/atom");
|
||||
else if (is_double)
|
||||
error->all(FLERR,"Fix rigid custom requires integer-valued property/atom");
|
||||
error->all(FLERR,"Fix rigid custom requires "
|
||||
"integer-valued property/atom");
|
||||
int minval = INT_MAX;
|
||||
int *value = atom->ivector[custom_index];
|
||||
for (i = 0; i < nlocal; i++)
|
||||
|
@ -163,12 +166,15 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) :
|
|||
if (mask[i] & groupbit)
|
||||
molecule[i] = (tagint)((tagint)value[i] - minval + 1);
|
||||
delete[] value;
|
||||
|
||||
} else error->all(FLERR,"Unsupported fix rigid custom property");
|
||||
|
||||
} else {
|
||||
if (atom->molecule_flag == 0)
|
||||
error->all(FLERR,"Fix rigid molecule requires atom attribute molecule");
|
||||
molecule = atom->molecule;
|
||||
}
|
||||
|
||||
iarg = 4 + custom_flag;
|
||||
|
||||
tagint maxmol_tag = -1;
|
||||
|
@ -297,6 +303,7 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) :
|
|||
}
|
||||
|
||||
// number of linear rigid bodies is counted later
|
||||
|
||||
nlinear = 0;
|
||||
|
||||
// parse optional args
|
||||
|
@ -308,12 +315,14 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) :
|
|||
tstat_flag = 0;
|
||||
pstat_flag = 0;
|
||||
allremap = 1;
|
||||
id_dilate = NULL;
|
||||
t_chain = 10;
|
||||
t_iter = 1;
|
||||
t_order = 3;
|
||||
p_chain = 10;
|
||||
|
||||
inpfile = NULL;
|
||||
id_gravity = NULL;
|
||||
id_dilate = NULL;
|
||||
|
||||
pcouple = NONE;
|
||||
pstyle = ANISO;
|
||||
|
@ -543,12 +552,20 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) :
|
|||
iarg += 2;
|
||||
|
||||
} else if (strcmp(arg[iarg],"reinit") == 0) {
|
||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix rigid/small command");
|
||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix rigid command");
|
||||
if (strcmp("yes",arg[iarg+1]) == 0) reinitflag = 1;
|
||||
else if (strcmp("no",arg[iarg+1]) == 0) reinitflag = 0;
|
||||
else error->all(FLERR,"Illegal fix rigid command");
|
||||
iarg += 2;
|
||||
|
||||
} else if (strcmp(arg[iarg],"gravity") == 0) {
|
||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix rigid command");
|
||||
delete [] id_gravity;
|
||||
int n = strlen(arg[iarg+1]) + 1;
|
||||
id_gravity = new char[n];
|
||||
strcpy(id_gravity,arg[iarg+1]);
|
||||
iarg += 2;
|
||||
|
||||
} else error->all(FLERR,"Illegal fix rigid command");
|
||||
}
|
||||
|
||||
|
@ -621,6 +638,9 @@ FixRigid::~FixRigid()
|
|||
|
||||
delete random;
|
||||
delete [] inpfile;
|
||||
delete [] id_dilate;
|
||||
delete [] id_gravity;
|
||||
|
||||
memory->destroy(mol2body);
|
||||
memory->destroy(body2mol);
|
||||
|
||||
|
@ -687,7 +707,7 @@ void FixRigid::init()
|
|||
avec_tri = (AtomVecTri *) atom->style_match("tri");
|
||||
|
||||
// warn if more than one rigid fix
|
||||
// if earlyflag, warn if any post-force fixes come after POEMS fix
|
||||
// if earlyflag, warn if any post-force fixes come after a rigid fix
|
||||
|
||||
int count = 0;
|
||||
for (i = 0; i < modify->nfix; i++)
|
||||
|
@ -701,24 +721,54 @@ void FixRigid::init()
|
|||
if (rflag && (modify->fmask[i] & POST_FORCE) &&
|
||||
!modify->fix[i]->rigid_flag) {
|
||||
char str[128];
|
||||
snprintf(str,128,"Fix %s alters forces after fix rigid",modify->fix[i]->id);
|
||||
snprintf(str,128,"Fix %s alters forces after fix rigid",
|
||||
modify->fix[i]->id);
|
||||
error->warning(FLERR,str);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// warn if body properties are read from inpfile
|
||||
// and the gravity keyword is not set and a gravity fix exists
|
||||
// this could mean body particles are overlapped
|
||||
// and gravity is not applied correctly
|
||||
|
||||
if (inpfile && !id_gravity) {
|
||||
for (i = 0; i < modify->nfix; i++) {
|
||||
if (strcmp(modify->fix[i]->style,"gravity") == 0) {
|
||||
if (comm->me == 0)
|
||||
error->warning(FLERR,"Gravity may not be correctly applied "
|
||||
"to rigid bodies if they consist of "
|
||||
"overlapped particles");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// error if npt,nph fix comes before rigid fix
|
||||
|
||||
for (i = 0; i < modify->nfix; i++) {
|
||||
if (strcmp(modify->fix[i]->style,"npt") == 0) break;
|
||||
if (strcmp(modify->fix[i]->style,"nph") == 0) break;
|
||||
}
|
||||
|
||||
if (i < modify->nfix) {
|
||||
for (int j = i; j < modify->nfix; j++)
|
||||
if (strcmp(modify->fix[j]->style,"rigid") == 0)
|
||||
error->all(FLERR,"Rigid fix must come before NPT/NPH fix");
|
||||
}
|
||||
|
||||
// add gravity forces based on gravity vector from fix
|
||||
|
||||
if (id_gravity) {
|
||||
int ifix = modify->find_fix(id_gravity);
|
||||
if (ifix < 0) error->all(FLERR,"Fix rigid cannot find fix gravity ID");
|
||||
if (strcmp(modify->fix[ifix]->style,"gravity") != 0)
|
||||
error->all(FLERR,"Fix rigid gravity fix is invalid");
|
||||
int tmp;
|
||||
gvec = (double *) modify->fix[ifix]->extract("gvec",tmp);
|
||||
}
|
||||
|
||||
// timestep info
|
||||
|
||||
dtv = update->dt;
|
||||
|
@ -1061,8 +1111,17 @@ void FixRigid::compute_forces_and_torques()
|
|||
torque[ibody][1] = all[ibody][4] + langextra[ibody][4];
|
||||
torque[ibody][2] = all[ibody][5] + langextra[ibody][5];
|
||||
}
|
||||
}
|
||||
|
||||
// add gravity force to COM of each body
|
||||
|
||||
if (id_gravity) {
|
||||
for (ibody = 0; ibody < nbody; ibody++) {
|
||||
fcm[ibody][0] += gvec[0]*masstotal[ibody];
|
||||
fcm[ibody][1] += gvec[1]*masstotal[ibody];
|
||||
fcm[ibody][2] += gvec[2]*masstotal[ibody];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
|
|
|
@ -66,7 +66,8 @@ class FixRigid : public Fix {
|
|||
double *step_respa;
|
||||
int triclinic;
|
||||
|
||||
char *inpfile; // file to read rigid body attributes from
|
||||
char *inpfile; // file to read rigid body attributes from
|
||||
|
||||
int rstyle; // SINGLE,MOLECULE,GROUP
|
||||
int setupflag; // 1 if body properties are setup, else 0
|
||||
int earlyflag; // 1 if forces/torques computed at post_force()
|
||||
|
@ -131,6 +132,9 @@ class FixRigid : public Fix {
|
|||
int dilate_group_bit; // mask for dilation group
|
||||
char *id_dilate; // group name to dilate
|
||||
|
||||
char *id_gravity; // ID of fix gravity command to add gravity forces
|
||||
double *gvec; // ptr to gravity vector inside the fix
|
||||
|
||||
class RanMars *random;
|
||||
class AtomVecEllipsoid *avec_ellipsoid;
|
||||
class AtomVecLine *avec_line;
|
||||
|
|
|
@ -57,7 +57,7 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) :
|
|||
xcmimage(NULL), displace(NULL), eflags(NULL), orient(NULL), dorient(NULL),
|
||||
avec_ellipsoid(NULL), avec_line(NULL), avec_tri(NULL), counts(NULL),
|
||||
itensor(NULL), mass_body(NULL), langextra(NULL), random(NULL),
|
||||
id_dilate(NULL), onemols(NULL)
|
||||
id_dilate(NULL), id_gravity(NULL), onemols(NULL)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -107,7 +107,8 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) :
|
|||
bodyID = new tagint[nlocal];
|
||||
customflag = 1;
|
||||
|
||||
// determine whether atom-style variable or atom property is used.
|
||||
// determine whether atom-style variable or atom property is used
|
||||
|
||||
if (strstr(arg[4],"i_") == arg[4]) {
|
||||
int is_double=0;
|
||||
int custom_index = atom->find_custom(arg[4]+2,is_double);
|
||||
|
@ -356,6 +357,13 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) :
|
|||
p_chain = force->numeric(FLERR,arg[iarg+1]);
|
||||
iarg += 2;
|
||||
|
||||
} else if (strcmp(arg[iarg],"gravity") == 0) {
|
||||
if (iarg+2 > narg) error->all(FLERR,"Illegal fix rigid/small command");
|
||||
delete [] id_gravity;
|
||||
int n = strlen(arg[iarg+1]) + 1;
|
||||
id_gravity = new char[n];
|
||||
strcpy(id_gravity,arg[iarg+1]);
|
||||
iarg += 2;
|
||||
|
||||
} else error->all(FLERR,"Illegal fix rigid/small command");
|
||||
}
|
||||
|
@ -515,6 +523,8 @@ FixRigidSmall::~FixRigidSmall()
|
|||
|
||||
delete random;
|
||||
delete [] inpfile;
|
||||
delete [] id_dilate;
|
||||
delete [] id_gravity;
|
||||
|
||||
memory->destroy(langextra);
|
||||
memory->destroy(mass_body);
|
||||
|
@ -543,6 +553,7 @@ void FixRigidSmall::init()
|
|||
triclinic = domain->triclinic;
|
||||
|
||||
// warn if more than one rigid fix
|
||||
// if earlyflag, warn if any post-force fixes come after a rigid fix
|
||||
|
||||
int count = 0;
|
||||
for (i = 0; i < modify->nfix; i++)
|
||||
|
@ -563,6 +574,23 @@ void FixRigidSmall::init()
|
|||
}
|
||||
}
|
||||
|
||||
// warn if body properties are read from inpfile or a mol template file
|
||||
// and the gravity keyword is not set and a gravity fix exists
|
||||
// this could mean body particles are overlapped
|
||||
// and gravity is not applied correctly
|
||||
|
||||
if ((inpfile || onemols) && !id_gravity) {
|
||||
for (i = 0; i < modify->nfix; i++) {
|
||||
if (strcmp(modify->fix[i]->style,"gravity") == 0) {
|
||||
if (comm->me == 0)
|
||||
error->warning(FLERR,"Gravity may not be correctly applied "
|
||||
"to rigid bodies if they consist of "
|
||||
"overlapped particles");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// error if npt,nph fix comes before rigid fix
|
||||
|
||||
for (i = 0; i < modify->nfix; i++) {
|
||||
|
@ -575,6 +603,17 @@ void FixRigidSmall::init()
|
|||
error->all(FLERR,"Rigid fix must come before NPT/NPH fix");
|
||||
}
|
||||
|
||||
// add gravity forces based on gravity vector from fix
|
||||
|
||||
if (id_gravity) {
|
||||
int ifix = modify->find_fix(id_gravity);
|
||||
if (ifix < 0) error->all(FLERR,"Fix rigid/small cannot find fix gravity ID");
|
||||
if (strcmp(modify->fix[ifix]->style,"gravity") != 0)
|
||||
error->all(FLERR,"Fix rigid/small gravity fix is invalid");
|
||||
int tmp;
|
||||
gvec = (double *) modify->fix[ifix]->extract("gvec",tmp);
|
||||
}
|
||||
|
||||
// timestep info
|
||||
|
||||
dtv = update->dt;
|
||||
|
@ -954,8 +993,20 @@ void FixRigidSmall::compute_forces_and_torques()
|
|||
tcm[2] += langextra[ibody][5];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// add gravity force to COM of each body
|
||||
|
||||
if (id_gravity) {
|
||||
double mass;
|
||||
for (ibody = 0; ibody < nlocal_body; ibody++) {
|
||||
mass = body[ibody].mass;
|
||||
fcm = body[ibody].fcm;
|
||||
fcm[0] += gvec[0]*mass;
|
||||
fcm[1] += gvec[1]*mass;
|
||||
fcm[2] += gvec[2]*mass;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
|
|
|
@ -164,6 +164,9 @@ class FixRigidSmall : public Fix {
|
|||
int dilate_group_bit; // mask for dilation group
|
||||
char *id_dilate; // group name to dilate
|
||||
|
||||
char *id_gravity; // ID of fix gravity command to add gravity forces
|
||||
double *gvec; // ptr to gravity vector inside the fix
|
||||
|
||||
double p_current[3],p_target[3];
|
||||
|
||||
// molecules added on-the-fly as rigid bodies
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
Anupama Kurpad (Intel) - Host Affinitization
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
#include "fix_intel.h"
|
||||
#include "comm.h"
|
||||
#include "error.h"
|
||||
#include "force.h"
|
||||
|
@ -27,7 +28,7 @@
|
|||
#include "timer.h"
|
||||
#include "universe.h"
|
||||
#include "update.h"
|
||||
#include "fix_intel.h"
|
||||
#include "utils.h"
|
||||
|
||||
#include <cstring>
|
||||
#include <cstdlib>
|
||||
|
@ -63,6 +64,7 @@ FixIntel::FixIntel(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
|
|||
_three_body_neighbor = 0;
|
||||
_pair_intel_count = 0;
|
||||
_hybrid_nonpair = 0;
|
||||
_print_pkg_info = 1;
|
||||
|
||||
_precision_mode = PREC_MODE_MIXED;
|
||||
_offload_balance = -1.0;
|
||||
|
@ -290,6 +292,7 @@ int FixIntel::setmask()
|
|||
mask |= POST_FORCE;
|
||||
mask |= MIN_POST_FORCE;
|
||||
#endif
|
||||
mask |= POST_RUN;
|
||||
return mask;
|
||||
}
|
||||
|
||||
|
@ -310,12 +313,7 @@ void FixIntel::init()
|
|||
#endif
|
||||
|
||||
const int nstyles = _pair_intel_count;
|
||||
if (force->pair_match("hybrid", 1) != NULL) {
|
||||
_pair_hybrid_flag = 1;
|
||||
if (force->newton_pair != 0 && force->pair->no_virial_fdotr_compute)
|
||||
error->all(FLERR,
|
||||
"Intel package requires fdotr virial with newton on.");
|
||||
} else if (force->pair_match("hybrid/overlay", 1) != NULL) {
|
||||
if (force->pair_match("^hybrid", 0) != NULL) {
|
||||
_pair_hybrid_flag = 1;
|
||||
if (force->newton_pair != 0 && force->pair->no_virial_fdotr_compute)
|
||||
error->all(FLERR,
|
||||
|
@ -394,6 +392,20 @@ void FixIntel::setup_pre_reverse(int eflag, int vflag)
|
|||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
bool FixIntel::pair_hybrid_check()
|
||||
{
|
||||
PairHybrid *ph = (PairHybrid *)force->pair;
|
||||
bool has_intel = false;
|
||||
int nstyles = ph->nstyles;
|
||||
|
||||
for (int i = 0; i < nstyles; ++i)
|
||||
if (ph->styles[i]->suffix_flag & Suffix::INTEL) has_intel = true;
|
||||
|
||||
return has_intel;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void FixIntel::pair_init_check(const bool cdmessage)
|
||||
{
|
||||
#ifdef INTEL_VMASK
|
||||
|
@ -475,7 +487,7 @@ void FixIntel::pair_init_check(const bool cdmessage)
|
|||
set_offload_affinity();
|
||||
#endif
|
||||
|
||||
if (comm->me == 0) {
|
||||
if (_print_pkg_info && comm->me == 0) {
|
||||
if (screen) {
|
||||
fprintf(screen,
|
||||
"----------------------------------------------------------\n");
|
||||
|
@ -498,6 +510,7 @@ void FixIntel::pair_init_check(const bool cdmessage)
|
|||
"----------------------------------------------------------\n");
|
||||
}
|
||||
}
|
||||
_print_pkg_info = 0;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
@ -510,14 +523,11 @@ void FixIntel::bond_init_check()
|
|||
"USER-INTEL package requires same setting for newton bond and non-bond.");
|
||||
|
||||
int intel_pair = 0;
|
||||
if (force->pair_match("/intel", 0) != NULL)
|
||||
if (force->pair_match("/intel$", 0) != NULL)
|
||||
intel_pair = 1;
|
||||
else if (force->pair_match("hybrid", 1) != NULL) {
|
||||
else if (force->pair_match("^hybrid", 0) != NULL) {
|
||||
_hybrid_nonpair = 1;
|
||||
if (_pair_intel_count) intel_pair = 1;
|
||||
} else if (force->pair_match("hybrid/overlay", 1) != NULL) {
|
||||
_hybrid_nonpair = 1;
|
||||
if (_pair_intel_count) intel_pair = 1;
|
||||
if (pair_hybrid_check()) intel_pair = 1;
|
||||
}
|
||||
|
||||
if (intel_pair == 0)
|
||||
|
@ -530,14 +540,11 @@ void FixIntel::bond_init_check()
|
|||
void FixIntel::kspace_init_check()
|
||||
{
|
||||
int intel_pair = 0;
|
||||
if (force->pair_match("/intel", 0) != NULL)
|
||||
if (force->pair_match("/intel$", 0) != NULL)
|
||||
intel_pair = 1;
|
||||
else if (force->pair_match("hybrid", 1) != NULL) {
|
||||
else if (force->pair_match("^hybrid", 0) != NULL) {
|
||||
_hybrid_nonpair = 1;
|
||||
if (_pair_intel_count) intel_pair = 1;
|
||||
} else if (force->pair_match("hybrid/overlay", 1) != NULL) {
|
||||
_hybrid_nonpair = 1;
|
||||
if (_pair_intel_count) intel_pair = 1;
|
||||
if (pair_hybrid_check()) intel_pair = 1;
|
||||
}
|
||||
|
||||
if (intel_pair == 0)
|
||||
|
|
|
@ -46,6 +46,7 @@ class FixIntel : public Fix {
|
|||
inline void min_setup(int in) { setup(in); }
|
||||
void setup_pre_reverse(int eflag = 0, int vflag = 0);
|
||||
|
||||
bool pair_hybrid_check();
|
||||
void pair_init_check(const bool cdmessage=false);
|
||||
void bond_init_check();
|
||||
void kspace_init_check();
|
||||
|
@ -54,6 +55,8 @@ class FixIntel : public Fix {
|
|||
inline void min_pre_reverse(int eflag = 0, int vflag = 0)
|
||||
{ pre_reverse(eflag, vflag); }
|
||||
|
||||
void post_run() { _print_pkg_info = 1; }
|
||||
|
||||
// Get all forces, calculation results from coprocesser
|
||||
void sync_coprocessor();
|
||||
|
||||
|
@ -83,13 +86,12 @@ class FixIntel : public Fix {
|
|||
}
|
||||
inline void set_reduce_flag() { if (_nthreads > 1) _need_reduce = 1; }
|
||||
inline int lrt() {
|
||||
if (force->kspace_match("pppm/intel", 0) && update->whichflag == 1)
|
||||
if (force->kspace_match("^pppm/.*intel$", 0) && update->whichflag == 1)
|
||||
return _lrt;
|
||||
else return 0;
|
||||
}
|
||||
inline int pppm_table() {
|
||||
if (force->kspace_match("pppm/intel", 0) ||
|
||||
force->kspace_match("pppm/disp/intel",0))
|
||||
if (force->kspace_match("^pppm/.*intel$", 0))
|
||||
return INTEL_P3M_TABLE;
|
||||
else return 0;
|
||||
}
|
||||
|
@ -101,7 +103,7 @@ class FixIntel : public Fix {
|
|||
IntelBuffers<double,double> *_double_buffers;
|
||||
|
||||
int _precision_mode, _nthreads, _nbor_pack_width, _three_body_neighbor;
|
||||
int _pair_intel_count, _pair_hybrid_flag;
|
||||
int _pair_intel_count, _pair_hybrid_flag, _print_pkg_info;
|
||||
// These should be removed in subsequent update w/ simpler hybrid arch
|
||||
int _pair_hybrid_zero, _hybrid_nonpair, _zero_master;
|
||||
|
||||
|
|
|
@ -56,6 +56,8 @@ NBinIntel::~NBinIntel() {
|
|||
nocopy(binhead,bins,_atombin,_binpacked:alloc_if(0) free_if(1))
|
||||
}
|
||||
#endif
|
||||
memory->destroy(_atombin);
|
||||
memory->destroy(_binpacked);
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
|
|
@ -525,8 +525,10 @@ void PairLJCutCoulLongIntel::pack_force_const(ForceConst<flt_t> &fc,
|
|||
double cut;
|
||||
if (setflag[i][j] != 0 || (setflag[i][i] != 0 && setflag[j][j] != 0))
|
||||
cut = init_one(i, j);
|
||||
else
|
||||
else { // need to set cutsq and cut_ljsq for hybrid pair_style
|
||||
cut = 0.0;
|
||||
cut_ljsq[i][j] = cut_ljsq[j][i] = 0.0;
|
||||
}
|
||||
cutsq[i][j] = cutsq[j][i] = cut*cut;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -459,11 +459,8 @@ void PairLJCutIntel::ForceConst<flt_t>::set_ntypes(const int ntypes,
|
|||
const int cop) {
|
||||
if (ntypes != _ntypes) {
|
||||
if (_ntypes > 0) {
|
||||
fc_packed1 *oljc12o = ljc12o[0];
|
||||
fc_packed2 *olj34 = lj34[0];
|
||||
|
||||
_memory->destroy(oljc12o);
|
||||
_memory->destroy(olj34);
|
||||
_memory->destroy(ljc12o);
|
||||
_memory->destroy(lj34);
|
||||
}
|
||||
if (ntypes > 0) {
|
||||
_cop = cop;
|
||||
|
|
|
@ -438,7 +438,7 @@ void PairMEAMC::read_files(char *globalfile, char *userfile)
|
|||
found[i] = true;
|
||||
|
||||
// map lat string to an integer
|
||||
|
||||
|
||||
if (!MEAM::str_to_lat(words[1], true, lat[i]))
|
||||
error->all(FLERR,"Unrecognized lattice type in MEAM file 1");
|
||||
|
||||
|
@ -464,7 +464,7 @@ void PairMEAMC::read_files(char *globalfile, char *userfile)
|
|||
|
||||
if (!isone(t0[i]))
|
||||
error->all(FLERR,"Unsupported parameter in MEAM potential file: t0!=1");
|
||||
|
||||
|
||||
// z given is ignored: if this is mismatched, we definitely won't do what the user said -> fatal error
|
||||
if (z[i] != MEAM::get_Zij(lat[i]))
|
||||
error->all(FLERR,"Mismatched parameter in MEAM potential file: z!=lat");
|
||||
|
|
|
@ -383,6 +383,19 @@ void FixRigidNHOMP::compute_forces_and_torques()
|
|||
torque[ibody][1] = all[ibody][4] + langextra[ibody][4];
|
||||
torque[ibody][2] = all[ibody][5] + langextra[ibody][5];
|
||||
}
|
||||
|
||||
// add gravity force to COM of each body
|
||||
|
||||
if (id_gravity) {
|
||||
#if defined(_OPENMP)
|
||||
#pragma omp parallel for default(none) private(ibody) schedule(static)
|
||||
#endif
|
||||
for (ibody = 0; ibody < nbody; ibody++) {
|
||||
fcm[ibody][0] += gvec[0]*masstotal[ibody];
|
||||
fcm[ibody][1] += gvec[1]*masstotal[ibody];
|
||||
fcm[ibody][2] += gvec[2]*masstotal[ibody];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
|
|
@ -256,6 +256,19 @@ void FixRigidOMP::compute_forces_and_torques()
|
|||
torque[ibody][1] = all[ibody][4] + langextra[ibody][4];
|
||||
torque[ibody][2] = all[ibody][5] + langextra[ibody][5];
|
||||
}
|
||||
|
||||
// add gravity force to COM of each body
|
||||
|
||||
if (id_gravity) {
|
||||
#if defined(_OPENMP)
|
||||
#pragma omp parallel for default(none) schedule(static)
|
||||
#endif
|
||||
for (int ibody = 0; ibody < nbody; ibody++) {
|
||||
fcm[ibody][0] += gvec[0]*masstotal[ibody];
|
||||
fcm[ibody][1] += gvec[1]*masstotal[ibody];
|
||||
fcm[ibody][2] += gvec[2]*masstotal[ibody];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
|
|
@ -196,6 +196,21 @@ void FixRigidSmallOMP::compute_forces_and_torques()
|
|||
tcm[2] += langextra[ibody][5];
|
||||
}
|
||||
}
|
||||
|
||||
// add gravity force to COM of each body
|
||||
|
||||
if (id_gravity) {
|
||||
#if defined(_OPENMP)
|
||||
#pragma omp parallel for default(none) schedule(static)
|
||||
#endif
|
||||
for (int ibody = 0; ibody < nbody; ibody++) {
|
||||
double * _noalias const fcm = body[ibody].fcm;
|
||||
const double mass = body[ibody].mass;
|
||||
fcm[0] += gvec[0]*mass;
|
||||
fcm[1] += gvec[1]*mass;
|
||||
fcm[2] += gvec[2]*mass;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
|
|
@ -408,7 +408,8 @@ void DynamicalMatrix::update_force()
|
|||
timer->stamp(Timer::COMM);
|
||||
}
|
||||
|
||||
// force modifications,
|
||||
// force modifications
|
||||
|
||||
if (n_post_force) modify->post_force(vflag);
|
||||
timer->stamp(Timer::MODIFY);
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -37,7 +37,8 @@ enum{CONSTANT,EQUAL};
|
|||
|
||||
FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) :
|
||||
Fix(lmp, narg, arg),
|
||||
mstr(NULL), vstr(NULL), pstr(NULL), tstr(NULL), xstr(NULL), ystr(NULL), zstr(NULL)
|
||||
mstr(NULL), vstr(NULL), pstr(NULL), tstr(NULL),
|
||||
xstr(NULL), ystr(NULL), zstr(NULL)
|
||||
{
|
||||
if (narg < 5) error->all(FLERR,"Illegal fix gravity command");
|
||||
|
||||
|
@ -61,8 +62,10 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) :
|
|||
mstyle = CONSTANT;
|
||||
}
|
||||
|
||||
int iarg;
|
||||
|
||||
if (strcmp(arg[4],"chute") == 0) {
|
||||
if (narg != 6) error->all(FLERR,"Illegal fix gravity command");
|
||||
if (narg < 6) error->all(FLERR,"Illegal fix gravity command");
|
||||
style = CHUTE;
|
||||
if (strstr(arg[5],"v_") == arg[5]) {
|
||||
int n = strlen(&arg[5][2]) + 1;
|
||||
|
@ -73,9 +76,10 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) :
|
|||
vert = force->numeric(FLERR,arg[5]);
|
||||
vstyle = CONSTANT;
|
||||
}
|
||||
iarg = 6;
|
||||
|
||||
} else if (strcmp(arg[4],"spherical") == 0) {
|
||||
if (narg != 7) error->all(FLERR,"Illegal fix gravity command");
|
||||
if (narg < 7) error->all(FLERR,"Illegal fix gravity command");
|
||||
style = SPHERICAL;
|
||||
if (strstr(arg[5],"v_") == arg[5]) {
|
||||
int n = strlen(&arg[5][2]) + 1;
|
||||
|
@ -95,9 +99,10 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) :
|
|||
theta = force->numeric(FLERR,arg[6]);
|
||||
tstyle = CONSTANT;
|
||||
}
|
||||
iarg = 7;
|
||||
|
||||
} else if (strcmp(arg[4],"vector") == 0) {
|
||||
if (narg != 8) error->all(FLERR,"Illegal fix gravity command");
|
||||
if (narg < 8) error->all(FLERR,"Illegal fix gravity command");
|
||||
style = VECTOR;
|
||||
if (strstr(arg[5],"v_") == arg[5]) {
|
||||
int n = strlen(&arg[5][2]) + 1;
|
||||
|
@ -126,9 +131,23 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) :
|
|||
zdir = force->numeric(FLERR,arg[7]);
|
||||
zstyle = CONSTANT;
|
||||
}
|
||||
iarg = 8;
|
||||
|
||||
} else error->all(FLERR,"Illegal fix gravity command");
|
||||
|
||||
// optional keywords
|
||||
|
||||
disable = 0;
|
||||
|
||||
while (iarg < narg) {
|
||||
if (strcmp(arg[iarg],"disable") == 0) {
|
||||
disable = 1;
|
||||
iarg++;
|
||||
} else error->all(FLERR,"Illegal fix gravity command");
|
||||
}
|
||||
|
||||
// initializations
|
||||
|
||||
degree2rad = MY_PI/180.0;
|
||||
time_origin = update->ntimestep;
|
||||
|
||||
|
@ -266,6 +285,12 @@ void FixGravity::post_force(int /*vflag*/)
|
|||
set_acceleration();
|
||||
}
|
||||
|
||||
// just exit if application of force is disabled
|
||||
|
||||
if (disable) return;
|
||||
|
||||
// apply gravity force to each particle
|
||||
|
||||
double **x = atom->x;
|
||||
double **f = atom->f;
|
||||
double *rmass = atom->rmass;
|
||||
|
@ -338,9 +363,9 @@ void FixGravity::set_acceleration()
|
|||
}
|
||||
}
|
||||
|
||||
xacc = magnitude*xgrav;
|
||||
yacc = magnitude*ygrav;
|
||||
zacc = magnitude*zgrav;
|
||||
gvec[0] = xacc = magnitude*xgrav;
|
||||
gvec[1] = yacc = magnitude*ygrav;
|
||||
gvec[2] = zacc = magnitude*zgrav;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
@ -357,3 +382,16 @@ double FixGravity::compute_scalar()
|
|||
}
|
||||
return egrav_all;
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
extract current gravity direction vector
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void *FixGravity::extract(const char *name, int &dim)
|
||||
{
|
||||
if (strcmp(name,"gvec") == 0) {
|
||||
dim = 1;
|
||||
return (void *) gvec;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -36,9 +36,10 @@ class FixGravity : public Fix {
|
|||
virtual void post_force(int);
|
||||
virtual void post_force_respa(int, int, int);
|
||||
double compute_scalar();
|
||||
void *extract(const char *, int &);
|
||||
|
||||
protected:
|
||||
int style;
|
||||
int style,disable;
|
||||
double magnitude;
|
||||
double vert,phi,theta;
|
||||
double xdir,ydir,zdir;
|
||||
|
@ -46,6 +47,8 @@ class FixGravity : public Fix {
|
|||
double degree2rad;
|
||||
int ilevel_respa;
|
||||
int time_origin;
|
||||
double gvec[3];
|
||||
|
||||
int eflag;
|
||||
double egrav,egrav_all;
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@ class Pair : protected Pointers {
|
|||
friend class DihedralCharmm;
|
||||
friend class DihedralCharmmOMP;
|
||||
friend class FixGPU;
|
||||
friend class FixIntel;
|
||||
friend class FixOMP;
|
||||
friend class ThrOMP;
|
||||
friend class Info;
|
||||
|
|
|
@ -434,8 +434,9 @@ bigint ReadDump::next(bigint ncurrent, bigint nlast, int nevery, int nskip)
|
|||
// all filereader procs close all their files and return
|
||||
|
||||
if (ntimestep < 0) {
|
||||
for (int i = 0; i < nreader; i++)
|
||||
readers[i]->close_file();
|
||||
if (filereader)
|
||||
for (int i = 0; i < nreader; i++)
|
||||
readers[i]->close_file();
|
||||
return ntimestep;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue