Updated documentation and source

This commit is contained in:
Sergey Lishchuk
2018-07-13 20:18:53 +01:00
parent 7260bb58e1
commit bf5fbc92df
30 changed files with 480 additions and 134 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View File

@ -96,16 +96,17 @@ USER-MISC package. See the "Making LAMMPS"_Section_start.html#start_2_3
section for more info on packages.
NOTE: In the "Angles" section of the data file, the atom ID 'j'
corresponding to the dipole to restrain must come before the atom ID
of the reference atom 'i'. A third atom ID 'k' must also be provided,
although 'k' is just a 'dummy' atom which can be any atom; it may be
useful to choose a convention (e.g., 'k'='i') and adhere to it. For
example, if ID=1 for the dipolar atom to restrain, and ID=2 for the
reference atom, the corresponding line in the "Angles" section of the
data file would read: X X 1 2 2
defining the direction of the dipole vector to restrain must come
before the atom ID of the reference atom 'i'. A third atom ID 'k' must
also be provided to comply with the requirement of a valid angle
definition. This atom ID k should be chosen to be that of an atom
bonded to atom 'i' to avoid errors with "lost angle atoms" when running
in parallel. Since the LAMMPS code checks for valid angle definitions,
cannot use the same atom ID of either 'i' or 'j' (this was allowed
and recommended with older LAMMPS versions).
The "newton" command for intramolecular interactions must be "on"
(which is the default).
(which is the default except when using some accelerator packages).
This angle style should not be used with SHAKE.

View File

@ -98,5 +98,5 @@ integration fix (e.g. {fix nve/spin}).
[(Mayergoyz)] I.D. Mayergoyz, G. Bertotti, C. Serpico (2009). Elsevier (2009)
:link(Tranchida2)
[(Tranchida)] Tranchida, Plimpton, Thibaudeau and Thompson,
arXiv preprint arXiv:1801.10233, (2018).
[(Tranchida)] Tranchida, Plimpton, Thibaudeau and Thompson,
Journal of Computational Physics, (2018).

View File

@ -73,4 +73,4 @@ instead of "array" is also valid.
:link(Tranchida1)
[(Tranchida)] Tranchida, Plimpton, Thibaudeau and Thompson,
arXiv preprint arXiv:1801.10233, (2018).
Journal of Computational Physics, (2018).

View File

@ -10,16 +10,21 @@ pair_style atm command :h3
[Syntax:]
pair_style atm args = cutoff :pre
pair_style atm cutoff :pre
cutoff = global cutoff for 3-body interactions (distance units) :ul
[Examples:]
pair_style 2.5
pair_coeff * * * 0.072 :pre
pair_style hybrid/overlay lj/cut 6.5 atm 2.5
pair_coeff * * lj/cut 1.0 1.0
pair_coeff * * atm * 0.072 :pre
pair_style hybrid/overlay lj/cut 6.5 atm 2.5
pair_coeff * * lj/cut 1.0 1.0
pair_coeff 1 1 atm 1 0.064
pair_coeff 1 1 atm 2 0.080
pair_coeff 1 2 atm 2 0.100
pair_coeff 2 2 atm 2 0.125 :pre
[Description:]
@ -28,36 +33,104 @@ potential for the energy E of a system of atoms as
:c,image(Eqs/pair_atm.jpg)
where r12, r23 and r31 are the distances between the atoms,
gamma1 is included by the sides r12 and r31
with similar definitions for gamma2 and gamma3,
nu is the three-body interaction strength (energy times distance^9 units).
where nu is the three-body interaction strength,
and the distances between pairs of atoms r12, r23 and r31
and the angles gamma1, gamma2 and gamma3
are shown at the diagram:
The {atm} is typically used in compination with some two-body potential
using "hybrid/overlay"_pair_hybrid.html style as in an example above.
:c,image(JPG/pair_atm_dia.jpg)
The calculations are not undertaken if the distances between atoms satisfy
r12 r23 r31 > curoff^3. Virtual cutoff distance based on a user defined
tolerance tol is not used.
There is no \"central\" atom, the interaction is symmetric with respect
to permutation of atom types.
The Axilrod-Teller-Muto potential file must contain entries for all the
elements listed in the pair_coeff command. It can also contain
entries for additional elements not being used in a particular
simulation; LAMMPS ignores those entries.
The {atm} potential is typically used in combination with a two-body
potential using the "pair_style hybrid/overlay"_pair_hybrid.html
command as in the example above.
For a single-element simulation, only a single entry is required
(e.g. 1 1 1). For a two-element simulation, the file must contain 4
entries (eg. 1 1 1, 1 1 2, 1 2 2, 2 2 2), that
specify ATM parameters for all combinations of the two elements
interacting in three-body configurations. Thus for 3 elements, 10
entries would be required, etc.
The potential is calculated if all three atoms are in the
"neighbor list"_neighbor.html
and the distances between atoms satisfy r12 r23 r31 > cutoff^3.
The following coefficients must be defined for each pair of atoms
types via the "pair_coeff"_pair_coeff.html command as in the examples
above, or in the restart files read by the
"read_restart"_read_restart.html commands:
K - the type of the third atom
nu (energy/distance^9 units) :ul
For a single-atom type simulation, only a single entry is required, eg
pair_coeff 1 1 1 nu :pre
where all three atoms are of type 1.
For a two-atom type simulation, more pair_coeff commands can be used.
ATM interaction is symmetric with respect to permutation of atoms,
it is necessary to provide pair_coeff command for one permutation.
For example, the command
pair_coeff 1 1 2 nu :pre
also implies
pair_coeff 1 2 1 nu
pair_coeff 2 1 1 nu :pre
Thus, to specify all ATM interactions between two atom types (eg 1 and 2)
it is sufficient to provide four pair_coeff commands, eg:
pair_coeff 1 1 1 nu1
pair_coeff 1 1 2 nu2
pair_coeff 1 2 2 nu3
pair_coeff 2 2 2 nu4 :pre
For 3 atom types, 10 pair_coeff commands
(eg 111, 112, 113, 122, 123, 133, 222, 223, 233, 333)
will describe all possible ATM interactions, etc.
It is not necessary to provide the pair_coeff commands for interactions
of all combinations of atom types: if some combination is not defined then
there is no ATM interaction for this combination and all its permutations.
--------------------
[Steve:]
I think a better syntax for the pair coeff command might be this:
pair_coeff I J v1 v2 ... vN
when 1,2,...N are the number of atom types defined.
Then there be one pair_coeff command for each type pair,
the same syntax as all other potentials in LAMMPS use.
[Sergey:]
The reason for my original pair_coeff command syntax is that
I would like to reserve further arguments for possible extension of
ATM potential in LAMMPS to further terms in the multipole expansion of
many-body dispersion interaction.
For example, the next term would be dipole-dipole-quadrupole, it may be
activated if the next argument of pair_coeff is present
without breaking backward compatibility.
Also, the command you propose
(i) will not account that the value of nu for different permutations
of atom types is the same, and
(ii) will make the numbering of atom types messy since there is
no requirement to supply the values of nu for all triplets.
--------------------
:line
[Shift, table, tail correction, rRESPA info]:
[Mixing, shift, table, tail correction, restart, rRESPA info]:
This pair style does not support the "pair_modify"_pair_modify.html
shift, table, and tail options.
This pair styles do not support the "pair_modify"_pair_modify.html
mix, shift, table, and tail options.
This pair style writes its information to "binary restart
files"_restart.html, so pair_style and pair_coeff commands do not need
to be specified in an input script that reads a restart file.
This pair style can only be used via the {pair} keyword of the
"run_style respa"_run_style.html command. It does not support the
@ -68,8 +141,8 @@ This pair style can only be used via the {pair} keyword of the
[Restrictions:]
This pair style is part of the MANYBODY package. It is only enabled
if LAMMPS was built with that package. See
the "Making LAMMPS"_Section_start.html#start_3 section for more info.
if LAMMPS was built with that package. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info.
[Related commands:]
@ -82,4 +155,4 @@ the "Making LAMMPS"_Section_start.html#start_3 section for more info.
:link(Axilrod)
[(Axilrod)]
Axilrod and Teller, J Chem Phys, 11, 299 (1943);
Muto, Nippon Sugaku Butsuri Gakkwaishi 17, 629 (1943).
Muto, Nippon Sugaku-Buturigakkwaishi 17, 629 (1943).

