[petsc-dev] how come rank is an MPInt?

Jed Brown jed at jedbrown.org
Tue Feb 13 12:10:06 CST 2018

"Smith, Barry F." <bsmith at mcs.anl.gov> writes:

> typedef struct {
>   PetscInt rank;                /* Rank of owner */
>   PetscInt index;               /* Index of node on rank */
> } PetscSFNode;
> Shouldn't rank be a PetscMPIInt? and its various uses be fixed?

The intent at some point was for this to be addressable from Fortran77
as a single array.  PetscInt is always large enough to hold an MPI int.
We have the type in Fortran now, but is there a guarantee that alignment
matches C alignment?  If so, we could switch.

More information about the petsc-dev mailing list