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
|
||||
*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
|
||||
""""""""
|
||||
|
||||
@ -10,13 +10,9 @@ shell echo "test1"
|
||||
atom_modify map array
|
||||
lattice sc 3.0
|
||||
region box block 0 2 0 1 0 1
|
||||
shell echo "test1"
|
||||
create_box 1 box
|
||||
shell echo "test1"
|
||||
create_atoms 1 box
|
||||
|
||||
shell echo "test1"
|
||||
|
||||
mass 1 55.845
|
||||
set atom 1 spin 2.0 1.0 0.0 0.0
|
||||
set atom 2 spin 2.0 0.0 1.0 0.0
|
||||
|
||||
@ -3,6 +3,7 @@
|
||||
clear
|
||||
units metal
|
||||
atom_style spin
|
||||
# atom_style spin/kk
|
||||
|
||||
dimension 3
|
||||
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 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
|
||||
|
||||
# compute Lammps
|
||||
./../../../../src/lmp_serial \
|
||||
-in in.spin.iron-nve
|
||||
# mpirun -np 1 ../../../../src/lmp_kokkos_mpi_only \
|
||||
# -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}')"
|
||||
en="$(grep -n Loop log.lammps | awk -F ':' '{print $1}')"
|
||||
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_long,atomKK->fm_long,nmax,"atom:fm_long");
|
||||
|
||||
grow_pointers();
|
||||
atomKK->sync(Host,ALL_MASK);
|
||||
|
||||
if (atom->nextra_grow)
|
||||
for (int iextra = 0; iextra < atom->nextra_grow; iextra++)
|
||||
modify->fix[atom->extra_grow[iextra]]->grow_arrays(nmax);
|
||||
@ -106,7 +109,7 @@ void AtomVecSpinKokkos::grow(int n)
|
||||
reset local array ptrs
|
||||
------------------------------------------------------------------------- */
|
||||
|
||||
void AtomVecSpinKokkos::grow_reset()
|
||||
void AtomVecSpinKokkos::grow_pointers()
|
||||
{
|
||||
tag = atomKK->tag;
|
||||
d_tag = atomKK->k_tag.d_view;
|
||||
@ -121,7 +124,7 @@ void AtomVecSpinKokkos::grow_reset()
|
||||
image = atomKK->image;
|
||||
d_image = atomKK->k_image.d_view;
|
||||
h_image = atomKK->k_image.h_view;
|
||||
|
||||
|
||||
x = atomKK->x;
|
||||
d_x = atomKK->k_x.d_view;
|
||||
h_x = atomKK->k_x.h_view;
|
||||
@ -389,7 +392,7 @@ int AtomVecSpinKokkos::pack_border(int n, int *list, double *buf,
|
||||
buf[m++] = h_sp(j,3);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (atom->nextra_border)
|
||||
for (int iextra = 0; iextra < atom->nextra_border; iextra++)
|
||||
m += modify->fix[atom->extra_border[iextra]]->pack_border(n,list,&buf[m]);
|
||||
@ -478,7 +481,7 @@ int AtomVecSpinKokkos::pack_border_vel(int n, int *list, double *buf,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (atom->nextra_border)
|
||||
for (int iextra = 0; iextra < atom->nextra_border; iextra++)
|
||||
m += modify->fix[atom->extra_border[iextra]]->pack_border(n,list,&buf[m]);
|
||||
@ -1026,8 +1029,8 @@ void AtomVecSpinKokkos::create_atom(int itype, double *coord)
|
||||
atomKK->sync(Host,ALL_MASK);
|
||||
atomKK->modified(Host,ALL_MASK);
|
||||
|
||||
tag[nlocal] = 0;
|
||||
type[nlocal] = itype;
|
||||
h_tag[nlocal] = 0;
|
||||
h_type[nlocal] = itype;
|
||||
h_x(nlocal,0) = coord[0];
|
||||
h_x(nlocal,1) = coord[1];
|
||||
h_x(nlocal,2) = coord[2];
|
||||
|
||||
@ -56,7 +56,7 @@ class AtomVecSpinKokkos : public AtomVecKokkos {
|
||||
|
||||
void force_clear(int, size_t);
|
||||
|
||||
void grow_reset();
|
||||
void grow_pointers();
|
||||
// input lists to be checked
|
||||
int pack_border_kokkos(int n, DAT::tdual_int_2d k_sendlist,
|
||||
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
|
||||
|
||||
//2d X_FLOAT array n*3
|
||||
typedef Kokkos::DualView<X_FLOAT*[3], Kokkos::LayoutRight, LMPDeviceType> tdual_sp_array;
|
||||
//2d X_FLOAT array n*4
|
||||
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_const t_sp_array_const;
|
||||
typedef tdual_sp_array::t_host_um t_sp_array_um;
|
||||
|
||||
Reference in New Issue
Block a user