Metis 5.0 and Fortran
Hello
In Metis 5 what exactly is NULL?
I am trying to use the METIS_PartMeshNodal routine from Fortran.
T
Submitted by stali on Mon, 2012-05-14 11:27
»
- Login to post comments
|
|
|
Copyright 2006-2015, George Karypis. Internal Lab Website | - - |
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()
etc.
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 http://bpaste.net/show/DZzY6Re5iXMgLSHydOgJ/
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()
eptr=(/0,4,7/)
nodes=(/0,1,2,3,1,4,5,2/)
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.