View File

@ -63,4 +63,4 @@ See the "Making LAMMPS"_Section_start.html#start_3 section for more info.
:link(Tranchida5)
[(Tranchida)] Tranchida, Plimpton, Thibaudeau and Thompson,
arXiv preprint arXiv:1801.10233, (2018).
Journal of Computational Physics, (2018).

View File

@ -79,4 +79,4 @@ See the "Making LAMMPS"_Section_start.html#start_3 section for more info.
:link(Tranchida3)
[(Tranchida)] Tranchida, Plimpton, Thibaudeau and Thompson,
arXiv preprint arXiv:1801.10233, (2018).
Journal of Computational Physics, (2018).

View File

@ -70,4 +70,4 @@ See the "Making LAMMPS"_Section_start.html#start_3 section for more info.
:link(Tranchida4)
[(Tranchida)] Tranchida, Plimpton, Thibaudeau, and Thompson,
arXiv preprint arXiv:1801.10233, (2018).
Journal of Computational Physics, (2018).

View File

@ -78,4 +78,4 @@ See the "Making LAMMPS"_Section_start.html#start_3 section for more info.
:link(Tranchida6)
[(Tranchida)] Tranchida, Plimpton, Thibaudeau and Thompson,
arXiv preprint arXiv:1801.10233, (2018).
Journal of Computational Physics, (2018).

View File

