@kayvonf Because if there wasn't a lock, two particles could try to append themselves to the same cell_list at the same time, and only one of them would be saved to the global cell_list. It's the same reason we need atomic additions for multi-worker summation.
Question: Why does this code contain a lock?
@kayvonf Because if there wasn't a lock, two particles could try to append themselves to the same cell_list at the same time, and only one of them would be saved to the global cell_list. It's the same reason we need atomic additions for multi-worker summation.