Unverified Commit 37442ca5 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

fix bug in USER-OMP with "pair_modify compute no" and "kspace_modify compute no"

parent e36d2ce3
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -63,7 +63,8 @@ static int get_tid()
FixOMP::FixOMP(LAMMPS *lmp, int narg, char **arg)
  :  Fix(lmp, narg, arg),
     thr(NULL), last_omp_style(NULL), last_pair_hybrid(NULL),
     _nthr(-1), _neighbor(true), _mixed(false), _reduced(true)
     _nthr(-1), _neighbor(true), _mixed(false), _reduced(true),
     _pair_compute_flag(false), _kspace_compute_flag(false)
{
  if (narg < 4) error->all(FLERR,"Illegal package omp command");

@@ -207,6 +208,11 @@ void FixOMP::init()
      && (strstr(update->integrate_style,"respa/omp") == NULL))
    error->all(FLERR,"Need to use respa/omp for r-RESPA with /omp styles");

  if (force->pair && force->pair->compute_flag) _pair_compute_flag = true;
  else _pair_compute_flag = false;
  if (force->kspace && force->kspace->compute_flag) _kspace_compute_flag = true;
  else _kspace_compute_flag = false;

  int check_hybrid, kspace_split;
  last_pair_hybrid = NULL;
  last_omp_style = NULL;
@@ -254,7 +260,7 @@ void FixOMP::init()
    }                                                         \
  }

  if (kspace_split <= 0) {
  if (_pair_compute_flag && (kspace_split <= 0)) {
    CheckStyleForOMP(pair);
    CheckHybridForOMP(pair,Pair);
    if (check_hybrid) {
@@ -275,7 +281,7 @@ void FixOMP::init()
    CheckHybridForOMP(improper,Improper);
  }

  if (kspace_split >= 0) {
  if (_kspace_compute_flag && (kspace_split >= 0)) {
    CheckStyleForOMP(kspace);
  }

+2 −0
Original line number Diff line number Diff line
@@ -70,6 +70,8 @@ class FixOMP : public Fix {
  bool _neighbor;   // en/disable threads for neighbor list construction
  bool _mixed;      // whether to prefer mixed precision compute kernels
  bool _reduced;    // whether forces have been reduced for this step
  bool _pair_compute_flag;    // whether pair_compute is called
  bool _kspace_compute_flag;  // whether kspace_compute is called

  void set_neighbor_omp();
};