@ -138,13 +138,19 @@ iterations of level 1 for a single iteration of level 2, N2 is the
iterations of level 2 per iteration of level 3, etc. N-1 looping
parameters must be specified.
The "timestep"_timestep.html command sets the timestep for the
outermost rRESPA level. Thus if the example command above for a
4-level rRESPA had an outer timestep of 4.0 fmsec, the inner timestep
would be 8x smaller or 0.5 fmsec. All other LAMMPS commands that
specify number of timesteps (e.g. "neigh_modify"_neigh_modify.html
parameters, "dump"_dump.html every N timesteps, etc) refer to the
outermost timesteps.
Thus with a 4-level respa setting of "2 2 2" for the 3 loop factors,
you could choose to have bond interactions computed 8x per large
timestep, angle interactions computed 4x, pair interactions computed
2x, and long-range interactions once per large timestep.
The "timestep"_timestep.html command sets the large timestep for the
outermost rRESPA level. Thus if the 3 loop factors are "2 2 2" for
4-level rRESPA, and the outer timestep is set to 4.0 fmsec, then the
inner timestep would be 8x smaller or 0.5 fmsec. All other LAMMPS
commands that specify number of timesteps (e.g. "thermo"_thermo.html
for thermo output every N steps, "neigh_modify
delay/every"_neigh_modify.html parameters, "dump"_dump.html every N
steps, etc) refer to the outermost timesteps.
The rRESPA keywords enable you to specify at what level of the
hierarchy various forces will be computed. If not specified, the
@ -167,11 +173,17 @@ have their force go ramped to 0.0 so the overlap with the next regime
compute forces for all pairs from 5.0 outward, with those from 5.0 to
6.0 having their value ramped in an inverse manner.
Only some pair potentials support the use of the {inner} and {middle}
and {outer} keywords. If not, only the {pair} keyword can be used
with that pair style, meaning all pairwise forces are computed at the
same rRESPA level. See the doc pages for individual pair styles for
details.i
Note that you can use {inner} and {outer} without using {middle} to
split the pairwise computations into two portions instead of three.
Unless you are using a very long pairwise cutoff, a 2-way split is
often faster than a 3-way split, since it avoids too much duplicate
computation of pairwise interactions near the intermediate cutoffs.
Also note that only a few pair potentials support the use of the
{inner} and {middle} and {outer} keywords. If not, only the {pair}
keyword can be used with that pair style, meaning all pairwise forces
are computed at the same rRESPA level. See the doc pages for
individual pair styles for details.
Another option for using pair potentials with rRESPA is with the
{hybrid} keyword, which requires the use of the "pair_style hybrid or
@ -238,12 +250,24 @@ roughly a 1.5 fold speedup over the {verlet} style with SHAKE and a
For non-biomolecular simulations, the {respa} style can be
advantageous if there is a clear separation of time scales - fast and
slow modes in the simulation. Even a LJ system can benefit from
rRESPA if the interactions are divided by the inner, middle and outer
keywords. A 2-fold or more speedup can be obtained while maintaining
good energy conservation. In real units, for a pure LJ fluid at
liquid density, with a sigma of 3.0 angstroms, and epsilon of 0.1
Kcal/mol, the following settings seem to work well:
slow modes in the simulation. For example, a system of slowly-moving
charged polymer chains could be setup as follows:
timestep 4.0
run_style respa 2 8 :pre
This is two-level rRESPA with an 8x difference between the short and
long timesteps. The bonds, angles, dihedrals will be computed every
0.5 fs (assuming real units), while the pair and kspace interactions
will be computed once every 4 fs. These are the default settings for
each kind of interaction, so no additional keywords are necessary.
Even a LJ system can benefit from rRESPA if the interactions are
divided by the inner, middle and outer keywords. A 2-fold or more
speedup can be obtained while maintaining good energy conservation.
In real units, for a pure LJ fluid at liquid density, with a sigma of
3.0 angstroms, and epsilon of 0.1 Kcal/mol, the following settings
seem to work well:
timestep 36.0
run_style respa 3 3 4 inner 1 3.0 4.0 middle 2 6.0 7.0 outer 3 :pre
@ -271,9 +295,9 @@ more instructions on how to use the accelerated styles effectively.
[Restrictions:]
The {verlet/split} style can only be used if LAMMPS was built with the
REPLICA package. Correspondingly the {respa/omp} style is available only
if the USER-OMP package was included. See the "Making LAMMPS"_Section_start.html#start_3
section for more info on packages.
REPLICA package. Correspondingly the {respa/omp} style is available
only if the USER-OMP package was included. See the "Making
LAMMPS"_Section_start.html#start_3 section for more info on packages.
Whenever using rRESPA, the user should experiment with trade-offs in
speed and accuracy for their system, and verify that they are
@ -287,6 +311,17 @@ conserving energy to adequate precision.
run_style verlet :pre
For run_style respa, the default assignment of interactions
to rRESPA levels is as follows:
bond forces = level 1 (innermost loop)
angle forces = same level as bond forces
dihedral forces = same level as angle forces
improper forces = same level as dihedral forces
pair forces = leven N (outermost level)
kspace forces = same level as pair forces
inner, middle, outer forces = no default :ul
:line
:link(Tuckerman3)

View File

