<commit_before># Code generation for fast inversion
This is meant to be a plugin for [this project](https://github.com/opesci/inversion) to be able to generate C code for the long-running sections of the inversion workflow. While it might be branched off as a self-sufficient project in the future, for now it is meant to work only within this inversion workflow. 

The intended workflow so far is to symlink this repo as a subdirectory inside the inversion directory.
## Quickstart
1. Add the inversion outer loop python directory to PYTHONPATH
```
cd $INVERSION_OUTER_LOOP_HOME
export PYTHONPATH=$PYTHONPATH:$PWD/python
```
2. Run benchmark
```
cd $CODEGEN_HOME
python benchmark.py
```<commit_msg>README: Updating general description, examples and compiler toolchains<commit_after># Devito: Fast Finite Difference Computation

Devito is a new tool for performing optimised Finite Difference (FD)
computation from high-level symbolic problem definitions. Devito
performs automated code generation and Just-In-time (JIT) compilation
based on symbolic equations defined in
[SymPy](http://www.sympy.org/en/index.html) to create and execute
highly optimised Finite Difference kernels on multiple computer
platforms.

Devito is also intended to provide the driving operator kernels for a
prototype Full Waveform Inversion (FWI) code that can be found
[here](https://github.com/opesci/inversion).

## Quickstart

Devito should be installed directly from github via:
```
git clone https://github.com/opesci/devito.git
cd devito && pip install --user -r requirements.txt
```
Please make sure you also add Devito to your `PYTHONPATH`.

## Examples

At the core of the Devito API are so-called `Operator` objects that
allow users to create efficient FD kernels from SymPy expressions.
Examples of how to configure operators are provided:

* A simple example of how to solve the 2D diffusion equation can be
  found in `tests/test_diffusion.py`. This example also demonstrates
  how the equation can be solved via pure Python and optimised
  `numpy`, as well as Devito.
* A more practical example of Forward, Adjoint, Gradient and Born
  operators for use in FWI can be found in
  `examples/acoustic_example.py` and `examples/fwi_operators.py`.

## Compilation

Devito's JIT compiler engine supports multiple backends, with provided
presets for the most common compiler toolchains. By default Devito
will use the default GNU compiler `g++`, but other toolchains may be
selected by setting the `DEVITO_ARCH` environment variable to one of
the following values:
 * `gcc` or `gnu` - Standard GNU compiler toolchain
 * `clang` or `osx` - Mac OSX compiler toolchain via `clang`
 * `intel` or `icpc` - Intel compiler toolchain via `icpc`
 * `intel-mic` or `mic` - Intel Xeon Phi using offload mode via the
   `pymic` package

Please note that the toolchain can also be set from within Python
by setting the `compiler` argument on `Operator` objects:
```
op = Operator(..., compiler=IntelCompiler)
```

Thread parallel execution via OpenMP can also be enabled by setting
`DEVITO_OPENMP=1`.
{'fraction_non_alphanumeric': 0.06705729166666667, 'fraction_numerical': 0.0013020833333333333, 'mean_word_length': 4.809073724007561, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 3, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1233870', 'n_tokens_mistral': 867, 'n_tokens_neox': 821, 'n_words': 412}