We currently have a mixture of ways to pass an MPI_Comm to functions.
Unscientific statistic:
$ git grep MPI_Comm include/ | wc -l
394
$ git grep MPI_Comm include/ | grep "&" | wc -l
258
pros for by value:
pros for by ref:
I don't really care which way we go, but being consistent makes sense.
Before I go and make all of them const &: any opinions?
(prompted by #11074)
I guess in terms of performance it doesn't really matter much. I slightly prefer passing by reference since it is an opaque type.
I guess in terms of performance it doesn't really matter much.
That is true. I did not mean to imply that it does.
It's a C-style data type, so it must be copyable (all C data types are copyable). I think we should follow the C convention: Pass by value. That's what the MPI functions themselves do.
I think we should follow the C convention
Alright, I am proposing a vote:
const & :+1: Any more opinions about this very important question? :-)
yay! :+1:
Most helpful comment
Alright, I am proposing a vote:
const &:+1: