Fix gpart id/pointer
Making a union of the
gpart ID and the part pointer seemed like a good idea at first, but it's just an accident waiting to happen, as the pointers are not guaranteed to be less than 2^63. I therefore suggest the following:
- Store the
gpartID as a
- If the
gpartID is positive, it's just the particle's ID.
- If the
gpartID is negative, then it is the negative offset in the
space->partsarray of its
This storage format has the additional advantage that it makes it easier to re-link the particles if we ever do have to send them around between nodes, e.g. by making the offsets relative to whatever array the data is stored/sent in.
This is currently just a proposal. Please let me know what you think and if there is no opposition I will change this as soon as the initial
gpart branch has been merged (!116 (merged)).
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information