more openmp neighbor list function to Neighbor class
This commit is contained in:
@ -277,7 +277,7 @@ void FixOMP::init()
|
||||
|
||||
#undef CheckStyleForOMP
|
||||
#undef CheckHybridForOMP
|
||||
set_neighbor_omp();
|
||||
neighbor->set_omp_neighbor(_neighbor ? 1 : 0);
|
||||
|
||||
// diagnostic output
|
||||
if (comm->me == 0) {
|
||||
@ -293,27 +293,6 @@ void FixOMP::init()
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void FixOMP::set_neighbor_omp()
|
||||
{
|
||||
// select or deselect multi-threaded neighbor
|
||||
// list build depending on setting in package omp.
|
||||
// NOTE: since we are at the top of the list of
|
||||
// fixes, we cannot adjust neighbor lists from
|
||||
// other fixes. those have to be re-implemented
|
||||
// as /omp fix styles. :-(
|
||||
|
||||
const int neigh_omp = _neighbor ? 1 : 0;
|
||||
const int nrequest = neighbor->nrequest;
|
||||
|
||||
// flag *all* neighbor list requests as OPENMP threaded,
|
||||
// but skip lists already flagged as INTEL threaded
|
||||
for (int i = 0; i < nrequest; ++i)
|
||||
if (! neighbor->requests[i]->intel)
|
||||
neighbor->requests[i]->omp = neigh_omp;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
void FixOMP::setup(int)
|
||||
{
|
||||
// we are post the force compute in setup. turn on timers
|
||||
|
||||
@ -71,8 +71,6 @@ class FixOMP : public Fix {
|
||||
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();
|
||||
};
|
||||
|
||||
} // namespace LAMMPS_NS
|
||||
|
||||
@ -2111,7 +2111,18 @@ NeighRequest *Neighbor::add_request(Command *requestor, const char *style, int f
|
||||
return req;
|
||||
}
|
||||
|
||||
// set neighbor list request OpenMP flag
|
||||
|
||||
void Neighbor::set_omp_neighbor(int flag)
|
||||
{
|
||||
// flag *all* neighbor list requests as OPENMP threaded,
|
||||
// but skip lists already flagged as INTEL threaded
|
||||
for (int i = 0; i < nrequest; ++i)
|
||||
if (!requests[i]->intel) requests[i]->omp = flag;
|
||||
}
|
||||
|
||||
/* report if there is a neighbor list with the intel flag set */
|
||||
|
||||
bool Neighbor::has_intel_request() const
|
||||
{
|
||||
return (((nrequest > 0) && (requests[0]->intel > 0))
|
||||
|
||||
@ -133,6 +133,9 @@ class Neighbor : protected Pointers {
|
||||
NeighRequest *add_request(class Compute *, int);
|
||||
NeighRequest *add_request(class Command *, const char *, int);
|
||||
|
||||
// set neighbor list request OpenMP flag
|
||||
void set_omp_neighbor(int);
|
||||
|
||||
// report if we have INTEL package neighbor lists
|
||||
bool has_intel_request() const;
|
||||
|
||||
@ -141,8 +144,8 @@ class Neighbor : protected Pointers {
|
||||
void setup_bins(); // setup bins based on box and cutoff
|
||||
virtual void build(int); // build all perpetual neighbor lists
|
||||
virtual void build_topology(); // pairwise topology neighbor lists
|
||||
void build_one(class NeighList *list, int preflag = 0);
|
||||
// create a one-time pairwise neigh list
|
||||
void build_one(class NeighList *list, int preflag = 0);
|
||||
void set(int, char **); // set neighbor style and skin distance
|
||||
void reset_timestep(bigint); // reset of timestep counter
|
||||
void modify_params(int, char **); // modify params that control builds
|
||||
|
||||
Reference in New Issue
Block a user