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

Smith, Barry F. bsmith at mcs.anl.gov
Tue Feb 13 13:41:50 CST 2018


  PetscLayOutFindOwner and PetscLayoutFindOwnerIndex() also have this perversity of using the wrong type. But I guess once we let the standards slip once we might as well willy nilly mix mix two different types as one anywhere.



> On Feb 13, 2018, at 12:10 PM, Jed Brown <jed at jedbrown.org> wrote:
> 
> "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