Using different backends

I’m running the examples given in the PyFR GitHub repo. To run with OpenMP I use the following command:

$ pyfr run -b openmp -p couette_flow_2d.pyfrm couette_flow_2d.ini

To run with CUDA I use this command:

$ pyfr run -b cuda -p couette_flow_2d.pyfrm couette_flow_2d.ini

When running the examples, I noticed that the [backend-openmp] and [backend-cuda] sections can be removed from the configuration ini file and the example will still run.

So is it optional to define the backend in the config file? If the backend is not parameterized in the config file then does PyFR assume some defaults to use for that backend?

Hi Gavin,

Many of the configuration options in PyFR are imbued with sensible defaults. As such it is often possible to leave certain sections blank if you’re happy with the defaults. However, should you wish to override these defaults (such as which GPU we should use for the CUDA backend, or which BLAS library we should use for the OpenMP backend) then you may do so.

More specifically, the defaults are specified at the point in the code where the option is fetched. For example, in the CUDA backend we have:

devid = cfg.get(‘backend-cuda’, ‘device-id’, ‘round-robin’)

Which fetches the device-id key from the [backend-cuda] section. If this is not present then the key defaults to ‘round-robin’ which is a sensible default.

Regards, Freddie.