Need help with parallel debugging

Dear all,
Recently, I have many questions about PyFR since I try to read and understand the context of codes. The structure and idea of PyFR is attractive, but difficulities remain exist. I successfully achieve serial debugging with pycharm in ubuntu16, but unfortunately I am failed to debug the code with MPI. The debugging of cuda and opencl might be more difficult. I hope you can provide some experiences in detail about how to parallel debugging during studying or developing the PyFR? To my best knowledge, the available tools for C++/fortran parallel debugging is totalview and ddt.
In my opinion, PyFR has great potential and can be combined with artificial intelligence and future quantum computing. So I hope to learn from and later contribute to this open source.

Regards,
Kiny

PyFR was developed entirely (both in serial and parallel) without the use of any debuggers. In general it is much easier to get it right the first time than faff around with a debugger; this is especially true when one is dealing with GPUs, multiple threads, or anything to do with MPI.

Regards, Freddie.

1 Like

Thank you, Freddie. I will study the code structure with serial debugging and follow your way to learn from the rest.

Hello, I want to study the structure of PyFR, but how to achieve serial debugging with pycharm? I copy one case in the pyfr file. Coul you tell me how to do it?

Thanks

Debugging should not be any different to debugging any other Python application.

Regards, Freddie.

Yes, I run the program, and the error:
File “/home/ENV3/lib/python3.8/site-packages/pyfr/main.py”, line 8, in
import mpi4py.rc
ModuleNotFoundError: No module named ‘mpi4py’

Do you know what happened?

Thanks

As noted in the install guide PyFR requires mpi4py. Please install this module through the usual channel (site packages, virtual environment, system package manager, …).

Regards, Freddie.

Thanks. I click the ‘run’/ ‘debug’ buttom, the error is as follows. And I run in Terminal, it works.

Traceback (most recent call last):
File “/home/ENV3/lib/python3.8/site-packages/pyfr/main.py”, line 11, in
from pyfr.backends import BaseBackend, get_backend
ModuleNotFoundError: No module named ‘pyfr’

Shoul I take other steps?

Best regards

This appears to be a PyCharm configuration issue rather than a PyFR issue. You will need to see how to set up import paths and the such like in PyCharm.

Regards, Freddie.

I change the import parth, but when I debug, the program breaks and the following occurs:

usage: pyfr [-h] [–verbose] {import,partition, export,run,restart} …

positional arguments:
{import,partition,export,run,restart}
sub-command help
import import --help
partition partition --help
export export --help
run run --help
restart restart --help

optional arguments:
-h, --help show this help message and exit
–verbose, -v

Process finished with exit code 0

This is consistent with running PyFR without any command line arguments. Your debugger should allow you to specify what arguments you want to provide to the program.

Regards, Freddie.

OK,thanks.

I tried again. And I can only step into main function, but the process_import, process_run…function can not be stepped into. Can’t PyFR go into process_import, process_run… functions to debug?

Best regards

Which functions PyFR will go into depends on the arguments it is passed. If you execute (or debug) PyFR without any command line arguments it will simply print the help text and exit. To get it to go into process_import you will need to run PyFR as pyfr import a_mesh.msh a_file.pyfrm.

Regards, Freddie.