Switch erasure to solana-reed-solomon-erasure (#5913)

* Switch to solana-reed-solomon-erasure

* Disable Rayon for solana-reed-solomon-erasure
This commit is contained in:
Sagar Dhawan
2019-09-16 16:14:55 -07:00
committed by GitHub
parent bc2141fbe0
commit 82615c703b
3 changed files with 19 additions and 18 deletions

View File

@@ -80,9 +80,9 @@ solana-rayon-threadlimit = { path = "../rayon-threadlimit", version = "0.19.0-pr
# reed-solomon-erasure's simd_c feature fails to build for x86_64-pc-windows-msvc, use pure-rust
[target.'cfg(windows)'.dependencies]
reed-solomon-erasure = { version = "3.1.1", features = ["pure-rust"] }
reed-solomon-erasure = { package = "solana-reed-solomon-erasure", version = "3.1.1", features = ["pure-rust"] }
[target.'cfg(not(windows))'.dependencies]
reed-solomon-erasure = "3.1.1"
reed-solomon-erasure = { package = "solana-reed-solomon-erasure", version = "3.1.1" }
[dependencies.rocksdb]
# Avoid the vendored bzip2 within rocksdb-sys that can cause linker conflicts

View File

@@ -41,7 +41,7 @@
//!
//!
use reed_solomon_erasure::ReedSolomon;
use reed_solomon_erasure::{ParallelParam, ReedSolomon};
//TODO(sakridge) pick these values
/// Number of data blobs
@@ -90,13 +90,14 @@ pub struct Session(ReedSolomon);
impl Session {
pub fn new(data_count: usize, coding_count: usize) -> Result<Session> {
let rs = ReedSolomon::new(data_count, coding_count)?;
let rs = ReedSolomon::with_pparam(data_count, coding_count, ParallelParam::Disabled)?;
Ok(Session(rs))
}
pub fn new_from_config(config: &ErasureConfig) -> Result<Session> {
let rs = ReedSolomon::new(config.num_data, config.num_coding)?;
let rs =
ReedSolomon::with_pparam(config.num_data, config.num_coding, ParallelParam::Disabled)?;
Ok(Session(rs))
}