From 204fc79211e38113db41a04c2c1f151d41e35613 Mon Sep 17 00:00:00 2001 From: Stan Moore Date: Mon, 29 Jul 2024 09:27:09 -0600 Subject: [PATCH 1/6] Remove unused var --- src/ML-UF3/pair_uf3.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ML-UF3/pair_uf3.cpp b/src/ML-UF3/pair_uf3.cpp index a952403287..1f91f25f5b 100644 --- a/src/ML-UF3/pair_uf3.cpp +++ b/src/ML-UF3/pair_uf3.cpp @@ -120,7 +120,6 @@ void PairUF3::settings(int narg, char **arg) "Invalid number of arguments for pair_style uf3" " Are you using a 2-body or 2 & 3-body UF potential?"); nbody_flag = utils::numeric(FLERR, arg[0], true, lmp); - const int num_of_elements = atom->ntypes; if (nbody_flag == 2) { pot_3b = false; manybody_flag = 0; From 2ff43fc8bdcea65c0bf4edb5ee8937e1c292c386 Mon Sep 17 00:00:00 2001 From: Stan Moore Date: Mon, 29 Jul 2024 09:27:28 -0600 Subject: [PATCH 2/6] Fix compile issue --- src/KOKKOS/pair_uf3_kokkos.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/KOKKOS/pair_uf3_kokkos.h b/src/KOKKOS/pair_uf3_kokkos.h index 15c2832da1..ccdf543d5f 100644 --- a/src/KOKKOS/pair_uf3_kokkos.h +++ b/src/KOKKOS/pair_uf3_kokkos.h @@ -22,6 +22,7 @@ // clang-format off PairStyle(uf3/kk,PairUF3Kokkos) PairStyle(uf3/kk/device,PairUF3Kokkos) +PairStyle(uf3/kk/host,PairUF3Kokkos) // clang-format on #else @@ -117,9 +118,11 @@ template class PairUF3Kokkos : public PairUF3 { std::vector get_dncoefficients(const double *knots, const double coefficient) const; template + KOKKOS_INLINE_FUNCTION void twobody(const int itype, const int jtype, const F_FLOAT r, F_FLOAT &evdwl, F_FLOAT &fpair) const; template + KOKKOS_INLINE_FUNCTION void threebody(const int itype, const int jtype, const int ktype, const F_FLOAT value_rij, const F_FLOAT value_rik, const F_FLOAT value_rjk, F_FLOAT &evdwl3, F_FLOAT (&fforce)[3]) const; From a4ad184d37ff4f745827940f99ed9461de0b78c1 Mon Sep 17 00:00:00 2001 From: Stan Moore Date: Mon, 29 Jul 2024 09:29:11 -0600 Subject: [PATCH 3/6] Fix Makefile build for UF3 with KOKKOS --- src/Depend.sh | 4 ++++ src/KOKKOS/Install.sh | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/Depend.sh b/src/Depend.sh index e55b100975..85542b21c0 100755 --- a/src/Depend.sh +++ b/src/Depend.sh @@ -195,6 +195,10 @@ if (test $1 = "ML-SNAP") then depend INTEL fi +if (test $1 = "ML-UF3") then + depend KOKKOS +fi + if (test $1 = "CG-SPICA") then depend GPU depend KOKKOS diff --git a/src/KOKKOS/Install.sh b/src/KOKKOS/Install.sh index 94effc5d68..31359d4e4a 100755 --- a/src/KOKKOS/Install.sh +++ b/src/KOKKOS/Install.sh @@ -391,6 +391,8 @@ action pair_tersoff_mod_kokkos.cpp pair_tersoff_mod.cpp action pair_tersoff_mod_kokkos.h pair_tersoff_mod.h action pair_tersoff_zbl_kokkos.cpp pair_tersoff_zbl.cpp action pair_tersoff_zbl_kokkos.h pair_tersoff_zbl.h +action pair_uf3_kokkos.cpp pair_uf3.cpp +action pair_uf3_kokkos.h pair_uf3.h action pair_vashishta_kokkos.cpp pair_vashishta.cpp action pair_vashishta_kokkos.h pair_vashishta.h action pair_yukawa_kokkos.cpp From d81bf66fe1f33cde34437677beaebd4333d02244 Mon Sep 17 00:00:00 2001 From: Stan Moore Date: Mon, 29 Jul 2024 09:29:40 -0600 Subject: [PATCH 4/6] Fix issues with new KOKKOS hybrid topo styles --- src/KOKKOS/dihedral_hybrid_kokkos.h | 12 ++++++------ src/KOKKOS/improper_hybrid_kokkos.h | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/KOKKOS/dihedral_hybrid_kokkos.h b/src/KOKKOS/dihedral_hybrid_kokkos.h index 29a3d29689..6deb190f8f 100644 --- a/src/KOKKOS/dihedral_hybrid_kokkos.h +++ b/src/KOKKOS/dihedral_hybrid_kokkos.h @@ -11,7 +11,7 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#ifdef BOND_CLASS +#ifdef DIHEDRAL_CLASS // clang-format off DihedralStyle(hybrid/kk,DihedralHybridKokkos); DihedralStyle(hybrid/kk/device,DihedralHybridKokkos); @@ -20,8 +20,8 @@ DihedralStyle(hybrid/kk/host,DihedralHybridKokkos); #else // clang-format off -#ifndef LMP_BOND_HYBRID_KOKKOS_H -#define LMP_BOND_HYBRID_KOKKOS_H +#ifndef LMP_DIHEDRAL_HYBRID_KOKKOS_H +#define LMP_DIHEDRAL_HYBRID_KOKKOS_H #include "dihedral_hybrid.h" #include "kokkos_type.h" @@ -40,13 +40,13 @@ class DihedralHybridKokkos : public DihedralHybrid { double memory_usage() override; private: - int maxbond_all; + int maxdihedral_all; class NeighborKokkos *neighborKK; DAT::tdual_int_1d k_map; // which style each bond type points to - DAT::tdual_int_1d k_nbondlist; // # of bonds in sub-style bondlists - DAT::tdual_int_3d k_bondlist; // bondlist for each sub-style + DAT::tdual_int_1d k_ndihedrallist; // # of bonds in sub-style bondlists + DAT::tdual_int_3d k_dihedrallist; // bondlist for each sub-style void allocate() override; void deallocate() override; diff --git a/src/KOKKOS/improper_hybrid_kokkos.h b/src/KOKKOS/improper_hybrid_kokkos.h index f2a80f6a0c..78bafe5df6 100644 --- a/src/KOKKOS/improper_hybrid_kokkos.h +++ b/src/KOKKOS/improper_hybrid_kokkos.h @@ -11,7 +11,7 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#ifdef BOND_CLASS +#ifdef IMPROPER_CLASS // clang-format off ImproperStyle(hybrid/kk,ImproperHybridKokkos); ImproperStyle(hybrid/kk/device,ImproperHybridKokkos); @@ -20,8 +20,8 @@ ImproperStyle(hybrid/kk/host,ImproperHybridKokkos); #else // clang-format off -#ifndef LMP_BOND_HYBRID_KOKKOS_H -#define LMP_BOND_HYBRID_KOKKOS_H +#ifndef LMP_IMPROPER_HYBRID_KOKKOS_H +#define LMP_IMPROPER_HYBRID_KOKKOS_H #include "improper_hybrid.h" #include "kokkos_type.h" From b773c122842065a9909991a099b53273245770cf Mon Sep 17 00:00:00 2001 From: Stan Moore Date: Mon, 29 Jul 2024 11:46:11 -0400 Subject: [PATCH 5/6] Tweak comment --- src/KOKKOS/dihedral_hybrid_kokkos.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/KOKKOS/dihedral_hybrid_kokkos.h b/src/KOKKOS/dihedral_hybrid_kokkos.h index 6deb190f8f..63a59505af 100644 --- a/src/KOKKOS/dihedral_hybrid_kokkos.h +++ b/src/KOKKOS/dihedral_hybrid_kokkos.h @@ -44,9 +44,9 @@ class DihedralHybridKokkos : public DihedralHybrid { class NeighborKokkos *neighborKK; - DAT::tdual_int_1d k_map; // which style each bond type points to - DAT::tdual_int_1d k_ndihedrallist; // # of bonds in sub-style bondlists - DAT::tdual_int_3d k_dihedrallist; // bondlist for each sub-style + DAT::tdual_int_1d k_map; // which style each dihedral type points to + DAT::tdual_int_1d k_ndihedrallist; // # of dihedrals in sub-style dihedrallists + DAT::tdual_int_3d k_dihedrallist; // dihedrallist for each sub-style void allocate() override; void deallocate() override; From abb19890f93c69190ef18b56e2c34f0c344b95e5 Mon Sep 17 00:00:00 2001 From: Stan Moore Date: Mon, 29 Jul 2024 11:46:22 -0400 Subject: [PATCH 6/6] Fix another compiler warning --- src/KOKKOS/pair_uf3_kokkos.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/KOKKOS/pair_uf3_kokkos.h b/src/KOKKOS/pair_uf3_kokkos.h index ccdf543d5f..952e2aba25 100644 --- a/src/KOKKOS/pair_uf3_kokkos.h +++ b/src/KOKKOS/pair_uf3_kokkos.h @@ -45,7 +45,7 @@ template class PairUF3Kokkos : public PairUF3 { void compute(int, int) override; void settings(int, char **) override; void coeff(int, char **) override; - void allocate(); + void allocate() override; void init_style() override; void init_list(int, class NeighList *) override; // needed for ptr to full neigh list double init_one(int, int) override; // needed for cutoff radius for neighbour list