Use the threadpool and atomic operations to parallelize the assignment of gparts to the density mesh.