reduce with barriers is essential in parallel functional programming. See the CUDA thrust package.