Use reduction in dotprod and rm wait_all_results.