Archiving attempt to get faster via a permutation matrix for the mpi encoding. Did not work well. Will try a custom kernel when I get a chance, but I doubt it will have much impact.