Skip to content

Instantly share code, notes, and snippets.

@hirschsn
hirschsn / dims_create.cc
Created November 13, 2019 09:35
Greedy MPI_Dims_create
/**
* This greedy implementation is exactly what OpenMPI does.
*/
#include <array>
#include <vector>
#include <algorithm>
std::vector<int> prime_factors(int n) {
std::vector<int> fs;
for (int p = 2; n > 1; ++p) {