Bit 3 of list->firstneigh[i][jj]

I have a question about the list->firstneigh[i][jj]

For example in pair_style
pair_lj_cut_coul_long.cpp
there is:

for (ii = 0; ii < inum; ii++) {
i = ilist[ii];

for (jj = 0; jj < jnum; jj++) {
  j = jlist[jj];
  factor_lj = special_lj[sbmask(j)];  //   sbmask return  j >> 30 & 3;  
  factor_coul = special_coul[sbmask(j)];
  j &= NEIGHMASK;  // NEIGHMASK = 0x1FFFFFFF ; s

The numbers jlist[jj], encode both the 1-2,1-3,1-4,>1-4 exclusion character (bits 1 and 2 from left to right) and the local id of atom (bits 4 … 32 from left to right)
---- My question is: What about bit 3 (from left) of the ilist[ii], what is reserved for ?

Or can we use bit 3 together with 1 and 2 (from left to right) of the jlist[jj]; to encode more than 4 types of exclusions ?


Please see the src/lmptype.h file:

// reserve 2 highest bits in molecular system neigh list for special bonds flag
// reserve 3rd highest bit in neigh list for fix neigh/history flag
// max local + ghost atoms per processor = 2^29 - 1

#define SBBITS 30
#define HISTBITS 29
#define NEIGHMASK 0x1FFFFFFF
#define HISTMASK 0xDFFFFFFF
#define SPECIALMASK 0x3FFFFFFF

No. At least not at this general level. Please see the AMOEBA package which supports 1-5 special neighbors for how to extend this without reducing the maximum allowed number of local atoms any further.

NEIGHMASK15 is the same as NEIGHMASK, so indeed the same max local + ghost atoms per processor (2^29-1) are used.

However, in amoeba package the sbmask15(j) is: j >> 29 & 7
which indicates that amoeba package uses the first 3 bits (left to right) of jlist for deciding the exclusion category (1-2, 1-3, 1-4, 1-5, non-bonded(more than 1-5))

if so, then wouldn’t that override that “reserved” assignment of 3rd bit (from left to right) of the jlist to that fix neigh/history flag?

In other words, it uses the same number of atoms + ghost per core, while overriding the initial (default) “reservation” of the 3rd bit (from left) of jlist?