You could try to create the buffer externally, pass it to the Dataset, and write the data to it from each worker (making sure that the workers don’t overlap). I guess the difference between my approach and your suggestion would be to initialize the shared array outside of the Dataset and pass it as an argument to it.