Move MPI-related code to C++
Created by: paulromano
This pull request moves all MPI-related code from Fortran to C++. While most of it is straightforward, there are a few points worth mentioning:
- You'll notice that
tally_results(int)in the new
include/openmc/tallies/tally.hfile have strange return types. The more obvious thing to do (return an
xtensor) actually doesn't work. The gist of it is that if you try to return an
xarraythat represents some other array that you have adapted (via
xt::adapt), you end up getting a copy, so it's not possible to modify the array afterwards.
- I managed to get a
write_datasetfunction that works for both
xtensors, but it required making sure that the scalar version of
write_datasetis enabled only for truly scalar values (hence the use of
- When converting
synchronize_bank, I had to use
std::lower_boundfor binary searches to match the behavior of our existing binary search in the case where the value being searched is present in the array.