KarypisLab / METIS

METIS - Serial Graph Partitioning and Fill-reducing Matrix Ordering
Other
703 stars 139 forks source link

Bus error from running metis.part_graph in Python #97

Closed jarnold360 closed 6 days ago

jarnold360 commented 1 week ago

I am on MacOS with M3 Max, Sonoma 14.6.1.

I installed following the instructions for GKlib and then METIS https://github.com/KarypisLab/GKlib https://github.com/KarypisLab/METIS

then I set the environment variables for METIS_DLL, METIS_IDXTYPEWIDTH, METIS_REALTYPEWIDTH manually in .zshrc

Then I do pip install metis

With python 3.9 and 3.12, I tried: `import metis import networkx as nx

G = nx.balanced_tree(3,3) (num_edgecuts, parts) = metis.part_graph(G, nparts=5)`

Which returns:

Runtime parameters: Objective type: METIS_OBJTYPE_CUT Coarsening type: METIS_CTYPE_SHEM Initial partitioning type: METIS_IPTYPE_METISRB Refinement type: METIS_RTYPE_GREEDY Perform a 2-hop matching: No Number of balancing constraints: 1 Number of refinement iterations: 10 Random number seed: -1 Number of partitions: 5 Number of cuts: 1 User-supplied ufactor: 30 Minimize connectivity: No Create contigous partitions: No Target partition weights: 0=[2.00e-01] 1=[2.00e-01] 2=[2.00e-01] 3=[2.00e-01] 4=[2.00e-01] Allowed maximum load imbalance: 1.030

    40          0          0 [150] [        0:      40 ]

zsh: bus error python3

I've tried a bunch of different variations of setting METIS_IDXTYPEWIDTH, METIS_REALTYPEWIDTH in the metis files, but I cannot get around this bus error. Is anyone else seeing this behavior? Thanks!

jarnold360 commented 6 days ago

Resolved... I just uninstalled it and installed it a bunch of times until it worked...