@ -17,6 +17,7 @@ ID = atom ID range or type range or mol ID range or group ID or region ID :l
one or more keyword/value pairs may be appended :l
keyword = {type} or {type/fraction} or {mol} or {x} or {y} or {z} or \
{charge} or {dipole} or {dipole/random} or {quat} or \
{spin} or {spin/random} or {quat} or \
{quat/random} or {diameter} or {shape} or \
{length} or {tri} or {theta} or {theta/random} or \
{angmom} or {omega} or \
@ -43,6 +44,13 @@ keyword = {type} or {type/fraction} or {mol} or {x} or {y} or {z} or \
{dipole/random} value = seed Dlen
seed = random # seed (positive integer) for dipole moment orientations
Dlen = magnitude of dipole moment (dipole units)
{spin} values = g x y z
g = magnitude of magnetic spin vector (in Bohr magneton's unit)
x,y,z = orientation of magnetic spin vector
any of x,y,z can be an atom-style variable (see below)
{spin/random} value = seed Dlen
seed = random # seed (positive integer) for magnetic spin orientations
Dlen = magnitude of magnetic spin vector (in Bohr magneton's unit)
{quat} values = a b c theta
a,b,c = unit vector to rotate particle around via right-hand rule
theta = rotation angle (degrees)
@ -232,6 +240,15 @@ the orientation of a particular atom is the same, regardless of how
many processors are being used. This keyword does not allow use of an
atom-style variable.
Keyword {spin} uses the specified g value to set the magnitude of the
magnetic spin vectors, and the x,y,z values as components of a vector
to set as the orientation of the magnetic spin vectors of the selected
atoms.
Keyword {spin/random} randomizes the orientation of the magnetic spin
vectors for the selected atoms and sets the magnitude of each to the
specified {Dlen} value.
Keyword {quat} uses the specified values to create a quaternion
(4-vector) that represents the orientation of the selected atoms. The
particles must define a quaternion for their orientation

20
examples/SPIN/README Normal file
View File

@ -0,0 +1,20 @@
This directory contains examples and applications of the SPIN package
=====================================================================
- the iron, cobalt_hcp, cobalt_fcc and nickel directories provide
examples of spin-lattice calculations.
- the bfo repository provides an example of spin dynamics calculation
performed on a fixed lattice, and applied to the multiferroic
material bismuth-oxide.
- the read_restart directory provides examples allowing to write or
read data files, and restart magneto-mechanical simulations.
- vizualization of the dump files can be achieved using Ovito or
VMD. See the vmd repository for help vizualizing results with VMD.
** Note, the aim of this repository is mainly to provide users with
examples. Better values and tuning of the magnetic and mechanical
interactions can be achieved for more accurate materials
simulations. **

View File

@ -79,7 +79,10 @@ OBJS = $(OBJ_DIR)/lal_atom.o $(OBJ_DIR)/lal_ans.o \
$(OBJ_DIR)/lal_lj_cubic.o $(OBJ_DIR)/lal_lj_cubic_ext.o \
$(OBJ_DIR)/lal_ufm.o $(OBJ_DIR)/lal_ufm_ext.o \
$(OBJ_DIR)/lal_dipole_long_lj.o $(OBJ_DIR)/lal_dipole_long_lj_ext.o \
$(OBJ_DIR)/lal_lj_expand_coul_long.o $(OBJ_DIR)/lal_lj_expand_coul_long_ext.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
CBNS = $(OBJ_DIR)/device.cubin $(OBJ_DIR)/device_cubin.h \
$(OBJ_DIR)/atom.cubin $(OBJ_DIR)/atom_cubin.h \
@ -137,7 +140,10 @@ CBNS = $(OBJ_DIR)/device.cubin $(OBJ_DIR)/device_cubin.h \
$(OBJ_DIR)/lj_cubic.cubin $(OBJ_DIR)/lj_cubic_cubin.h \
$(OBJ_DIR)/ufm.cubin $(OBJ_DIR)/ufm_cubin.h \
$(OBJ_DIR)/dipole_long_lj.cubin $(OBJ_DIR)/dipole_long_lj_cubin.h \
$(OBJ_DIR)/lj_expand_coul_long.cubin $(OBJ_DIR)/lj_expand_coul_long_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
all: $(OBJ_DIR) $(GPU_LIB) $(EXECS)
@ -837,6 +843,42 @@ $(OBJ_DIR)/lal_lj_expand_coul_long.o: $(ALL_H) lal_lj_expand_coul_long.h lal_lj_
$(OBJ_DIR)/lal_lj_expand_coul_long_ext.o: $(ALL_H) lal_lj_expand_coul_long.h lal_lj_expand_coul_long_ext.cpp lal_base_charge.h
$(CUDR) -o $@ -c lal_lj_expand_coul_long_ext.cpp -I$(OBJ_DIR)
$(OBJ_DIR)/coul_long_cs.cubin: lal_coul_long_cs.cu lal_precision.h lal_preprocessor.h
$(CUDA) --fatbin -DNV_KERNEL -o $@ lal_coul_long_cs.cu
$(OBJ_DIR)/coul_long_cs_cubin.h: $(OBJ_DIR)/coul_long_cs.cubin $(OBJ_DIR)/coul_long_cs.cubin
$(BIN2C) -c -n coul_long_cs $(OBJ_DIR)/coul_long_cs.cubin > $(OBJ_DIR)/coul_long_cs_cubin.h
$(OBJ_DIR)/lal_coul_long_cs.o: $(ALL_H) lal_coul_long_cs.h lal_coul_long_cs.cpp $(OBJ_DIR)/coul_long_cs_cubin.h $(OBJ_DIR)/lal_base_charge.o $(OBJ_DIR)/lal_coul_long.o
$(CUDR) -o $@ -c lal_coul_long_cs.cpp -I$(OBJ_DIR)
$(OBJ_DIR)/lal_coul_long_cs_ext.o: $(ALL_H) lal_coul_long_cs.h lal_coul_long_cs_ext.cpp lal_coul_long.h
$(CUDR) -o $@ -c lal_coul_long_cs_ext.cpp -I$(OBJ_DIR)
$(OBJ_DIR)/born_coul_long_cs.cubin: lal_born_coul_long_cs.cu lal_precision.h lal_preprocessor.h
$(CUDA) --fatbin -DNV_KERNEL -o $@ lal_born_coul_long_cs.cu
$(OBJ_DIR)/born_coul_long_cs_cubin.h: $(OBJ_DIR)/born_coul_long_cs.cubin $(OBJ_DIR)/born_coul_long_cs.cubin
$(BIN2C) -c -n born_coul_long_cs $(OBJ_DIR)/born_coul_long_cs.cubin > $(OBJ_DIR)/born_coul_long_cs_cubin.h
$(OBJ_DIR)/lal_born_coul_long_cs.o: $(ALL_H) lal_born_coul_long_cs.h lal_born_coul_long_cs.cpp $(OBJ_DIR)/born_coul_long_cs_cubin.h $(OBJ_DIR)/lal_base_charge.o $(OBJ_DIR)/lal_born_coul_long.o
$(CUDR) -o $@ -c lal_born_coul_long_cs.cpp -I$(OBJ_DIR)
$(OBJ_DIR)/lal_born_coul_long_cs_ext.o: $(ALL_H) lal_born_coul_long_cs.h lal_born_coul_long_cs_ext.cpp lal_born_coul_long.h
$(CUDR) -o $@ -c lal_born_coul_long_cs_ext.cpp -I$(OBJ_DIR)
$(OBJ_DIR)/born_coul_wolf_cs.cubin: lal_born_coul_wolf_cs.cu lal_precision.h lal_preprocessor.h
$(CUDA) --fatbin -DNV_KERNEL -o $@ lal_born_coul_wolf_cs.cu
$(OBJ_DIR)/born_coul_wolf_cs_cubin.h: $(OBJ_DIR)/born_coul_wolf_cs.cubin $(OBJ_DIR)/born_coul_wolf_cs.cubin
$(BIN2C) -c -n born_coul_wolf_cs $(OBJ_DIR)/born_coul_wolf_cs.cubin > $(OBJ_DIR)/born_coul_wolf_cs_cubin.h
$(OBJ_DIR)/lal_born_coul_wolf_cs.o: $(ALL_H) lal_born_coul_wolf_cs.h lal_born_coul_wolf_cs.cpp $(OBJ_DIR)/born_coul_wolf_cs_cubin.h $(OBJ_DIR)/lal_base_charge.o $(OBJ_DIR)/lal_born_coul_wolf.o
$(CUDR) -o $@ -c lal_born_coul_wolf_cs.cpp -I$(OBJ_DIR)
$(OBJ_DIR)/lal_born_coul_wolf_cs_ext.o: $(ALL_H) lal_born_coul_wolf_cs.h lal_born_coul_wolf_cs_ext.cpp lal_born_coul_wolf.h
$(CUDR) -o $@ -c lal_born_coul_wolf_cs_ext.cpp -I$(OBJ_DIR)
$(BIN_DIR)/nvc_get_devices: ./geryon/ucl_get_devices.cpp $(NVD_H)
$(CUDR) -o $@ ./geryon/ucl_get_devices.cpp -DUCL_CUDADR $(CUDA_LIB) -lcuda

View File

@ -0,0 +1,133 @@
# knl = Flags for Knights Landing Xeon Phi Processor,Intel Compiler/MPI,MKL FFT
# module load perftools-base perftools
# make theta -j 8
# pat_build -g mpi -u ./lmp_theta
SHELL = /bin/sh
# ---------------------------------------------------------------------
# compiler/linker settings
# specify flags and libraries needed for your compiler
CC = CC -mkl
#OPTFLAGS = -O0
OPTFLAGS = -xMIC-AVX512 -O3 -fp-model fast=2 -no-prec-div -qoverride-limits
CCFLAGS = -g -qopenmp -DLAMMPS_MEMALIGN=64 -qno-offload \
-fno-alias -ansi-alias -restrict $(OPTFLAGS)
#CCFLAGS += -DLMP_INTEL_NO_TBB
#CCFLAGS += -DLAMMPS_BIGBIG
#CCFLAGS += -D_USE_PAPI
#CCFLAGS += -D_USE_CRAYPAT_API
SHFLAGS = -fPIC
DEPFLAGS = -M
LINK = $(CC)
LINKFLAGS = -g -qopenmp $(OPTFLAGS)
LINKFLAGS += -dynamic
LIB =
#LIB += -L${TBBROOT}/lib/intel64/gcc4.7 -ltbbmalloc
LIB += -ltbbmalloc
#LIB += /soft/debuggers/forge-7.0-2017-02-16/lib/64/libdmallocthcxx.a -zmuldefs
SIZE = size
ARCHIVE = ar
ARFLAGS = -rc
SHLIBFLAGS = -shared
# ---------------------------------------------------------------------
# LAMMPS-specific settings, all OPTIONAL
# specify settings for LAMMPS features you will use
# if you change any -D setting, do full re-compile after "make clean"
# LAMMPS ifdef settings
# see possible settings in Section 2.2 (step 4) of manual
LMP_INC = -DLAMMPS_GZIP #-DLAMMPS_JPEG
# MPI library
# see discussion in Section 2.2 (step 5) of manual
# MPI wrapper compiler/linker can provide this info
# can point to dummy MPI library in src/STUBS as in Makefile.serial
# use -D MPICH and OMPI settings in INC to avoid C++ lib conflicts
# INC = path for mpi.h, MPI compiler settings
# PATH = path for MPI library
# LIB = name of MPI library
MPI_INC = -DMPICH_SKIP_MPICXX -DOMPI_SKIP_MPICXX=1
MPI_PATH =
MPI_LIB =
# FFT library
# see discussion in Section 2.2 (step 6) of manaul
# can be left blank to use provided KISS FFT library
# INC = -DFFT setting, e.g. -DFFT_FFTW, FFT compiler settings
# PATH = path for FFT library
# LIB = name of FFT library
FFT_INC = -DFFT_MKL -DFFT_SINGLE
FFT_PATH =
FFT_LIB = -L$(MKLROOT)/lib/intel64/ -Wl,--start-group -lmkl_intel_ilp64 \
-lmkl_intel_thread -lmkl_core -Wl,--end-group
# JPEG and/or PNG library
# see discussion in Section 2.2 (step 7) of manual
# only needed if -DLAMMPS_JPEG or -DLAMMPS_PNG listed with LMP_INC
# INC = path(s) for jpeglib.h and/or png.h
# PATH = path(s) for JPEG library and/or PNG library
# LIB = name(s) of JPEG library and/or PNG library
JPG_INC =
JPG_PATH =
JPG_LIB =
# ---------------------------------------------------------------------
# build rules and dependencies
# do not edit this section
include Makefile.package.settings
include Makefile.package
EXTRA_INC = $(LMP_INC) $(PKG_INC) $(MPI_INC) $(FFT_INC) $(JPG_INC) $(PKG_SYSINC)
EXTRA_PATH = $(PKG_PATH) $(MPI_PATH) $(FFT_PATH) $(JPG_PATH) $(PKG_SYSPATH)
EXTRA_LIB = $(PKG_LIB) $(MPI_LIB) $(FFT_LIB) $(JPG_LIB) $(PKG_SYSLIB)
# Path to src files
vpath %.cpp ..
vpath %.h ..
# Link target
$(EXE): $(OBJ)
$(LINK) $(LINKFLAGS) $(EXTRA_PATH) $(OBJ) $(EXTRA_LIB) $(LIB) -o $(EXE)
$(SIZE) $(EXE)
# Library targets
lib: $(OBJ)
$(ARCHIVE) $(ARFLAGS) $(EXE) $(OBJ)
shlib: $(OBJ)
$(CC) $(CCFLAGS) $(SHFLAGS) $(SHLIBFLAGS) $(EXTRA_PATH) -o $(EXE) \
$(OBJ) $(EXTRA_LIB) $(LIB)
# Compilation rules
%.o:%.cpp
$(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $<
%.d:%.cpp
$(CC) $(CCFLAGS) $(EXTRA_INC) $(DEPFLAGS) $< > $@
%.o:%.cu
$(CC) $(CCFLAGS) $(SHFLAGS) $(EXTRA_INC) -c $<
# Individual dependencies
depend : fastdep.exe $(SRC)
@./fastdep.exe $(EXTRA_INC) -- $^ > .depend || exit 1
fastdep.exe: ../DEPEND/fastdep.c
icc -O -o $@ $<
sinclude .depend

View File

@ -49,8 +49,8 @@ PairATM::PairATM(LAMMPS *lmp) : Pair(lmp)
if (lmp->citeme) lmp->citeme->add(cite_atm_package);
single_enable = 0;
restartinfo = 0;
one_coeff = 1;
restartinfo = 1;
one_coeff = 0;
manybody_flag = 1;
}
@ -78,6 +78,7 @@ void PairATM::compute(int eflag, int vflag)
double xi,yi,zi,evdwl;
double rij2,rik2,rjk2,r6;
double rij[3],rik[3],rjk[3],fj[3],fk[3];
double nu_local;
int *ilist,*jlist,*numneigh,**firstneigh;
evdwl = 0.0;
@ -128,8 +129,10 @@ void PairATM::compute(int eflag, int vflag)
r6 = rij2*rik2*rjk2;
if (r6 > cut_sixth) continue;
interaction_ddd(nu[type[i]][type[j]][type[k]],
r6,rij2,rik2,rjk2,rij,rik,rjk,fj,fk,eflag,evdwl);
nu_local = nu[type[i]][type[j]][type[k]];
if (nu_local == 0.0) continue;
interaction_ddd(nu_local,
r6,rij2,rik2,rjk2,rij,rik,rjk,fj,fk,eflag,evdwl);
f[i][0] -= fj[0] + fk[0];
f[i][1] -= fj[1] + fk[1];
@ -169,6 +172,12 @@ void PairATM::coeff(int narg, char **arg)
error->all(FLERR,"Incorrect args for pair coefficients");
if (!allocated) allocate();
int n = atom->ntypes;
for (int i = 0; i <= n; i++)
for (int j = 0; j <= n; j++)
for (int k = 0; k <= n; k++)
nu[i][j][k] = 0.0;
int ilo,ihi,jlo,jhi,klo,khi;
force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi);
force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi);
@ -229,7 +238,9 @@ void PairATM::write_restart(FILE *fp)
for (i = 1; i <= atom->ntypes; i++) {
for (j = i; j <= atom->ntypes; j++) {
fwrite(&setflag[i][j],sizeof(int),1,fp);
if (setflag[i][j]) for (k = i; k <= atom->ntypes; k++) fwrite(&nu[i][j][k],sizeof(double),1,fp);
if (setflag[i][j])
for (k = i; k <= atom->ntypes; k++)
fwrite(&nu[i][j][k],sizeof(double),1,fp);
}
}
}

View File

@ -11,10 +11,6 @@
See the README file in the top-level LAMMPS directory.
------------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
Contributing author: Sergey Lishchuk
------------------------------------------------------------------------- */
#ifdef PAIR_CLASS
PairStyle(atm,PairATM)
@ -46,9 +42,9 @@ class PairATM : public Pair {
double cut_global, cut_sixth;
double ***nu;
protected:
virtual void allocate();
void interaction_ddd(double, double, double, double, double, double *, double *, double *, double *, double *, int, double &);
void allocate();
void interaction_ddd(double, double, double, double, double, double *,
double *, double *, double *, double *, int, double &);
};
}

View File

@ -20,12 +20,12 @@
Please cite the related publication:
Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018).
Massively parallel symplectic algorithm for coupled magnetic spin dynamics
and molecular dynamics. arXiv preprint arXiv:1801.10233.
and molecular dynamics. Journal of Computational Physics.
------------------------------------------------------------------------- */
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include "atom.h"
#include "atom_vec_spin.h"
#include "comm.h"
@ -54,7 +54,7 @@ AtomVecSpin::AtomVecSpin(LAMMPS *lmp) : AtomVec(lmp)
size_data_atom = 9;
size_data_vel = 4;
xcol_data = 4;
atom->sp_flag = 1;
}

