Small cleanup

This commit is contained in:
Stan Gerald Moore
2023-01-03 10:09:47 -07:00
parent 295d8a6903
commit a3572b61d8
3 changed files with 64 additions and 71 deletions

View File

@ -320,6 +320,8 @@ action pair_multi_lucy_rx_kokkos.cpp pair_multi_lucy_rx.cpp
action pair_multi_lucy_rx_kokkos.h pair_multi_lucy_rx.h
action pair_pace_kokkos.cpp pair_pace.cpp
action pair_pace_kokkos.h pair_pace.h
action pair_pace_extrapolation_kokkos.cpp pair_pace_extrapolation.cpp
action pair_pace_extrapolation_kokkos.h pair_pace_extrapolation.h
action pair_reaxff_kokkos.cpp pair_reaxff.cpp
action pair_reaxff_kokkos.h pair_reaxff.h
action pair_snap_kokkos.cpp pair_snap.cpp

View File

@ -41,8 +41,7 @@ namespace LAMMPS_NS {
struct ACEALImpl {
ACEALImpl() : basis_set(nullptr), ace(nullptr) {}
~ACEALImpl()
{
~ACEALImpl() {
delete basis_set;
delete ace;
}
@ -321,8 +320,6 @@ void PairPACEExtrapolationKokkos<DeviceType>::copy_tilde()
t_ace_3d d_ASI_temp;
MemKK::realloc_kokkos(d_ASI_temp, "pace:ASI_temp", nelements, total_num_functions_max, total_num_functions_max);
auto h_rank = Kokkos::create_mirror_view(d_rank);
auto h_num_ms_combs = Kokkos::create_mirror_view(d_num_ms_combs);
auto h_func_inds = Kokkos::create_mirror_view(d_func_inds);
@ -404,7 +401,6 @@ void PairPACEExtrapolationKokkos<DeviceType>::copy_tilde()
for (int j = 0; j < total_basis_size_rank1 + total_basis_size; j++){
h_ASI(mu,i,j) = A_as_inv(j,i); // transpose back for better performance on GPU
}
}
Kokkos::deep_copy(d_rank, h_rank);
@ -565,6 +561,7 @@ void PairPACEExtrapolationKokkos<DeviceType>::compute(int eflag_in, int vflag_in
ev_init(eflag,vflag,0);
// reallocate per-atom arrays if necessary
if (eflag_atom) {
memoryKK->destroy_kokkos(k_eatom,eatom);
memoryKK->create_kokkos(k_eatom,eatom,maxeatom,"pair:eatom");
@ -1047,7 +1044,6 @@ void PairPACEExtrapolationKokkos<DeviceType>::operator() (TagPairPACEComputeRho,
/* ---------------------------------------------------------------------- */
template<class DeviceType>
KOKKOS_INLINE_FUNCTION
void PairPACEExtrapolationKokkos<DeviceType>::operator() (TagPairPACEComputeFS, const int& ii) const
@ -1079,10 +1075,8 @@ void PairPACEExtrapolationKokkos<DeviceType>::operator() (TagPairPACEComputeFS,
}
}
/* ---------------------------------------------------------------------- */
template<class DeviceType>
KOKKOS_INLINE_FUNCTION
void PairPACEExtrapolationKokkos<DeviceType>::operator() (TagPairPACEComputeGamma, const int& ii) const
@ -1091,10 +1085,9 @@ void PairPACEExtrapolationKokkos<DeviceType>::operator() (TagPairPACEComputeGamm
const int mu_i = d_map(type(i));
const int basis_size = d_total_basis_size(mu_i);
double gamma_max = 0;
double current_gamma;
for (int j = 0; j <basis_size; j++) { //
for (int j = 0; j <basis_size; j++) {
current_gamma = 0;
// compute row-matrix-multiplication asi_vector * A_as_inv (transposed matrix)
@ -1108,8 +1101,8 @@ void PairPACEExtrapolationKokkos<DeviceType>::operator() (TagPairPACEComputeGamm
// tally energy contribution
d_gamma(ii) = gamma_max;
}
/* ---------------------------------------------------------------------- */
template<class DeviceType>
@ -1824,19 +1817,10 @@ double PairPACEExtrapolationKokkos<DeviceType>::memory_usage()
return bytes;
}
/* ---------------------------------------------------------------------- */
namespace LAMMPS_NS {
template class PairPACEExtrapolationKokkos<LMPDeviceType>;
#ifdef LMP_KOKKOS_GPU
template class PairPACEExtrapolationKokkos<LMPHostType>;
#endif
}
/* ---------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
extract method for extracting value of scale variable
---------------------------------------------------------------------- */
template<class DeviceType>
void *PairPACEExtrapolationKokkos<DeviceType>::extract(const char *str, int &dim)
{
@ -1857,6 +1841,7 @@ void *PairPACEExtrapolationKokkos<DeviceType>::extract(const char *str, int &dim
1 or more = # of columns in per-atom array
return NULL if str is not recognized
---------------------------------------------------------------------- */
template<class DeviceType>
void *PairPACEExtrapolationKokkos<DeviceType>::extract_peratom(const char *str, int &ncol)
{
@ -1867,3 +1852,13 @@ void *PairPACEExtrapolationKokkos<DeviceType>::extract_peratom(const char *str,
return nullptr;
}
/* ---------------------------------------------------------------------- */
namespace LAMMPS_NS {
template class PairPACEExtrapolationKokkos<LMPDeviceType>;
#ifdef LMP_KOKKOS_GPU
template class PairPACEExtrapolationKokkos<LMPHostType>;
#endif
}

View File

@ -135,16 +135,12 @@ void PairPACEExtrapolation::compute(int eflag, int vflag)
double **x = atom->x;
double **f = atom->f;
// tagint *tag = atom->tag;
int *type = atom->type;
// number of atoms in cell
int nlocal = atom->nlocal;
int newton_pair = force->newton_pair;
// number of atoms including ghost atoms
// int nall = nlocal + atom->nghost;
// inum: length of the neighborlists list
inum = list->inum;