Unverified Commit 08a5a05e authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

reduce compiler warnings in KOKKOS version of USER-DPD code

parent 1939a9e6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -98,7 +98,7 @@ FixEOStableRXKokkos<DeviceType>::~FixEOStableRXKokkos()
/* ---------------------------------------------------------------------- */

template<class DeviceType>
void FixEOStableRXKokkos<DeviceType>::setup(int vflag)
void FixEOStableRXKokkos<DeviceType>::setup(int /*vflag*/)
{
  if (update_table)
    create_kokkos_tables();
@@ -411,7 +411,7 @@ void FixEOStableRXKokkos<DeviceType>::temperature_lookup(int id, double ui, doub
/* ---------------------------------------------------------------------- */

template<class DeviceType>
int FixEOStableRXKokkos<DeviceType>::pack_forward_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
int FixEOStableRXKokkos<DeviceType>::pack_forward_comm(int n, int *list, double *buf, int /*pbc_flag*/, int * /*pbc*/)
{
  int ii,jj,m;
  HAT::t_efloat_1d h_uChem = atomKK->k_uChem.h_view;
+39 −38
Original line number Diff line number Diff line
@@ -387,8 +387,7 @@ void FixRxKokkos<DeviceType>::k_rkf45_step (const int neq, const double h, Vecto
template <typename DeviceType>
  template <typename VectorType, typename UserDataType>
KOKKOS_INLINE_FUNCTION
int FixRxKokkos<DeviceType>::k_rkf45_h0
                    (const int neq, const double t, const double t_stop,
int FixRxKokkos<DeviceType>::k_rkf45_h0 (const int neq, const double t, const double /*t_stop*/,
                                         const double hmin, const double hmax,
                                         double& h0, VectorType& y, VectorType& rwk, UserDataType& userData) const
{
@@ -707,8 +706,7 @@ void FixRxKokkos<DeviceType>::rkf45_step (const int neq, const double h, double
}

template <typename DeviceType>
int FixRxKokkos<DeviceType>::rkf45_h0
                    (const int neq, const double t, const double t_stop,
int FixRxKokkos<DeviceType>::rkf45_h0(const int neq, const double t, const double /*t_stop*/,
                                      const double hmin, const double hmax,
                                      double& h0, double y[], double rwk[], void* v_params) const
{
@@ -920,7 +918,7 @@ int FixRxKokkos<DeviceType>::rhs(double t, const double *y, double *dydt, void *
/* ---------------------------------------------------------------------- */

template <typename DeviceType>
int FixRxKokkos<DeviceType>::rhs_dense(double t, const double *y, double *dydt, void *params) const
int FixRxKokkos<DeviceType>::rhs_dense(double /*t*/, const double *y, double *dydt, void *params) const
{
  UserRHSData *userData = (UserRHSData *) params;

@@ -959,7 +957,7 @@ int FixRxKokkos<DeviceType>::rhs_dense(double t, const double *y, double *dydt,
/* ---------------------------------------------------------------------- */

template <typename DeviceType>
int FixRxKokkos<DeviceType>::rhs_sparse(double t, const double *y, double *dydt, void *v_params) const
int FixRxKokkos<DeviceType>::rhs_sparse(double /*t*/, const double *y, double *dydt, void *v_params) const
{
   UserRHSData *userData = (UserRHSData *) v_params;

@@ -1068,7 +1066,7 @@ int FixRxKokkos<DeviceType>::k_rhs(double t, const VectorType& y, VectorType& dy
template <typename DeviceType>
  template <typename VectorType, typename UserDataType>
KOKKOS_INLINE_FUNCTION
int FixRxKokkos<DeviceType>::k_rhs_dense(double t, const VectorType& y, VectorType& dydt, UserDataType& userData) const
int FixRxKokkos<DeviceType>::k_rhs_dense(double /*t*/, const VectorType& y, VectorType& dydt, UserDataType& userData) const
{
  #define rxnRateLaw (userData.rxnRateLaw)
  #define kFor       (userData.kFor      )
@@ -1110,7 +1108,7 @@ int FixRxKokkos<DeviceType>::k_rhs_dense(double t, const VectorType& y, VectorTy
template <typename DeviceType>
  template <typename VectorType, typename UserDataType>
KOKKOS_INLINE_FUNCTION
int FixRxKokkos<DeviceType>::k_rhs_sparse(double t, const VectorType& y, VectorType& dydt, UserDataType& userData) const
int FixRxKokkos<DeviceType>::k_rhs_sparse(double /*t*/, const VectorType& y, VectorType& dydt, UserDataType& userData) const
{
   #define kFor         (userData.kFor)
   #define kRev         (NULL)
@@ -1430,7 +1428,7 @@ void FixRxKokkos<DeviceType>::operator()(Tag_FixRxKokkos_solveSystems<ZERO_RATES
/* ---------------------------------------------------------------------- */

template <typename DeviceType>
void FixRxKokkos<DeviceType>::solve_reactions(const int vflag, const bool isPreForce)
void FixRxKokkos<DeviceType>::solve_reactions(const int /*vflag*/, const bool isPreForce)
{
  //printf("Inside FixRxKokkos<DeviceType>::solve_reactions localTempFlag= %d isPreForce= %s\n", localTempFlag, isPreForce ? "True" : "false");

@@ -1439,7 +1437,7 @@ void FixRxKokkos<DeviceType>::solve_reactions(const int vflag, const bool isPreF
  if (update_kinetics_data)
    create_kinetics_data();

  TimerType timer_start = getTimeStamp();
  //TimerType timer_start = getTimeStamp();

  //const int nlocal = atom->nlocal;
  this->nlocal = atom->nlocal;
@@ -1463,28 +1461,31 @@ void FixRxKokkos<DeviceType>::solve_reactions(const int vflag, const bool isPreF
    const int neighflag = lmp->kokkos->neighflag;

#define _template_switch(_wtflag, _localTempFlag) {                               \
       if (neighflag == HALF) \
          if (newton_pair) \
      if (neighflag == HALF) {                                                    \
        if (newton_pair) {                                                        \
          computeLocalTemperature<_wtflag, _localTempFlag, true , HALF> ();       \
          else \
        } else {                                                                  \
          computeLocalTemperature<_wtflag, _localTempFlag, false, HALF> ();       \
       else if (neighflag == HALFTHREAD) \
          if (newton_pair) \
        }                                                                         \
      } else if (neighflag == HALFTHREAD) {                                       \
        if (newton_pair) {                                                        \
          computeLocalTemperature<_wtflag, _localTempFlag, true , HALFTHREAD> (); \
          else \
        } else {                                                                  \
          computeLocalTemperature<_wtflag, _localTempFlag, false, HALFTHREAD> (); \
       else if (neighflag == FULL) \
          if (newton_pair) \
        }                                                                         \
      } else if (neighflag == FULL) {                                             \
        if (newton_pair)  {                                                       \
          computeLocalTemperature<_wtflag, _localTempFlag, true , FULL> ();       \
          else \
        } else {                                                                  \
          computeLocalTemperature<_wtflag, _localTempFlag, false, FULL> ();       \
        }                                                                         \
      }                                                                           \
    }

    // Are there is no other options than wtFlag = (0)LUCY and localTempFlag = NONE : HARMONIC?
    if (localTempFlag == HARMONIC) {
      _template_switch(LUCY, HARMONIC)
    }
    else {
    } else {
      _template_switch(LUCY, NONE)
    }
#undef _template_switch
@@ -1674,7 +1675,7 @@ void FixRxKokkos<DeviceType>::solve_reactions(const int vflag, const bool isPreF

  atomKK->modified ( Host, DVECTOR_MASK );

  TimerType timer_stop = getTimeStamp();
  //TimerType timer_stop = getTimeStamp();

  double time_ODE = getElapsedTime(timer_localTemperature, timer_ODE);

@@ -2032,7 +2033,7 @@ void FixRxKokkos<DeviceType>::computeLocalTemperature()
    const int ntypes = atom->ntypes;

    //memoryKK->create_kokkos (k_cutsq, h_cutsq, ntypes+1, ntypes+1, "pair:cutsq");
    if (ntypes+1 > k_cutsq.extent(0)) {
    if (ntypes+1 > (int) k_cutsq.extent(0)) {
      memoryKK->destroy_kokkos (k_cutsq);
      memoryKK->create_kokkos (k_cutsq, ntypes+1, ntypes+1, "FixRxKokkos::k_cutsq");
      d_cutsq = k_cutsq.template view<DeviceType>();
@@ -2053,7 +2054,7 @@ void FixRxKokkos<DeviceType>::computeLocalTemperature()
  int sumWeightsCt = nlocal + (NEWTON_PAIR ? nghost : 0);

  //memoryKK->create_kokkos (k_sumWeights, sumWeights, sumWeightsCt, "FixRxKokkos::sumWeights");
  if (sumWeightsCt > k_sumWeights.template view<DeviceType>().extent(0)) {
  if (sumWeightsCt > (int)k_sumWeights.template view<DeviceType>().extent(0)) {
    memoryKK->destroy_kokkos(k_sumWeights, sumWeights);
    memoryKK->create_kokkos (k_sumWeights, sumWeightsCt, "FixRxKokkos::sumWeights");
    d_sumWeights = k_sumWeights.template view<DeviceType>();
@@ -2196,7 +2197,7 @@ void FixRxKokkos<DeviceType>::computeLocalTemperature()
/* ---------------------------------------------------------------------- */

template <typename DeviceType>
int FixRxKokkos<DeviceType>::pack_forward_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
int FixRxKokkos<DeviceType>::pack_forward_comm(int n, int *list, double *buf, int /*pbc_flag*/, int * /*pbc*/)
{
  //printf("inside FixRxKokkos::pack_forward_comm %d\n", comm->me);

+2 −2
Original line number Diff line number Diff line
@@ -562,7 +562,7 @@ void FixShardlowKokkos<DeviceType>::ssa_update_dpde(


template<class DeviceType>
void FixShardlowKokkos<DeviceType>::initial_integrate(int vflag)
void FixShardlowKokkos<DeviceType>::initial_integrate(int /*vflag*/)
{
  d_numneigh = k_list->d_numneigh;
  d_neighbors = k_list->d_neighbors;
@@ -716,7 +716,7 @@ void FixShardlowKokkos<DeviceType>::operator()(TagFixShardlowSSAUpdateDPDEGhost<
/* ---------------------------------------------------------------------- */

template<class DeviceType>
int FixShardlowKokkos<DeviceType>::pack_forward_comm(int n, int *list, double *buf, int pbc_flag, int *pbc)
int FixShardlowKokkos<DeviceType>::pack_forward_comm(int n, int *list, double *buf, int /*pbc_flag*/, int * /*pbc*/)
{
  int ii,jj,m;

+1 −1
Original line number Diff line number Diff line
@@ -67,7 +67,7 @@ NBinSSAKokkos<DeviceType>::NBinSSAKokkos(LAMMPS *lmp) : NBinStandard(lmp)
/* ---------------------------------------------------------------------- */

template<class DeviceType>
void NBinSSAKokkos<DeviceType>::bin_atoms_setup(int nall)
void NBinSSAKokkos<DeviceType>::bin_atoms_setup(int /*nall*/)
{
  if (mbins > (int) k_bins.h_view.extent(0)) {
    k_bins = DAT::tdual_int_2d("NBinSSAKokkos::bins",mbins,atoms_per_bin);
+15 −16
Original line number Diff line number Diff line
@@ -140,7 +140,7 @@ void PairExp6rxKokkos<DeviceType>::init_style()
template<class DeviceType>
void PairExp6rxKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
{
  TimerType t_start = getTimeStamp();
  //TimerType t_start = getTimeStamp();

  copymode = 1;

@@ -185,7 +185,7 @@ void PairExp6rxKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
  // and ghost atoms. Make the parameter data persistent
  // and exchange like any other atom property later.

  TimerType t_mix_start = getTimeStamp();
  //TimerType t_mix_start = getTimeStamp();
  {
     const int np_total = nlocal + atom->nghost;

@@ -258,7 +258,7 @@ void PairExp6rxKokkos<DeviceType>::compute(int eflag_in, int vflag_in)
       error->all(FLERR,"Computed fraction less than -10*DBL_EPSILON");
#endif
  }
  TimerType t_mix_stop = getTimeStamp();
  //TimerType t_mix_stop = getTimeStamp();

  k_error_flag.template modify<DeviceType>();
  k_error_flag.template sync<LMPHostType>();
@@ -1568,27 +1568,26 @@ void PairExp6rxKokkos<DeviceType>::vectorized_operator(const int &ii, EV_FLOAT&
    {
      const int j = neigh_j[jlane] & NEIGHMASK;

      if ((NEIGHFLAG==HALF || NEIGHFLAG==HALFTHREAD) && (NEWTON_PAIR || j < nlocal))
        if (UseAtomics)
      if ((NEIGHFLAG==HALF || NEIGHFLAG==HALFTHREAD) && (NEWTON_PAIR || j < nlocal)) {
        if (UseAtomics) {
          a_uCG(j) += 0.5*evdwlOld_j[jlane];
        else
        } else {
          t_uCG(tid,j) += 0.5*evdwlOld_j[jlane];

      if ((NEIGHFLAG==HALF || NEIGHFLAG==HALFTHREAD) && (NEWTON_PAIR || j < nlocal))
        if (UseAtomics)
        }
      }
      if ((NEIGHFLAG==HALF || NEIGHFLAG==HALFTHREAD) && (NEWTON_PAIR || j < nlocal)) {
        if (UseAtomics) {
          a_uCGnew(j) += uCGnew_j[jlane];
        else
        } else {
          t_uCGnew(tid,j) += uCGnew_j[jlane];

        }
      }
      if ((NEIGHFLAG==HALF || NEIGHFLAG==HALFTHREAD) && (NEWTON_PAIR || j < nlocal)) {
        if (UseAtomics)
        {
        if (UseAtomics) {
          a_f(j,0) -= delx_j[jlane]*fpair_j[jlane];
          a_f(j,1) -= dely_j[jlane]*fpair_j[jlane];
          a_f(j,2) -= delz_j[jlane]*fpair_j[jlane];
        }
        else
        {
        } else {
          t_f(tid,j,0) -= delx_j[jlane]*fpair_j[jlane];
          t_f(tid,j,1) -= dely_j[jlane]*fpair_j[jlane];
          t_f(tid,j,2) -= delz_j[jlane]*fpair_j[jlane];
Loading