METIS 5.2.0 partition error

Hi community,
To run the 2d test cases on PyFR with turbulence plugin (develop branch), using METIS 5.2.0 as partitioner, I get the following errors:

  1. test case: 2d-euler-vortex
$ pyfr partition 2 *.pyfrm *.pyfrs ./
Traceback (most recent call last):
  File "/home/amberjia1205/venv/bin/pyfr", line 33, in <module>
    sys.exit(load_entry_point('pyfr', 'console_scripts', 'pyfr')())
  File "/home/amberjia1205/PyFR_turbulence/PyFR/pyfr/__main__.py", line 125, in main
    args.process(args)
  File "/home/amberjia1205/PyFR_turbulence/PyFR/pyfr/__main__.py", line 191, in process_partition
    mesh, rnum, part_soln_fn = part.partition(mesh, args.progress)
  File "/home/amberjia1205/PyFR_turbulence/PyFR/pyfr/partitioners/base.py", line 391, in partition
    vparts = self._partition_graph(graph, self.partwts).tolist()
  File "/home/amberjia1205/PyFR_turbulence/PyFR/pyfr/partitioners/metis.py", line 166, in _partition_graph
    part_graph_fn(
  File "/home/amberjia1205/PyFR_turbulence/PyFR/pyfr/ctypesutil.py", line 37, in _errcheck
    raise self._statuses[status]
pyfr.partitioners.metis.METISErrorInput
  1. test case: 2d-couette-flow
$ pyfr partition 2 *.pyfrm *.pyfrs ./
Traceback (most recent call last):
  File "/home/amberjia1205/venv/bin/pyfr", line 33, in <module>
    sys.exit(load_entry_point('pyfr', 'console_scripts', 'pyfr')())
  File "/home/amberjia1205/PyFR_turbulence/PyFR/pyfr/__main__.py", line 125, in main
    args.process(args)
  File "/home/amberjia1205/PyFR_turbulence/PyFR/pyfr/__main__.py", line 172, in process_partition
    raise ValueError(f'Missing element weights for: {missing}')
ValueError: Missing element weights for: tri, quad

After reading the performance page, I changed command to:

$ pyfr partition -e balanced couette-flow.pyfrm couette-flow.pyfrs ./
Traceback (most recent call last):
   File "/home/amberjia1205/venv/bin/pyfr", line 33, in <module>
    sys.exit(load_entry_point('pyfr', 'console_scripts', 'pyfr')())
  File "/home/amberjia1205/PyFR_turbulence/PyFR/pyfr/__main__.py", line 125, in main
    args.process(args)

  File "/home/amberjia1205/PyFR_turbulence/PyFR/pyfr/__main__.py", line 153, in process_partition
    pinfo = mesh.partition_info('spt')
  File "/home/amberjia1205/PyFR_turbulence/PyFR/pyfr/util.py", line 39, in newmeth
    res = cache[key] = meth(self, *args, **kwargs)
  File "/home/amberjia1205/PyFR_turbulence/PyFR/pyfr/readers/native.py", line 84, in partition_info
    ai = self.array_info(prefix)
  File "/home/amberjia1205/PyFR_turbulence/PyFR/pyfr/util.py", line 39, in newmeth
    res = cache[key] = meth(self, *args, **kwargs)
  File "/home/amberjia1205/PyFR_turbulence/PyFR/pyfr/readers/native.py", line 67, in array_info
    fmaxpn = max(int(re.search(r'\d+$', n)[0]) for n in names)
ValueError: max() arg is an empty sequence

Iā€™ve tested the above cases in a previous release v1.14.0 with metis 5.1.0, using the single command: pyfr partition 2 euler-vortex.pyfrm euler-vortex.pyfrs
pyfr partition 2 couette-flow.pyfrm couette-flow.pyfrs
both cases were partitioned properly with no error.

Can you help me with this please?
Thanks

I don;t think this has anything to do with the turbulence plugin, the partitioner doesnā€™t invoke the plugins.

Rather than using *.pyfrm can you explicitly set which mesh file you want to work on?

Checking with my local install, which uses a packaged version of metis, it fails. But another install of pyfr with the current develop and a compiled version of metis works fine. Can you try compiling metis? They introduced a bug in the build a few versions ago, and it clearly still isnā€™t resolved. See this topic: Error: No partitioners available, Metis, undefined symbol: gk_jbufs - #4 by WillT

Hi Will,
Thank you very much for your kind reply. Iā€™ve retried by explicitly specifying the mesh file, and got the same error.
Regarding your reply on compiling METIS, Iā€™ll check the post and get back to you later.

Hi Will,
Iā€™ve read the post you shared as well as the ā€˜Finding Packageā€™ page Finding Packages ā€” Mastering CMake
linked in the post for compiling METIS, but donā€™t get how to do it.
Can you explain a bit more please?

To compile metis, download the source code and then, using the link in my previous topic, you see that you need to add the following to the libmetis CMakeList.txt

if(SHARED)
target_link_libraries(metis GKlib)
endif()

Once youā€™ve added that, you can follow the standard process for using a cmake. ie

  1. make a build directory and cd to it
  2. run cmake with a path pointing to the source directory + and options you need to set, for example, -DCMAKE_INSTALL_PREFIX. To see what options are available, it can be helpful to use ccmake.
  3. run make
  4. run make install

Hi Will,

I really appreciate your further explanations. I have followed your instructions, and added the 3-line code in the CMakeLists.txt which is located in /METIS/libmetis.

In step 2, to point to the source directory, do you mean the directory where all the files related to METIS are located, which is /METIS? I entered such command after ā€˜cd buildā€™ and get error as the following:

ā€˜ā€™ā€˜(venv) amberjia1205@AJ:~/METIS$ cd build
(venv) amberjia1205@AJ:~/METIS/build$ cmake -S/METIS -DCMAKE_INSTALL_PREFIX=/usr/local
CMake Error: The source directory ā€œ/METISā€ does not exist.
Specify --help for usage, or press the help button on the CMake GUI.ā€™ā€˜ā€™

Iā€™m sorry for all these mess, Iā€™m also confused since there are five CMakeLists.txt in total, the one we mentioned above is inside /METIS/libmetis, and the rest are respectively located in source directory /METIS, /METIS/build/xinclude, /METIS/programs, and /METIS/include.

When you compile something locally is it normally good to set the installation location as somewhere that is easy to add to your path and easy to delete. Assuming you are compiling metis 5.2.1 I would set the installation location as $HOME/.local/pkg/metis/5.2.1/

What this means in when you are building metis you can do something like:

$ cd /to/somewhere/
$ wget https://github.com/KarypisLab/METIS/archive/refs/tags/v5.2.1.tar.gz
$ tar -zxf v5.2.1.tar.gz
$ cd METIS-5.2.1
$ #apply the changes to the metis' cmake
$ mkdir build
$ cd build
$ cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/.local/pkg/metis/5.2.1/ -Dother_options
$ make -j
$ make -j install 

Once this is done you can add the relevant paths to your bashrc/zshrc.

1 Like

pyfr.partitioners.metis.METISErrorInput

That is my error though.

This has been discussed else where.