refactoring of USER-TALLY computes to handle sparse and hybrid systems
with sparse and hybrid systems, Pair::ev_tally() may not be called on every processor and thus the computes in USER-TALLY may hang during reverse communication because of the error->all() call after checking whether callback from Pair::ev_tally() has been called at least once. To address this cleanly, a second callback function needs to be added, which is run during Pair::ev_setup() and will now handle all memory re-allocation and clearing of accumulators, just like it is done for regular tallied data.
This commit is contained in:
10
src/pair.cpp
10
src/pair.cpp
@ -814,6 +814,16 @@ void Pair::ev_setup(int eflag, int vflag, int alloc)
|
||||
if (vflag_atom == 0) vflag_either = 0;
|
||||
if (vflag_either == 0 && eflag_either == 0) evflag = 0;
|
||||
} else vflag_fdotr = 0;
|
||||
|
||||
|
||||
// run ev_setup option for USER-TALLY computes
|
||||
|
||||
if (num_tally_compute > 0) {
|
||||
for (int k=0; k < num_tally_compute; ++k) {
|
||||
Compute *c = list_tally_compute[k];
|
||||
c->pair_setup_callback(eflag,vflag);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user