Skip to content

Commit 02f728c

Browse files
Merge pull request #1854 from OceanParcels/docs_drop_jit
Documentation page on rationale for dropping JIT in Parcels v4
2 parents d9af80b + 5e52712 commit 02f728c

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

docs/v4/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ Collaboration on v4 development is happening on the [Parcels v4 Project Board](h
99
```{toctree}
1010
1111
api
12+
nojit
1213
Parcels v4 Project Board <https://github.com/orgs/OceanParcels/projects/5>
1314
```

docs/v4/nojit.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Rationale for dropping JIT support in v4
2+
3+
Parcels v4 will not support Just-In-Time (JIT) compilation. This means that the `JITParticle` class will be removed from the codebase. This decision was made for the following reasons:
4+
5+
1. We want to leverage the power of `xarray` and `uxarray` for data handling and interpolation. These libraries are not compatible with the JIT compilation in v3.
6+
2. We want to make the codebase more maintainable and easier to understand. The JIT compilation pre-v4 adds complexity to the codebase and makes it harder to debug and maintain.
7+
3. We have quite a few features in Parcels (also v3) that only work in Scipy mode (particle-particle interaction, particle-field interaction, etc.).
8+
4. We want users to write more flexible/complex kernels. JIT doesn't support calling functions, or using methods from `numpy` or `scipy`, while this is possible in Scipy mode.
9+
10+
Essentially, the only advantage of JIT was its speed. But now that the ecosystem for just-in-time compilation with python has matured in the last 10 years, we want to leverage other packages and methods (`cython`, `numba`, `jax`?) and Python internals for speed-up.
11+
12+
Furthermore, we think we have some good ideas how to speed up Parcels itself without JIT compilation, such as relying more on vectorized operations.
13+
14+
In short, we think that the disadvantages of JIT in Parcels v3 outweigh the advantages, and we want to make Parcels v4 a more modern and maintainable codebase.
15+
16+
In our development of v4, we will first focus on making the codebase more modular and easier to extend. Once we have a working codebase, we will release this as `v4-alpha`. After that, we will start working on performance improvements.

0 commit comments

Comments
 (0)