View File

@ -18,11 +18,11 @@
Please cite the related publication:
Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018).
Massively parallel symplectic algorithm for coupled magnetic spin dynamics
and molecular dynamics. arXiv preprint arXiv:1801.10233.
and molecular dynamics. Journal of Computational Physics.
------------------------------------------------------------------------- */
#include <mpi.h>
#include <string.h>
#include <cstring>
#include "atom.h"
#include "compute_spin.h"
#include "domain.h"

View File

@ -18,13 +18,13 @@
Please cite the related publication:
Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018).
Massively parallel symplectic algorithm for coupled magnetic spin dynamics
and molecular dynamics. arXiv preprint arXiv:1801.10233.
and molecular dynamics. Journal of Computational Physics.
------------------------------------------------------------------------- */
#include <mpi.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include "atom.h"
#include "atom_vec_ellipsoid.h"

View File

@ -18,12 +18,12 @@
Please cite the related publication:
Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018).
Massively parallel symplectic algorithm for coupled magnetic spin dynamics
and molecular dynamics. arXiv preprint arXiv:1801.10233.
and molecular dynamics. Journal of Computational Physics.
------------------------------------------------------------------------- */
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <cmath>
#include <cstdio>
#include <cstring>
#include "atom.h"
#include "atom_vec.h"
@ -59,8 +59,9 @@ static const char cite_fix_nve_spin[] =
"title={Massively parallel symplectic algorithm for coupled magnetic spin "
"dynamics and molecular dynamics},\n"
"author={Tranchida, J and Plimpton, SJ and Thibaudeau, P and Thompson, AP},\n"
"journal={arXiv preprint arXiv:1801.10233},\n"
"year={2018}\n"
"journal={Journal of Computational Physics},\n"
"year={2018},\n"
"publisher={Elsevier}\n"
"}\n\n";
enum{NONE};

