Skip to content

Should the type of the ordinal in Teuchos::MpiComm ever be something other than int? #13865

Answered by bartlettroscoe
jjramsey asked this question in Q&A
Discussion options

You must be logged in to vote

Is there any particular rhyme or reason for this choice of ordinal type?

The decision to template Teuchos::Comm on Ordinal goes back to at least 2005 (I think). It was the wrong decision. With MPI, it is hard coded to int and it never should have been templated (because the only production implementation in the last 20 years was MPI). Templating on Ordinal 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…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@cgcgcg
Comment options

cgcgcg Mar 10, 2025
Collaborator

@bartlettroscoe
Comment options

Answer selected by cgcgcg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
pkg: Teuchos Issues primarily dealing with the Teuchos Package
4 participants