Metis 5.0 and Fortran


In Metis 5 what exactly is NULL?

I am trying to use the METIS_PartMeshNodal routine from Fortran.


RE: Actually it

Actually it is

integer,pointer :: vwgt=>null(),vsize=>null(),mopts=>null()
real(8),pointer :: tpwgts=>null()

RE: Sorry

They have to be declared as ...

integer,pointer :: vwgt=>null(),vsize=>null(),mopts=>null()
real(8),pointer :: tpwgts=>null()


RE: Unfortunately I spoke too

Unfortunately I spoke too soon. The following program segfaults with the PGI Fortran compiler. Can any of the METIS developers please take a look.

The output is listed at

program test
implicit none
integer, parameter :: nels=2, nnds=6, npel=4
integer :: eptr(nels+1), nodes(nels*npel), epart(nels), npart(nnds), n
integer, pointer :: vwgt(:)=>null(), vsize(:)=>null(), mopts(:)=>null()
real(8), pointer :: tpwgts(:)=>null()
call METIS_PartMeshNodal(nels,nnds,eptr,nodes,vwgt,vsize,2,tpwgts,mopts,n,epart,npart)
print*, npart; print*, epart
end program test

RE: Solution

OK so the answer is that you simply need to declare a bunch of pointers that you pass them during the call. For example

integer,pointer :: vwgt(:)=>null(),vsize(:)=>null(),mopts(:)=>null()
real(8),pointer :: tpwgts(:)=>null()

and so on ...

Maybe the documentation can mention this more clearly.