automatically enable intel neighbor list request property for intel pair styles
This commit is contained in:
@ -26,7 +26,6 @@
|
||||
#include "memory.h"
|
||||
#include "modify.h"
|
||||
#include "neigh_list.h"
|
||||
#include "neigh_request.h"
|
||||
#include "neighbor.h"
|
||||
#include "suffix.h"
|
||||
|
||||
@ -181,7 +180,6 @@ PairAIREBOIntel::~PairAIREBOIntel()
|
||||
void PairAIREBOIntel::init_style()
|
||||
{
|
||||
PairAIREBO::init_style();
|
||||
neighbor->find_request(this)->intel = 1;
|
||||
|
||||
if (utils::strmatch(force->pair_style,"^hybrid"))
|
||||
error->all(FLERR, "Cannot yet use airebo/intel with hybrid.");
|
||||
|
||||
@ -409,12 +409,8 @@ void PairBuckCoulCutIntel::eval(const int offload, const int vflag,
|
||||
void PairBuckCoulCutIntel::init_style()
|
||||
{
|
||||
PairBuckCoulCut::init_style();
|
||||
auto request = neighbor->find_request(this);
|
||||
if (force->newton_pair == 0) {
|
||||
request->half = 0;
|
||||
request->full = 1;
|
||||
}
|
||||
request->intel = 1;
|
||||
if (force->newton_pair == 0)
|
||||
neighbor->find_request(this)->enable_full();
|
||||
|
||||
fix = static_cast<FixIntel *>(modify->get_fix_by_id("package_intel"));
|
||||
if (!fix) error->all(FLERR, "The 'package intel' command is required for /intel styles");
|
||||
|
||||
@ -485,13 +485,8 @@ void PairBuckCoulLongIntel::eval(const int offload, const int vflag,
|
||||
void PairBuckCoulLongIntel::init_style()
|
||||
{
|
||||
PairBuckCoulLong::init_style();
|
||||
auto request = neighbor->find_request(this);
|
||||
|
||||
if (force->newton_pair == 0) {
|
||||
request->half = 0;
|
||||
request->full = 1;
|
||||
}
|
||||
request->intel = 1;
|
||||
if (force->newton_pair == 0)
|
||||
neighbor->find_request(this)->enable_full();
|
||||
|
||||
fix = static_cast<FixIntel *>(modify->get_fix_by_id("package_intel"));
|
||||
if (!fix) error->all(FLERR, "The 'package intel' command is required for /intel styles");
|
||||
|
||||
@ -376,12 +376,8 @@ void PairBuckIntel::init_style()
|
||||
PairBuck::init_style();
|
||||
|
||||
// augment neighbor list request
|
||||
auto request = neighbor->find_request(this);
|
||||
if (force->newton_pair == 0) {
|
||||
request->half = 0;
|
||||
request->full = 1;
|
||||
}
|
||||
request->intel = 1;
|
||||
if (force->newton_pair == 0)
|
||||
neighbor->find_request(this)->enable_full();
|
||||
|
||||
fix = static_cast<FixIntel *>(modify->get_fix_by_id("package_intel"));
|
||||
if (!fix) error->all(FLERR, "The 'package intel' command is required for /intel styles");
|
||||
|
||||
@ -484,13 +484,8 @@ void PairDPDIntel::settings(int narg, char **arg) {
|
||||
void PairDPDIntel::init_style()
|
||||
{
|
||||
PairDPD::init_style();
|
||||
auto request = neighbor->find_request(this);
|
||||
|
||||
if (force->newton_pair == 0) {
|
||||
request->half = 0;
|
||||
request->full = 1;
|
||||
}
|
||||
request->intel = 1;
|
||||
if (force->newton_pair == 0)
|
||||
neighbor->find_request(this)->enable_full();
|
||||
|
||||
fix = static_cast<FixIntel *>(modify->get_fix_by_id("package_intel"));
|
||||
if (!fix) error->all(FLERR, "The 'package intel' command is required for /intel styles");
|
||||
|
||||
@ -666,13 +666,8 @@ void PairEAMIntel::eval(const int offload, const int vflag,
|
||||
void PairEAMIntel::init_style()
|
||||
{
|
||||
PairEAM::init_style();
|
||||
auto request = neighbor->find_request(this);
|
||||
|
||||
if (force->newton_pair == 0) {
|
||||
request->half = 0;
|
||||
request->full = 1;
|
||||
}
|
||||
request->intel = 1;
|
||||
if (force->newton_pair == 0)
|
||||
neighbor->find_request(this)->enable_full();
|
||||
|
||||
fix = static_cast<FixIntel *>(modify->get_fix_by_id("package_intel"));
|
||||
if (!fix) error->all(FLERR, "The 'package intel' command is required for /intel styles");
|
||||
|
||||
@ -889,13 +889,8 @@ void PairGayBerneIntel::eval(const int offload, const int vflag,
|
||||
void PairGayBerneIntel::init_style()
|
||||
{
|
||||
PairGayBerne::init_style();
|
||||
auto request = neighbor->find_request(this);
|
||||
|
||||
if (force->newton_pair == 0) {
|
||||
request->half = 0;
|
||||
request->full = 1;
|
||||
}
|
||||
request->intel = 1;
|
||||
if (force->newton_pair == 0)
|
||||
neighbor->find_request(this)->enable_full();
|
||||
|
||||
fix = static_cast<FixIntel *>(modify->get_fix_by_id("package_intel"));
|
||||
if (!fix) error->all(FLERR, "The 'package intel' command is required for /intel styles");
|
||||
|
||||
@ -456,13 +456,8 @@ void PairLJCharmmCoulCharmmIntel::eval(const int offload, const int vflag,
|
||||
void PairLJCharmmCoulCharmmIntel::init_style()
|
||||
{
|
||||
PairLJCharmmCoulCharmm::init_style();
|
||||
auto request = neighbor->find_request(this);
|
||||
|
||||
if (force->newton_pair == 0) {
|
||||
request->half = 0;
|
||||
request->full = 1;
|
||||
}
|
||||
request->intel = 1;
|
||||
if (force->newton_pair == 0)
|
||||
neighbor->find_request(this)->enable_full();
|
||||
|
||||
fix = static_cast<FixIntel *>(modify->get_fix_by_id("package_intel"));
|
||||
if (!fix) error->all(FLERR, "The 'package intel' command is required for /intel styles");
|
||||
|
||||
@ -521,13 +521,8 @@ void PairLJCharmmCoulLongIntel::eval(const int offload, const int vflag,
|
||||
void PairLJCharmmCoulLongIntel::init_style()
|
||||
{
|
||||
PairLJCharmmCoulLong::init_style();
|
||||
auto request = neighbor->find_request(this);
|
||||
|
||||
if (force->newton_pair == 0) {
|
||||
request->half = 0;
|
||||
request->full = 1;
|
||||
}
|
||||
request->intel = 1;
|
||||
if (force->newton_pair == 0)
|
||||
neighbor->find_request(this)->enable_full();
|
||||
|
||||
fix = static_cast<FixIntel *>(modify->get_fix_by_id("package_intel"));
|
||||
if (!fix) error->all(FLERR, "The 'package intel' command is required for /intel styles");
|
||||
|
||||
@ -486,13 +486,8 @@ void PairLJCutCoulLongIntel::eval(const int offload, const int vflag,
|
||||
void PairLJCutCoulLongIntel::init_style()
|
||||
{
|
||||
PairLJCutCoulLong::init_style();
|
||||
auto request = neighbor->find_request(this);
|
||||
|
||||
if (force->newton_pair == 0) {
|
||||
request->half = 0;
|
||||
request->full = 1;
|
||||
}
|
||||
request->intel = 1;
|
||||
if (force->newton_pair == 0)
|
||||
neighbor->find_request(this)->enable_full();
|
||||
|
||||
fix = static_cast<FixIntel *>(modify->get_fix_by_id("package_intel"));
|
||||
if (!fix) error->all(FLERR, "The 'package intel' command is required for /intel styles");
|
||||
|
||||
@ -392,13 +392,8 @@ void PairLJCutIntel::eval(const int offload, const int vflag,
|
||||
void PairLJCutIntel::init_style()
|
||||
{
|
||||
PairLJCut::init_style();
|
||||
auto request = neighbor->find_request(this);
|
||||
|
||||
if (force->newton_pair == 0) {
|
||||
request->half = 0;
|
||||
request->full = 1;
|
||||
}
|
||||
request->intel = 1;
|
||||
if (force->newton_pair == 0)
|
||||
neighbor->find_request(this)->enable_full();
|
||||
|
||||
fix = static_cast<FixIntel *>(modify->get_fix_by_id("package_intel"));
|
||||
if (!fix) error->all(FLERR, "The 'package intel' command is required for /intel styles");
|
||||
|
||||
@ -46,7 +46,6 @@ PairLJLongCoulLongIntel::~PairLJLongCoulLongIntel()
|
||||
void PairLJLongCoulLongIntel::init_style()
|
||||
{
|
||||
PairLJLongCoulLong::init_style();
|
||||
neighbor->find_request(this)->intel = 1;
|
||||
|
||||
auto fix = static_cast<FixIntel *>(modify->get_fix_by_id("package_intel"));
|
||||
if (!fix) error->all(FLERR, "The 'package intel' command is required for /intel styles");
|
||||
|
||||
@ -25,7 +25,6 @@
|
||||
#include "memory.h"
|
||||
#include "modify.h"
|
||||
#include "neigh_list.h"
|
||||
#include "neigh_request.h"
|
||||
#include "neighbor.h"
|
||||
#include "suffix.h"
|
||||
|
||||
@ -1109,7 +1108,6 @@ void PairSWIntel::allocate()
|
||||
void PairSWIntel::init_style()
|
||||
{
|
||||
PairSW::init_style();
|
||||
neighbor->find_request(this)->intel = 1;
|
||||
|
||||
map[0] = map[1];
|
||||
|
||||
|
||||
@ -23,7 +23,6 @@
|
||||
#include "force.h"
|
||||
#include "memory.h"
|
||||
#include "neigh_list.h"
|
||||
#include "neigh_request.h"
|
||||
#include "neighbor.h"
|
||||
|
||||
using namespace LAMMPS_NS;
|
||||
@ -407,10 +406,7 @@ void PairTersoffIntel::init_style()
|
||||
|
||||
// need a full neighbor list
|
||||
|
||||
int irequest = neighbor->request(this);
|
||||
neighbor->requests[irequest]->half = 0;
|
||||
neighbor->requests[irequest]->full = 1;
|
||||
neighbor->requests[irequest]->intel = 1;
|
||||
neighbor->add_request(this, NeighConst::REQ_FULL);
|
||||
|
||||
fix = static_cast<FixIntel *>(modify->get_fix_by_id("package_intel"));
|
||||
if (!fix) error->all(FLERR, "The 'package intel' command is required for /intel styles");
|
||||
|
||||
@ -306,3 +306,9 @@ void NeighRequest::set_skip(int *_iskip, int **_ijskip)
|
||||
iskip = _iskip;
|
||||
ijskip = _ijskip;
|
||||
}
|
||||
|
||||
void NeighRequest::enable_full()
|
||||
{
|
||||
half = 0;
|
||||
full = 1;
|
||||
}
|
||||
|
||||
@ -127,6 +127,7 @@ class NeighRequest : protected Pointers {
|
||||
void set_kokkos_device(int);
|
||||
void set_kokkos_host(int);
|
||||
void set_skip(int *, int **);
|
||||
void enable_full();
|
||||
|
||||
int get_size() const { return size; }
|
||||
void *get_requestor() const { return requestor; }
|
||||
|
||||
@ -45,6 +45,7 @@
|
||||
#include "style_npair.h" // IWYU pragma: keep
|
||||
#include "style_nstencil.h" // IWYU pragma: keep
|
||||
#include "style_ntopo.h" // IWYU pragma: keep
|
||||
#include "suffix.h"
|
||||
#include "tokenizer.h"
|
||||
#include "update.h"
|
||||
|
||||
@ -2075,6 +2076,11 @@ NeighRequest *Neighbor::add_request(Pair *requestor, int flags)
|
||||
int irequest = request(requestor, requestor->instance_me);
|
||||
auto req = requests[irequest];
|
||||
req->apply_flags(flags);
|
||||
// apply intel flag. omp flag is set globally via set_omp_neighbor()
|
||||
if (requestor->suffix_flag & Suffix::INTEL) {
|
||||
req->intel = 1;
|
||||
req->omp = 0;
|
||||
}
|
||||
return req;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user