GithubHelp home page GithubHelp logo

pyccel / gelato Goto Github PK

View Code? Open in Web Editor NEW
5.0 4.0 2.0 4.19 MB

Generalized Locally Toeplitz

Home Page: http://gelato.readthedocs.io/

License: MIT License

Python 47.72% Shell 0.77% Jupyter Notebook 49.13% CSS 2.38%
isogeometric-analysis b-splines fourier-analysis sympy partial-differential-equations symbolic-manipulation

gelato's Introduction

Pyccel : write Python code, get Fortran speed

Linux unit tests MacOSX unit tests Windows unit tests Anaconda-Linux Anaconda-Windows Intel unit tests codacy DOI

Pyccel stands for Python extension language using accelerators.

The aim of Pyccel is to provide a simple way to generate automatically, parallel low level code. The main uses would be:

  1. Convert a Python code (or project) into a Fortran or C code.
  2. Accelerate Python functions by converting them to Fortran or C functions.

Pyccel can be viewed as:

  • Python-to-Fortran/C converter
  • a compiler for a Domain Specific Language with Python syntax

Pyccel comes with a selection of extensions allowing you to convert calls to some specific Python packages to Fortran/C. The following packages will be (partially) covered:

  • numpy
  • scipy

Pyccel's acceleration capabilities lead to much faster code. Comparisons of Python vs Pyccel or other tools can be found in the benchmarks repository. The results for the devel branch currently show the following performance on Python 3.10: Pyccel execution times for devel branch

If you are eager to try Pyccel out, we recommend reading our quick-start guide.

Citing Pyccel

If Pyccel has been significant in your research, and you would like to acknowledge the project in your academic publication, we would ask that you cite the following paper:

Bourne, Güçlü, Hadjout and Ratnani (2023). Pyccel: a Python-to-X transpiler for scientific high-performance computing. Journal of Open Source Software, 8(83), 4991, https://doi.org/10.21105/joss.04991

The associated bibtex can be found here.

Installation

Pyccel has a few system requirements to ensure that the system where it is installed is capable of compiling Fortran code. These requirements are detailed in the documentation. Once all requirements are satisfied, the simplest way to install Pyccel is using PyPI. Simply run:

python3 -m pip install --user pyccel

Alternative installation methods such as installing from source, or installing with a docker are described in the documentation.

Contributing

We welcome any and all contributions.

There are many ways to help with the Pyccel project which are more or less involved. A summary can be found in the documentation.

We can also be contacted via the Pyccel Discord Server.

User Documentation

Developer Documentation

gelato's People

Contributors

ratnani avatar ratnania avatar saidctb avatar yguclu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

gelato's Issues

Importing `gelato.expr` seems to import `gelato.utils` which in turn imports `matplotlib`

Running psydac on the CoolMUC2 cluster with 112 processes (on two nodes, basically each thread -> MPI process...), the matplotlib import from the gelato.utils file caused some errors, since apparently matplotlib somehow caused all processes on one processor to serialize, and subsequently to timeout and throw a Python error.
Removing the only GeLaTo reference, a gelato.expr import from psydac (see https://github.com/pyccel/psydac/blob/a87c616b6d72066275207e26efc440457e5c7266/psydac/api/ast/glt.py#L39 ) removed this problem. Thing is, gelato.utils is neither explicitly imported nor needed in the code, but somehow seems to be imported anyways when importing gelato.expr.

The solution might be to change the gelato.__init__.py to not import all subfiles, or alternatively to move the matplotlib import inside the function where it is used.

Run unit tests on GitHub Actions

As done for Pyccel, SymPDE, Psydac and PyGyro, we should migrate our continuous integration pipeline from Travis CI to GitHub Actions.

domain attribute is missing when gelatizing a bilinear form

When running the following notebook from GeLaTo, and executing the following lines:

p = 3

sl = gelatize(laplace, p)
sm = gelatize(mass, p)

expr = sl/sm

I get the following error,

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-4-3b5c3059c8da> in <module>
      1 p = 3
      2 
----> 3 sl = gelatize(laplace, p)
      4 sm = gelatize(mass, p)
      5 

~/CODES/PYCCEL/gelato/gelato/expr.py in gelatize(a, degrees, n_elements, evaluate, mapping, human, expand)
     34 
     35     # ... compute tensor form
---> 36     expr = TensorExpr(a, mapping=mapping, expand=expand)
     37     # ...
     38 

~/CODES/PYCCEL/sympde/sympde/expr/evaluation.py in __new__(cls, *args, **options)
   1054 
   1055         if options.pop('evaluate', True):
-> 1056             r = cls.eval(*args, **options)
   1057         else:
   1058             r = None

~/CODES/PYCCEL/sympde/sympde/expr/evaluation.py in eval(cls, *_args, **kwargs)
   1151 
   1152             # ... # TODO improve
-> 1153             terminal_expr = TerminalExpr(expr, domain)[0]
   1154             # ...
   1155 

~/CODES/PYCCEL/sympde/sympde/expr/evaluation.py in __new__(cls, expr, domain, **options)
    496 
    497         if options.pop('evaluate', True):
--> 498             r = cls.eval(expr, domain)
    499         else:
    500             r = None

~/.local/lib/python3.8/site-packages/sympy/core/cache.py in wrapper(*args, **kwargs)
     92             def wrapper(*args, **kwargs):
     93                 try:
---> 94                     retval = cfunc(*args, **kwargs)
     95                 except TypeError:
     96                     retval = func(*args, **kwargs)

~/CODES/PYCCEL/sympde/sympde/expr/evaluation.py in eval(cls, expr, domain)
    525         """."""
    526 
--> 527         dim = domain.dim
    528         if isinstance(expr, Add):
    529             args = [cls.eval(a, domain=domain) for a in expr.args]

AttributeError: 'NoneType' object has no attribute 'dim'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.