pyccel / psydac

Python 3 library for isogeometric analysis
https://pyccel.github.io/psydac/
MIT License
47 stars 17 forks source link

Speed up Psydac installation using better Pyccel templates #383

Closed yguclu closed 6 months ago

yguclu commented 6 months ago

Psydac is using a primitive form of the Pyccel templates, and therefore generates many more Fortran functions than strictly necessary. For example, we should write the code

@template(name='T', types=[float, complex])
def kernel(a : 'T', f : 'T[:, :]', jac : 'T[:, :, :, :]'):
    ...

which generates the two required Fortran functions. Instead, we currently write

@template(name='T0', types=['float', 'complex'])
@template(name='T2', types=['float[:, :]', 'complex[:, :]'])
@template(name='T4', types=['float[:, :, :, :]', 'complex[:, :, :, :]'])
def kernel(a : 'T0', f : 'T2', jac : 'T4'):
    ...

which generates 8 different Fortran functions, of which 6 are clearly useless.

This results in a very slow pyccelization of the kernels part of the Psydac installation.

yguclu commented 6 months ago

Blocked by https://github.com/pyccel/pyccel/issues/1779.