when has an exchange or sort occured

Hi all, I would like to know in a fix when atoms are exchanged or sorted. I know when the *can* be through implementation of pre_neighbor, e.g., but it's not easy to find out if any atoms actually crossed processors or if a sort was done. For now I assume that both events occurred, but it would help me streamline my code if I could know if any work was needed. I ask because a significant chunk of the work our fix does is spent in tasks related to handling these events.
thanks,
Jeremy

These variables may help

neighbor->ago = how many steps ago reneighboring/exchange was done
  can be examined from any fix method, not just pre_neighbor
atom->sortflag = sort every this many steps
atom->nextsort = next timestep to sort

Sorting also triggers a reneighbor.

I suppose it would be possible to store a per-proc flag
if a proc actually exchanged atoms. But it would need
to be summed across procs.

Steve

Thanks Steve. I'll try playing around with these functions and see how I can improve my code.
Jeremy