Should the type of the ordinal in Teuchos::MpiComm ever be something other than int? #13865
-
In looking at the example in https://docs.trilinos.org/dev/packages/tpetra/doc/html/Tpetra_Lesson01.html, I see that in this line of code RCP<const Comm<int> > comm (new MpiComm<int> (yourComm)); the ordinal type used with MpiComm is Is there any particular rhyme or reason for this choice of ordinal type? |
Beta Was this translation helpful? Give feedback.
Answered by
bartlettroscoe
Mar 10, 2025
Replies: 1 comment 2 replies
-
@trilinos/tpetra |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The decision to template
Teuchos::Comm
onOrdinal
goes back to at least 2005 (I think). It was the wrong decision. With MPI, it is hard coded toint
and it never should have been templated (because the only production implementation in the last 20 years was MPI). Templating onOrdinal
just complicates the code and allows for arbitrary incompatibilities and the need for silly conversion code for incompatible Ordinal types. This was an example of over exuberance on C++ templating in the early days of Trilinos. This is just one of those live and learn situations. It is much easier to add new template parameters than t…