Piro: Epetra classes to check for int type before calling NumGlobalElements
Created by: bartgol
@trilinos/piro
Expectations
One should be able to use Epetra maps with long long global indices, and still use Piro.
Current Behavior
If the Epetra maps are built with long long global indices, piro epetra classes to not work, due to calls to NumGlobalElements
rather than NumGlobalElements64
.
Motivation and Context
Albany needs to use 64bits global ordinals. Therefore, the epetra maps store long long global ordinals. However, the method NumGlobalElements
in Epetra_BlockMap
returns an int. One should use NumGlobalElements64
to get a 64bits integer return value. Even more: the former method throws if the map actually stores 64bits integers.
Definition of Done
The epetra classes in piro (e.g., Piro::Epetra::NOXSolver) should work with both 32 and 64 bits integers.
Possible Solution
Before each call to NumGlobalElements, check for the type of indices. If they are int (32bits), use NumGlobalElements
, while if they are long long (64bits), use NumGlobalElements64
.