ivan-pi / fmetis Goto Github PK
View Code? Open in Web Editor NEWA modern Fortran interface to the METIS graph partitioning library
Home Page: https://ivan-pi.github.io/fmetis/
License: Apache License 2.0
A modern Fortran interface to the METIS graph partitioning library
Home Page: https://ivan-pi.github.io/fmetis/
License: Apache License 2.0
I found that the APIs, METIS PartGraphRecursive() and METIS PartGraphKway(), can not output the partition of each element. They only can output the partition of each node. Do you know how I can get the partition of each elemnt using APIs ?
We should be able to use fpm with metis.
at line 55 in metis_tests.f90 code: call write_graph("test1.graph",fxadj,fadjncy,1)
fxadj and fadjncy are C style numbering.
The program generates the following error message:
forrtl: severe (408): fort: (11): Subscript #1 of the array ADJNCY has value 0 which is less than the lower bound of 1
Image PC Routine Line Source
libifcoremdd.dll 00007FFF8E4E5597 Unknown Unknown Unknown
fmetis_test.exe 00007FF73BB920AE METIS_IO_mp_WRITE 45 metis_io.f90
fmetis_test.exe 00007FF73BBA225F METIS_TESTS_mp_TE 75 metis_tests.f90
fmetis_test.exe 00007FF73BBA433C MAIN__ 235 metis_tests.f90
fmetis_test.exe 00007FF73BBB8992 Unknown Unknown Unknown
fmetis_test.exe 00007FF73BBE7994 Unknown Unknown Unknown
fmetis_test.exe 00007FF73BBE78BE Unknown Unknown Unknown
fmetis_test.exe 00007FF73BBE777E Unknown Unknown Unknown
fmetis_test.exe 00007FF73BBE7A09 Unknown Unknown Unknown
KERNEL32.DLL 00007FF80EB53DC4 Unknown Unknown Unknown
ntdll.dll 00007FF80ECA3691 Unknown Unknown Unknown
Hello,
Firstly, I'd like to thank you for the great work. I've had machine dependent problems with doing this call before.
I'm using your interface in my F90 code but not able to get past the MeshToNodal call.
All my variables are interoparable c types including the parameters to the call. The most important ones look like this:
INTEGER(C_INT),POINTER :: NXADJ(:)=>null(),NADJNCY(:)=>null() ! nodal graph CRS structure
TYPE(C_PTR) :: PTRNXADJ,PTRNADJNCY !args for metis
I call the routine like this:
ios=METIS_MeshToNodal(neT,npT,EPTR,EIND
& ,numflag,PTRNXADJ,PTRNADJNCY)
if (ios /= METIS_OK) then
write(*,*) "METIS_MeshToNodal failed with error: ", ios
error stop 1
end if
CALL C_F_POINTER(PTRNXADJ,NXADJ,shape=[npT+1])
CALL C_F_POINTER(PTRNADJNCY,NADJNCY,shape=[NXADJ(npT+1)-1])
and this works with Ifort but does not work with Gfortran.
I get the following message on the call to MeshToNodal
Current memory used: 0 bytes
Maximum memory used: 0 bytes
***Memory allocation failed for CreateGraphNodal: nptr. Requested size: 1420087986928848 bytes
METIS_MeshToNodal failed with error: -3
ERROR STOP 1
The mesh is triangular and I'm using the fortran numbering. I suspect it has something to do with the null() assignment but I'm not quite sure.
Any help would be appreciated! Thanks
The Intel Fortran compiler shows warning when compiling the read_graph
and write_graph
routines in metis_oo_interface.f90
due to the use of BOZ constants (e.g. b'001', b '101') in the select case construct used to discern different types of graphs.
One solution is to simply convert the Boz constant to integers with the int
intrinsic, or simply code their integer values their directly (and put the binary pattern in a comment).
Hi @ivan-pi,
I am currently working on metis and mpi libraries to optimize our hydrological system modelling; all the codes. tools and modules are freely available on github at https://github.com/c-hydro.
(1)
To compile your fmetis libraries i had to add the gklib to the linking process;
cmake .. -DCMAKE_Fortran_COMPILER=gfortran -DMETIS_LIB="$HOME/metis_workspace/lib/libmetis.a" -DGK_LIB="$HOME/metis_workspace/lib/libGKlib.a" -DCMAKE_INSTALL_PREFIX="$HOME/metis_interface/"
(2)
and I added the GK_LIB in the CMAKE file too (ll 74-75):
add_library(fmetis src/lib/metis_interface.f90 src/lib/metis_oo_interface.f90)
target_link_libraries(fmetis ${METIS_LIB} ${GK_LIB})
Some tests failed, but I am using the libraries to interface my simple metis fortran program to the metis library.
This probably is due to the the new (?) approach to compile metis that, if I correctly understood, it is divided in two parts:
(1) gklib
...
make config cc=gcc prefix="$HOME/metis_workspace" openmp=set
make install
(2) metis
...
make config r64=1 i64=1 cc=gcc gdb=1 gklib_path=$HOME/metis_workspace/ prefix=$HOME/metis_workspace/
make install
Is it correctly or I missed some remarks or suggestions?
I hope I am not wasting your time with unuseful comments or questions
All the best
Fabio
I have been sufferred 1 month by the error when I updated my code from metis4 to metis5. The interface you given in this hub is f**king good. I love you , bro.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.