View File

@ -18,13 +18,13 @@
Please cite the related publication:
Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018).
Massively parallel symplectic algorithm for coupled magnetic spin dynamics
and molecular dynamics. arXiv preprint arXiv:1801.10233.
and molecular dynamics. Journal of Computational Physics.
------------------------------------------------------------------------- */
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include "atom.h"
#include "domain.h"

View File

@ -18,12 +18,12 @@
Please cite the related publication:
Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018).
Massively parallel symplectic algorithm for coupled magnetic spin dynamics
and molecular dynamics. arXiv preprint arXiv:1801.10233.
and molecular dynamics. Journal of Computational Physics.
------------------------------------------------------------------------- */
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include "atom.h"
#include "comm.h"

View File

@ -18,12 +18,12 @@
Please cite the related publication:
Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018).
Massively parallel symplectic algorithm for coupled magnetic spin dynamics
and molecular dynamics. arXiv preprint arXiv:1801.10233.
and molecular dynamics. Journal of Computational Physics.
------------------------------------------------------------------------- */
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include "atom.h"
#include "comm.h"

View File

@ -18,12 +18,12 @@
Please cite the related publication:
Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018).
Massively parallel symplectic algorithm for coupled magnetic spin dynamics
and molecular dynamics. arXiv preprint arXiv:1801.10233.
and molecular dynamics. Journal of Computational Physics.
------------------------------------------------------------------------- */
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include "atom.h"
#include "comm.h"

View File

@ -18,12 +18,12 @@
Please cite the related publication:
Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018).
Massively parallel symplectic algorithm for coupled magnetic spin dynamics
and molecular dynamics. arXiv preprint arXiv:1801.10233.
and molecular dynamics. Journal of Computational Physics.
------------------------------------------------------------------------- */
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include "atom.h"
#include "comm.h"
@ -436,9 +436,9 @@ void PairSpinMagelec::compute_magelec_mech(int i, int j, double fi[3], double sp
meiy *= ME_mech[itype][jtype];
meiz *= ME_mech[itype][jtype];
fi[0] = meiy*vz - meiz*vy;
fi[1] = meiz*vx - meix*vz;
fi[2] = meix*vy - meiy*vx;
fi[0] += meiy*vz - meiz*vy;
fi[1] += meiz*vx - meix*vz;
fi[2] += meix*vy - meiy*vx;
}

View File

