Crates.io | mcl-rs |
lib.rs | mcl-rs |
version | 0.2.0 |
source | src |
created_at | 2022-04-02 07:02:43.222876 |
updated_at | 2023-06-23 03:23:36.14537 |
description | This system crate provides high-level rust language bindings to the Minos Compute Library (MCL) |
homepage | |
repository | https://github.com/pnnl/mcl |
max_upload_size | |
id | 560724 |
size | 6,977,044 |
This project hosts the high-level wrappers of the MCL rust bindings.
This crate provides high-level, rust-friendly bindings for MCL. The purpose of these bindings are to expose a user-friendlier (and safer) API to what the low-level libmcl-sys API offers. It provides wrappers for most mcl public functions and tries to provide safety at compilation type, however, because of the nature of the library counting on a C project there are cases that it's only possible to catch errors at runtime, as well as a few APIS that currently cannot be checked at all and are thus marked unsafe (but are protected by a feature flag).
libmcl-sys and its dependencies
cargo install mcl_sched
)Other crates listed in Cargo.toml
mcl-rs depends on the crate libmcl-sys which provides the low-level bindings between the C library of MCL and these higher bindings.
libmcl-sys
makes use of clang to generate the low-level rust binding from the MCL
header file, so if clang is not available it must be installed to the system.
Once all dependencies have been taken care of, we can build mcl-rs.
cargo build --release
The MCL scheduler can easily be installed via:
cargo install mcl_sched
Note, if you have manually built MCL from the C source code, you will already have the mcl_sched
binary in the MCL install directory.
You are free to use either your manually built mcl_sched or the one installed via cargo
We re expose three feauture flags (from libmcl-rs), losely corresponding to configuration options of the underlying MCL c-library
mcl-rs comes with a set of unit tests that can be executed with:
cargo test <test_name>
Reminder: The MCL scheduler should be running when executing the tests. if you installed mcl_sched via cargo then you should be able to invoke directly:
mcl_sched
If you built mcl manually you may need to specify the path to the mcl_sched binary
Removing the test-name would cause cargo to run all available tests, however, this could create issues since tests would run in parallel causing multiple threads to try to acquire access to the mcl_scheduler shmem object at the same time which might lead to failure.
Use cargo doc --open
to build and open the documentation of this crate.
MCL, libmcl-sys, and mcl-rs are research prototypes and still under development, thus not all intended features are yet implemented.
Please, contact Roberto Gioiosa at PNNL (roberto.gioiosa@pnnl.gov) if you have any MCL questions. For Rust related questions please contact Ryan Friese at PNNL (ryan.friese@pnnl.gov)
Roberto Gioiosa
Ryan Friese
Polykarpos Thomadakis
This project is licensed under the BSD License - see the LICENSE file for details.
IF you wish to cite MCL, please, use the following reference:
Other work that leverage or describe additional MCL features: