Satish Balay balay at
Sun Oct 21 09:09:47 CDT 2007

On Sun, 21 Oct 2007, Matthew Knepley wrote:

> On 10/20/07, Satish Balay <balay at> wrote:

> > My proposal is to have PetscSizeT [atleast on the fortran side - that
> > is set properly - simlar to PetscFortranAddr].

> I would rather run the logic backwards. In my opinion, typedefing size_t in
> C is the correct solution and leaves you with sane looking code. Fortran is
> the problem here. So define a type size_t in Fortran as well.

We don't pollute in the general namespace. So adding 'size_t' to
fortran will break this rule. Also all current PETSc defined types
start with a cap. And we hardly use any general 'c' datatypes
anyway. [for eg: we define MPIInt, BLASInt etc instead of using int].
We also wrap memcpy() under PetscMemcpy() - so don't have a PETSc
implemented fortran-function 'call memcpy()'. [Perhaps there were also
other reasons for this wrapping].

So I think defining 'size_t' on the fortan side creates ambiguity [and
breaks the current conventions] - and should be avoided.

For now, I've changed fortran-interface to use PetscSizeT. C-interface
continues to use size_t.


More information about the petsc-dev mailing list