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:
@@ -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
|
||||
|
@@ -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))
|
||||
}
|
||||
|
Reference in New Issue
Block a user