Fix a bug where not all orientations were written out

In MPI mode, only the first local getN() orienatations were written.