@ -18,12 +18,12 @@
Please cite the related publication:
Tranchida, J., Plimpton, S. J., Thibaudeau, P., & Thompson, A. P. (2018).
Massively parallel symplectic algorithm for coupled magnetic spin dynamics
and molecular dynamics. arXiv preprint arXiv:1801.10233.
and molecular dynamics. Journal of Computational Physics.
------------------------------------------------------------------------- */
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include "atom.h"
#include "comm.h"

View File

@ -350,13 +350,13 @@ void Balance::command(int narg, char **arg)
domain->set_local_box();
// move particles to new processors via irregular()
// set disable = 0, so weights migrate with atoms for imbfinal calculation
if (domain->triclinic) domain->x2lamda(atom->nlocal);
Irregular *irregular = new Irregular(lmp);
if (wtflag) fixstore->disable = 0;
if (style == BISECTION) irregular->migrate_atoms(1,1,rcb->sendproc);
else irregular->migrate_atoms(1);
if (wtflag) fixstore->disable = 1;
delete irregular;
if (domain->triclinic) domain->lamda2x(atom->nlocal);
@ -377,9 +377,11 @@ void Balance::command(int narg, char **arg)
}
// imbfinal = final imbalance
// set disable = 1, so weights no longer migrate with atoms
double maxfinal;
double imbfinal = imbalance_factor(maxfinal);
if (wtflag) fixstore->disable = 1;
// stats output
@ -540,6 +542,8 @@ void Balance::weight_storage(char *prefix)
fixstore = (FixStore *) modify->fix[modify->nfix-1];
} else fixstore = (FixStore *) modify->fix[ifix];
// do not carry weights with atoms during normal atom migration
fixstore->disable = 1;
if (prefix) delete [] fixargs[0];

View File

@ -114,6 +114,7 @@ FixBalance::FixBalance(LAMMPS *lmp, int narg, char **arg) :
if (nevery) force_reneighbor = 1;
lastbalance = -1;
next_reneighbor = -1;
// compute initial outputs
@ -248,6 +249,10 @@ void FixBalance::pre_neighbor()
if (!pending) return;
imbfinal = balance->imbalance_factor(maxloadperproc);
pending = 0;
// set disable = 1, so weights no longer migrate with atoms
if (wtflag) balance->fixstore->disable = 1;
}
/* ----------------------------------------------------------------------
@ -275,21 +280,23 @@ void FixBalance::rebalance()
// reset proc sub-domains
// check and warn if any proc's subbox is smaller than neigh skin
// since may lead to lost atoms in exchange()
// since may lead to lost atoms in comm->exchange()
if (domain->triclinic) domain->set_lamda_box();
domain->set_local_box();
domain->subbox_too_small_check(neighbor->skin);
// move atoms to new processors via irregular()
// only needed if migrate_check() says an atom moves to far
// for non-RCB only needed if migrate_check() says an atom moves too far
// else allow caller's comm->exchange() to do it
// set disable = 0, so weights migrate with atoms
// important to delay disable = 1 until after pre_neighbor imbfinal calc
// b/c atoms may migrate again in comm->exchange()
if (domain->triclinic) domain->x2lamda(atom->nlocal);
if (wtflag) balance->fixstore->disable = 0;
if (lbstyle == BISECTION) irregular->migrate_atoms(0,1,sendproc);
else if (irregular->migrate_check()) irregular->migrate_atoms();
if (wtflag) balance->fixstore->disable = 1;
if (domain->triclinic) domain->lamda2x(atom->nlocal);
// invoke KSpace setup_grid() to adjust to new proc sub-domains

View File

@ -154,8 +154,6 @@ void FixStore::reset_global(int nrow_caller, int ncol_caller)
if (vecflag) memory->create(vstore,nrow,"fix/store:vstore");
else memory->create(astore,nrow,ncol,"fix/store:astore");
memory->create(rbuf,nrow*ncol+2,"fix/store:rbuf");
// printf("AAA HOW GET HERE\n");
}
/* ----------------------------------------------------------------------

View File

@ -16,6 +16,7 @@
#include "atom_vec.h"
#include "domain.h"
#include "comm.h"
#include "special.h"
#include "memory.h"
#include "error.h"
@ -44,7 +45,7 @@ void ResetIDs::command(int narg, char **arg)
}
// create an atom map if one doesn't exist already
int mapflag = 0;
if (atom->map_style == 0) {
mapflag = 1;
@ -93,7 +94,7 @@ void ResetIDs::command(int narg, char **arg)
// forward_comm_array acquires new IDs for ghost atoms
double **newIDs;
memory->create(newIDs,nall,1,"reset_ids:newIDs");
memory->create(newIDs,nall,1,"reset_ids:newIDs");
for (int i = 0; i < nlocal; i++) {
newIDs[i][0] = tag[i];
@ -105,7 +106,7 @@ void ResetIDs::command(int narg, char **arg)
// loop over bonds, angles, etc and reset IDs in stored topology arrays
// only necessary for molecular = 1, not molecular = 2
// badcount = atom IDs that could not be found
int badcount = 0;
if (atom->molecular == 1) {
@ -232,8 +233,15 @@ void ResetIDs::command(int narg, char **arg)
atom->map_init();
atom->map_set();
// need to update exclusions with new atom IDs
if (atom->molecular == 1) {
Special special(lmp);
special.build();
}
// delete temporary atom map
if (mapflag) {
atom->map_delete();
atom->map_style = 0;