Code Monkey home page Code Monkey logo

mgmetis's People

Contributors

chiao45 avatar xuhao1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mgmetis's Issues

Install with error.

The feedbacks are about " /usr/lib64/mpi/gcc/openmpi2/bin/mpicc: no such file or directory". I only use mpich and i have intalled it.
I want to know how to disable the use of openmpi or disable it.

Parmetis error

ParMETIS is not available, please install mpi4py and rebuild mgmetis

OpenMP METIS

Multithreading is definitely useful, it should be enabled in mgmetis.

TODO Tasks

  • Support MPI as stated in #2
  • Support OpenMP as stated in #3

Bad output with Python 3.6.7

Hi.

I tried to use mgmetis inside a Docker container that uses Python 3.6.7 and NumPy 1.18.1. When I attempt to partition a mesh with 8 cells into 4 parts with the following script,

from mgmetis import metis
import numpy as np
cells = np.array([[0, 1, 4], [0, 3, 4], [1, 2, 5], [1, 4, 5], [3, 4, 7], [3, 6, 7], [4, 5, 8], [4, 7, 8]], dtype = 'int64')
print(cells.dtype)
parts = 4
objval, epart, npart = metis.part_mesh_dual(parts, cells, ncommon = 2)
print('objval:', objval)
print('epart:', epart)

I get a bad partition:
docker
When I run the same script locally with Python 3.8.2 and NumPy 1.18.1, I get a good partition:
local
Do you know what my problem may be?
Thank you.

Segmentation fault with parmetis

Hi, I am trying to use parmetis but I am having a segmentation fault.

OS: Ubuntu 7.5.0-3ubuntu1~18.04
MPI: mpirun (Open MPI) 4.0.5

First, I check MPI is properly installed:

$ env MPICC=$(which mpicc) python3 -m pip install mpi4py
$ mpiexec -n 5 python -m mpi4py.bench helloworld
Hello, World! I am process 0 of 5 on localhost.
Hello, World! I am process 1 of 5 on localhost.
Hello, World! I am process 2 of 5 on localhost.
Hello, World! I am process 3 of 5 on localhost.
Hello, World! I am process 4 of 5 on localhost.

Next, I install mgmetis:

$ python3 -m pip install --upgrade pip setuptools wheel
$ git clone https://github.com/chiao45/mgmetis.git
$ cd mgmetis
$ python setup.py build
$ python setup.py install

Finally, I tried running a simple example, my_test.py, inspired from the unittest test_part_kway.py:

import numpy as np
from mgmetis.parmetis import part_kway
from mpi4py import MPI

comm = MPI.COMM_WORLD
has_mpi = True
rank = comm.rank

xadj = [int(x) for x in "0 2 5 8 11 13 16 20 24 28 31 33 36 39 42 44".split()]
adjncy = [
    int(x)
    for x in "1 5 0 2 6 1 3 7 2 4 8 3 9 0 6 10 1 5 7 11 2 6 8 12 3 7 9 13 4 8 14 5 11 6 10 12 7 11 13 8 12 14 9 13".split()
]
xadj, adjncy = np.asarray(xadj, dtype=int), np.asarray(adjncy, dtype=int)
n = xadj.size // 2

xadj0 = xadj[: n + 1].copy()
adjs0 = adjncy[: xadj0[-1]].copy()
xadj, adjs = np.asarray(xadj0, dtype=int), np.asarray(adjs0, dtype=int)
_, part = part_kway(4, xadj, adjs, comm=comm)

But I get this segmentation fault:

$ python my_test.py
[localhost:222298] *** Process received signal ***
[localhost:222298] Signal: Segmentation fault (11)
[localhost:222298] Signal code:  (128)
[localhost:222298] Failing at address: (nil)
[localhost:222298] [ 0] /lib/x86_64-linux-gnu/libc.so.6(+0x3ef10)[0x7fdab870af10]
[localhost:222298] [ 1] /my_project/mgmetis/_cython/./metis64.cpython-36m-x86_64-linux-gnu.so(libmetis__CreateCoarseGraphNoMask+0x1df)[0x7fd897e6749f]
[localhost:222298] [ 2] /myproject/mgmetis/mgmetis/_cython/./metis64.cpython-36m-x86_64-linux-gnu.so(libmetis__Match_RM+0x33a)[0x7fd897e6840a]
[localhost:222298] [ 3] /myproject/mgmetis/mgmetis/_cython/./metis64.cpython-36m-x86_64-linux-gnu.so(libmetis__CoarsenGraph+0x123)[0x7fd897e68e93]
[localhost:222298] [ 4] /myproject/mgmetis/mgmetis/_cython/./metis64.cpython-36m-x86_64-linux-gnu.so(libmetis__MlevelKWayPartitioning+0xf1)[0x7fd897e763b1]
[localhost:222298] [ 5] /myproject/mgmetis/mgmetis/_cython/./metis64.cpython-36m-x86_64-linux-gnu.so(METIS_PartGraphKway+0x2af)[0x7fd897e7678f]
[localhost:222298] [ 6] /myproject/mgmetis/mgmetis/_cython/parmetis64.cpython-36m-x86_64-linux-gnu.so(ParMETIS_V3_PartKway+0x4f8)[0x7fd8980e0ce8]
[localhost:222298] [ 7] /usr/lib/x86_64-linux-gnu/libffi.so.6(ffi_call_unix64+0x4c)[0x7fd89c542dae]
[localhost:222298] [ 8] /usr/lib/x86_64-linux-gnu/libffi.so.6(ffi_call+0x22f)[0x7fd89c54271f]
[localhost:222298] [ 9] /my_venv_3.6.9/lib/python3.6/lib-dynload/_ctypes.cpython-36m-x86_64-linux-gnu.so(_ctypes_callproc+0x2b4)[0x7fd89c7565a4]
[localhost:222298] [10] /my_venv_3.6.9/lib/python3.6/lib-dynload/_ctypes.cpython-36m-x86_64-linux-gnu.so(+0x11d34)[0x7fd89c756d34]
[localhost:222298] [11] python(_PyObject_FastCallKeywords+0x19c)[0x5aa9ac]
[localhost:222298] [12] python[0x50af03]
[localhost:222298] [13] python(_PyEval_EvalFrameDefault+0x444)[0x50c924]
[localhost:222298] [14] python[0x508675]
[localhost:222298] [15] python[0x50a3e0]
[localhost:222298] [16] python[0x50adcd]
[localhost:222298] [17] python(_PyEval_EvalFrameDefault+0x12a4)[0x50d784]
[localhost:222298] [18] python[0x508675]
[localhost:222298] [19] python(PyEval_EvalCode+0x23)[0x50b7d3]
[localhost:222298] [20] python[0x6352e2]
[localhost:222298] [21] python(PyRun_FileExFlags+0x97)[0x635397]
[localhost:222298] [22] python(PyRun_SimpleFileExFlags+0x17f)[0x638b4f]
[localhost:222298] [23] python(Py_Main+0x591)[0x6396f1]
[localhost:222298] [24] python(main+0xe0)[0x4b0e50]
[localhost:222298] [25] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7)[0x7fdab86edc87]
[localhost:222298] [26] python(_start+0x2a)[0x5b30ea]
[localhost:222298] *** End of error message ***
Segmentation fault

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.