How to profile PyFR?

Hi everyone!

I am familiar with profiling C/C++ etc. program, but never profile any Python related stuff. What’s more, PyFR uses a lot of modules and backends, which complicates it more.

So, I want to know is there any one who have profile PyFR instances?

Thanks for any help :slight_smile:

Zhen Zhang

The Python side of PyFR can be profiled using the standard Python
profiling tools.

python -mprofile -o out.prof ~/path/to/sim.py run ...

however this will not give any insight into the performance of the
backend code -- just the overhead due to the interpreter.

In terms of runtime performance this is generally backend specific.
The CUDA backend can be profiled like any other CUDA application using
either nvprof or nvvp.

OpenCL is more complicated and depends on the vendor. At least for
AMD hardware there is a nice profiler that can give you some insight
into the kernels.

The C/OpenMP backend is not all that different from any normal piece
of C/C++ code. Simply do:

export PYFR_DEBUG_OMP_KEEP_LIBS=1

and then run PyFR under your favourite profiler. On Linux I have had
good luck with both OProfile and likwid.

Regards, Freddie.