issue #36: use int rather than long long in critical particle loops