OpenMP has a [scan clause](https://www.openmp.org/spec-html/5.1/openmpsu52.html#x77-850002.11.8) for reductions. There is some nontrivial design space in good concurrent implementations of this primitive: * http://www.eecs.umich.edu/courses/eecs570/hw/parprefix.pdf * https://software.intel.com/content/www/us/en/develop/articles/openmp-simd-for-inclusiveexclusive-scans.html