Python bindings for Cimba, a multithreaded discrete-event-simulation C library
Project description
Cimba Python
Fast discrete event simulation for Python
Cimba Python is a Python interface to Cimba, a multithreaded discrete event simulation engine written in C and assembly.
It is designed for Python simulation models that need more speed than pure Python event scheduling can usually provide. In the included M/M/1 benchmark, Cimba Python runs about 8.5-8.9x faster than SimPy, while keeping model code in Python.
On an AMD Ryzen 7 9700X under WSL Ubuntu 24.04, averaged over 10 runs:
| Benchmark | SimPy | Cimba Python | Cimba C |
|---|---|---|---|
| Single core, single trial | 3.185 s | 0.375 s | 0.095 s |
| Multicore, 100 trials | 41.820 s | 4.698 s | 1.178 s |
The benchmark data and charts are in
benchmarks/AMD_Ryzen_7_9700X_WSL.ods.
Install
pip install cimba
or with uv:
uv add cimba
Python 3.13 or newer is required. The PyPI wheels embed the Cimba C library, so you do not need to install Cimba separately.
What is it?
Cimba Python gives Python models access to Cimba's native simulation engine: processes, event queues, buffers, object queues, priority queues, resources, conditions, random distributions, time series, and summary statistics.
What does the code look like?
import cimba
def arrival(queue):
while True:
cimba.hold(cimba.exponential(1.0 / 0.75))
queue.put(1)
def service(queue):
while True:
queue.get(1)
cimba.hold(cimba.exponential(1.0))
with cimba.Simulation(seed=123) as sim:
queue = cimba.Buffer("Queue")
queue.start_recording()
cimba.Process("Arrival", arrival, queue).start()
cimba.Process("Service", service, queue).start()
sim.stop_at(1000.0)
sim.execute()
queue.stop_recording()
print(queue.history().summary().mean)
More examples, tutorials, topical guides, and the API reference are in the documentation.
License
Cimba Python is licensed under Apache-2.0. See LICENSE and
NOTICE.
The bundled Cimba C library is also Apache-2.0 licensed. See
subprojects/cimba/NOTICE for attribution.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cimba-0.2.1.tar.gz.
File metadata
- Download URL: cimba-0.2.1.tar.gz
- Upload date:
- Size: 6.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cad09e4edfe63b400c3a2280e536568899daa3fd6d3dba883021fe35ad2ea4d1
|
|
| MD5 |
08ddfe86f003fe0eb22c060f95606d40
|
|
| BLAKE2b-256 |
a7b28da85da7d0bfb001fb1376b8a2680585e0c26f7d779d9140ddfd1c3adfc2
|
Provenance
The following attestation bundles were made for cimba-0.2.1.tar.gz:
Publisher:
release.yml on FBarrca/cimba_python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cimba-0.2.1.tar.gz -
Subject digest:
cad09e4edfe63b400c3a2280e536568899daa3fd6d3dba883021fe35ad2ea4d1 - Sigstore transparency entry: 1630694037
- Sigstore integration time:
-
Permalink:
FBarrca/cimba_python@2b7e8ba491b69f301880191a2f81c1958d96c787 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/FBarrca
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2b7e8ba491b69f301880191a2f81c1958d96c787 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cimba-0.2.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: cimba-0.2.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 403.7 kB
- Tags: CPython 3.14t, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea359b775cb9e0844532e67e16acff0f3bf3e2f585352629bd48a0af6e776718
|
|
| MD5 |
4b369fc47c38835949671dfd34a9bfd6
|
|
| BLAKE2b-256 |
c7026aeb8e643279840ffd2d319974c943076a8eb47bd33148d36c404140ae67
|
Provenance
The following attestation bundles were made for cimba-0.2.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
release.yml on FBarrca/cimba_python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cimba-0.2.1-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
ea359b775cb9e0844532e67e16acff0f3bf3e2f585352629bd48a0af6e776718 - Sigstore transparency entry: 1630694055
- Sigstore integration time:
-
Permalink:
FBarrca/cimba_python@2b7e8ba491b69f301880191a2f81c1958d96c787 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/FBarrca
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2b7e8ba491b69f301880191a2f81c1958d96c787 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cimba-0.2.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: cimba-0.2.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 418.9 kB
- Tags: CPython 3.14, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c1b7fd270420db21757e836576783cede9a043e92d07985131fd0459633be775
|
|
| MD5 |
498f6353307a405484b7e5534b07bac0
|
|
| BLAKE2b-256 |
e8cf352b40b12aa8ec245c18966ccccd40f11ec887302d90a9f95f470da4e46c
|
Provenance
The following attestation bundles were made for cimba-0.2.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
release.yml on FBarrca/cimba_python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cimba-0.2.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
c1b7fd270420db21757e836576783cede9a043e92d07985131fd0459633be775 - Sigstore transparency entry: 1630694050
- Sigstore integration time:
-
Permalink:
FBarrca/cimba_python@2b7e8ba491b69f301880191a2f81c1958d96c787 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/FBarrca
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2b7e8ba491b69f301880191a2f81c1958d96c787 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cimba-0.2.1-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: cimba-0.2.1-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 402.1 kB
- Tags: CPython 3.13t, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
974793eb0d1e940d52c397f4895eb8217f1c85c9440321f9bc7508149c6d0bd9
|
|
| MD5 |
df29960ab74c8e71db36c6daa74d55bd
|
|
| BLAKE2b-256 |
c44f3ffd0af3fcd451fbd62a88d9ce4e7f4c86ca0b9e1ae42a7cb4718fc254cd
|
Provenance
The following attestation bundles were made for cimba-0.2.1-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
release.yml on FBarrca/cimba_python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cimba-0.2.1-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
974793eb0d1e940d52c397f4895eb8217f1c85c9440321f9bc7508149c6d0bd9 - Sigstore transparency entry: 1630694061
- Sigstore integration time:
-
Permalink:
FBarrca/cimba_python@2b7e8ba491b69f301880191a2f81c1958d96c787 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/FBarrca
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2b7e8ba491b69f301880191a2f81c1958d96c787 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cimba-0.2.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: cimba-0.2.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 415.9 kB
- Tags: CPython 3.13, manylinux: glibc 2.17+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3cb6af8cbcf833e24745eb4ea3d44a5b1338ee7dcc38636a42f5850734581fdb
|
|
| MD5 |
12e898b7a75e6f3148ed2d03fafc3688
|
|
| BLAKE2b-256 |
47ade6e93b30ee00a4d6637fa02a7f639117e0972995e0df9b70a1500c6be112
|
Provenance
The following attestation bundles were made for cimba-0.2.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
release.yml on FBarrca/cimba_python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cimba-0.2.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
3cb6af8cbcf833e24745eb4ea3d44a5b1338ee7dcc38636a42f5850734581fdb - Sigstore transparency entry: 1630694041
- Sigstore integration time:
-
Permalink:
FBarrca/cimba_python@2b7e8ba491b69f301880191a2f81c1958d96c787 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/FBarrca
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@2b7e8ba491b69f301880191a2f81c1958d96c787 -
Trigger Event:
push
-
Statement type: