Merge branch 'spin-kokkos' of github.com:julient31/lammps into spin-kokkos
This commit is contained in:
@ -27,7 +27,7 @@ Syntax
|
|||||||
template-ID = ID of molecule template specified in a separate :doc:`molecule <molecule>` command
|
template-ID = ID of molecule template specified in a separate :doc:`molecule <molecule>` command
|
||||||
*hybrid* args = list of one or more sub-styles, each with their args
|
*hybrid* args = list of one or more sub-styles, each with their args
|
||||||
|
|
||||||
* accelerated styles (with same args) = *angle/kk* or *atomic/kk* or *bond/kk* or *charge/kk* or *full/kk* or *molecular/kk*
|
* accelerated styles (with same args) = *angle/kk* or *atomic/kk* or *bond/kk* or *charge/kk* or *full/kk* or *molecular/kk* or *spin/kk*
|
||||||
|
|
||||||
Examples
|
Examples
|
||||||
""""""""
|
""""""""
|
||||||
|
|||||||
@ -10,13 +10,9 @@ shell echo "test1"
|
|||||||
atom_modify map array
|
atom_modify map array
|
||||||
lattice sc 3.0
|
lattice sc 3.0
|
||||||
region box block 0 2 0 1 0 1
|
region box block 0 2 0 1 0 1
|
||||||
shell echo "test1"
|
|
||||||
create_box 1 box
|
create_box 1 box
|
||||||
shell echo "test1"
|
|
||||||
create_atoms 1 box
|
create_atoms 1 box
|
||||||
|
|
||||||
shell echo "test1"
|
|
||||||
|
|
||||||
mass 1 55.845
|
mass 1 55.845
|
||||||
set atom 1 spin 2.0 1.0 0.0 0.0
|
set atom 1 spin 2.0 1.0 0.0 0.0
|
||||||
set atom 2 spin 2.0 0.0 1.0 0.0
|
set atom 2 spin 2.0 0.0 1.0 0.0
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
clear
|
clear
|
||||||
units metal
|
units metal
|
||||||
atom_style spin
|
atom_style spin
|
||||||
|
# atom_style spin/kk
|
||||||
|
|
||||||
dimension 3
|
dimension 3
|
||||||
boundary p p p
|
boundary p p p
|
||||||
@ -46,4 +47,8 @@ variable tmag equal c_out_mag[6]
|
|||||||
thermo_style custom step time v_tmag temp v_emag ke pe etotal
|
thermo_style custom step time v_tmag temp v_emag ke pe etotal
|
||||||
thermo 200
|
thermo 200
|
||||||
|
|
||||||
run 100000
|
compute outsp all property/atom spx spy spz sp fmx fmy fmz
|
||||||
|
dump 1 all custom 10 dump_iron.lammpstrj type x y z c_outsp[1] c_outsp[2] c_outsp[3]
|
||||||
|
|
||||||
|
# run 100000
|
||||||
|
run 10000
|
||||||
|
|||||||
@ -4,8 +4,9 @@
|
|||||||
rm res_*.dat
|
rm res_*.dat
|
||||||
|
|
||||||
# compute Lammps
|
# compute Lammps
|
||||||
./../../../../src/lmp_serial \
|
# mpirun -np 1 ../../../../src/lmp_kokkos_mpi_only \
|
||||||
-in in.spin.iron-nve
|
# -k on -sf kk -in in.spin.iron-nve
|
||||||
|
../../../../src/lmp_serial -in in.spin.iron-nve
|
||||||
in="$(grep -n Step log.lammps | awk -F ':' '{print $1}')"
|
in="$(grep -n Step log.lammps | awk -F ':' '{print $1}')"
|
||||||
en="$(grep -n Loop log.lammps | awk -F ':' '{print $1}')"
|
en="$(grep -n Loop log.lammps | awk -F ':' '{print $1}')"
|
||||||
in="$(echo "$in+1" | bc -l)"
|
in="$(echo "$in+1" | bc -l)"
|
||||||
|
|||||||
@ -97,6 +97,9 @@ void AtomVecSpinKokkos::grow(int n)
|
|||||||
memoryKK->grow_kokkos(atomKK->k_fm,atomKK->fm,nmax,"atom:fm");
|
memoryKK->grow_kokkos(atomKK->k_fm,atomKK->fm,nmax,"atom:fm");
|
||||||
memoryKK->grow_kokkos(atomKK->k_fm_long,atomKK->fm_long,nmax,"atom:fm_long");
|
memoryKK->grow_kokkos(atomKK->k_fm_long,atomKK->fm_long,nmax,"atom:fm_long");
|
||||||
|
|
||||||
|
grow_pointers();
|
||||||
|
atomKK->sync(Host,ALL_MASK);
|
||||||
|
|
||||||
if (atom->nextra_grow)
|
if (atom->nextra_grow)
|
||||||
for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
|
for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
|
||||||
modify->fix[atom->extra_grow[iextra]]->grow_arrays(nmax);
|
modify->fix[atom->extra_grow[iextra]]->grow_arrays(nmax);
|
||||||
@ -106,7 +109,7 @@ void AtomVecSpinKokkos::grow(int n)
|
|||||||
reset local array ptrs
|
reset local array ptrs
|
||||||
------------------------------------------------------------------------- */
|
------------------------------------------------------------------------- */
|
||||||
|
|
||||||
void AtomVecSpinKokkos::grow_reset()
|
void AtomVecSpinKokkos::grow_pointers()
|
||||||
{
|
{
|
||||||
tag = atomKK->tag;
|
tag = atomKK->tag;
|
||||||
d_tag = atomKK->k_tag.d_view;
|
d_tag = atomKK->k_tag.d_view;
|
||||||
@ -1026,8 +1029,8 @@ void AtomVecSpinKokkos::create_atom(int itype, double *coord)
|
|||||||
atomKK->sync(Host,ALL_MASK);
|
atomKK->sync(Host,ALL_MASK);
|
||||||
atomKK->modified(Host,ALL_MASK);
|
atomKK->modified(Host,ALL_MASK);
|
||||||
|
|
||||||
tag[nlocal] = 0;
|
h_tag[nlocal] = 0;
|
||||||
type[nlocal] = itype;
|
h_type[nlocal] = itype;
|
||||||
h_x(nlocal,0) = coord[0];
|
h_x(nlocal,0) = coord[0];
|
||||||
h_x(nlocal,1) = coord[1];
|
h_x(nlocal,1) = coord[1];
|
||||||
h_x(nlocal,2) = coord[2];
|
h_x(nlocal,2) = coord[2];
|
||||||
|
|||||||
@ -56,7 +56,7 @@ class AtomVecSpinKokkos : public AtomVecKokkos {
|
|||||||
|
|
||||||
void force_clear(int, size_t);
|
void force_clear(int, size_t);
|
||||||
|
|
||||||
void grow_reset();
|
void grow_pointers();
|
||||||
// input lists to be checked
|
// input lists to be checked
|
||||||
int pack_border_kokkos(int n, DAT::tdual_int_2d k_sendlist,
|
int pack_border_kokkos(int n, DAT::tdual_int_2d k_sendlist,
|
||||||
DAT::tdual_xfloat_2d buf,int iswap,
|
DAT::tdual_xfloat_2d buf,int iswap,
|
||||||
|
|||||||
@ -1039,8 +1039,8 @@ typedef tdual_virial_array::t_host_const_randomread t_virial_array_randomread;
|
|||||||
|
|
||||||
// Spin types
|
// Spin types
|
||||||
|
|
||||||
//2d X_FLOAT array n*3
|
//2d X_FLOAT array n*4
|
||||||
typedef Kokkos::DualView<X_FLOAT*[3], Kokkos::LayoutRight, LMPDeviceType> tdual_sp_array;
|
typedef Kokkos::DualView<X_FLOAT*[4], Kokkos::LayoutRight, LMPDeviceType> tdual_sp_array;
|
||||||
typedef tdual_sp_array::t_host t_sp_array;
|
typedef tdual_sp_array::t_host t_sp_array;
|
||||||
typedef tdual_sp_array::t_host_const t_sp_array_const;
|
typedef tdual_sp_array::t_host_const t_sp_array_const;
|
||||||
typedef tdual_sp_array::t_host_um t_sp_array_um;
|
typedef tdual_sp_array::t_host_um t_sp_array_um;
|
||||||
|
|||||||
Reference in New Issue
Block a user