Add support for different algorithms for parallelization.