Skip to content

Commit

Permalink
prepare merge of Wilhelm impl
Browse files Browse the repository at this point in the history
  • Loading branch information
Ignalina committed May 9, 2024
1 parent 5848af3 commit f3f147a
Show file tree
Hide file tree
Showing 10 changed files with 492 additions and 190 deletions.
7 changes: 2 additions & 5 deletions src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ impl ColumnBuilder for BooleanColumnBuilder {
Err(e) => {
warn!("Could not convert utf-8 text to bool: {:?}", e);
self.inner.append_null();
},
}
};
}

Expand All @@ -82,10 +82,7 @@ impl ColumnBuilder for BooleanColumnBuilder {

///
fn finish(&mut self) -> (&str, ArrayRef) {
(
&self.name,
Arc::new(self.inner.finish()) as ArrayRef,
)
(&self.name, Arc::new(self.inner.finish()) as ArrayRef)
}
}

Expand Down
9 changes: 6 additions & 3 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ use crate::converters::arrow_converter::{MasterBuilders, Slice2Arrow};
use crate::converters::self_converter::SampleSliceAggregator;
use crate::converters::Converter;
use crate::dump::dump;
use crate::slicers::old_slicer::{OldSlicer, IN_MAX_CHUNKS};
use crate::slicers::old_slicer::{OldSlicer, IN_MAX_CHUNKS, SLICER_IN_CHUNK_SIZE};

Check warning on line 37 in src/cli.rs

View workflow job for this annotation

GitHub Actions / Cargo check (ubuntu-latest, stable)

unused imports: `IN_MAX_CHUNKS`, `SLICER_IN_CHUNK_SIZE`

Check warning on line 37 in src/cli.rs

View workflow job for this annotation

GitHub Actions / Cargo check (ubuntu-latest, nightly)

unused imports: `IN_MAX_CHUNKS`, `SLICER_IN_CHUNK_SIZE`

Check warning on line 37 in src/cli.rs

View workflow job for this annotation

GitHub Actions / Cargo check (macos-latest, stable)

unused imports: `IN_MAX_CHUNKS`, `SLICER_IN_CHUNK_SIZE`

Check warning on line 37 in src/cli.rs

View workflow job for this annotation

GitHub Actions / Cargo check (macos-latest, nightly)

unused imports: `IN_MAX_CHUNKS`, `SLICER_IN_CHUNK_SIZE`

Check warning on line 37 in src/cli.rs

View workflow job for this annotation

GitHub Actions / Cargo check (windows-latest, stable)

unused imports: `IN_MAX_CHUNKS`, `SLICER_IN_CHUNK_SIZE`

Check warning on line 37 in src/cli.rs

View workflow job for this annotation

GitHub Actions / Cargo check (windows-latest, nightly)

unused imports: `IN_MAX_CHUNKS`, `SLICER_IN_CHUNK_SIZE`
use crate::slicers::Slicer;
use crate::slicers::{find_last_nl, line_break_len_cr, ChunkAndResidue};

Check warning on line 39 in src/cli.rs

View workflow job for this annotation

GitHub Actions / Cargo check (ubuntu-latest, stable)

unused import: `ChunkAndResidue`

Check warning on line 39 in src/cli.rs

View workflow job for this annotation

GitHub Actions / Cargo check (ubuntu-latest, nightly)

unused import: `ChunkAndResidue`

Check warning on line 39 in src/cli.rs

View workflow job for this annotation

GitHub Actions / Cargo check (macos-latest, stable)

unused import: `ChunkAndResidue`

Check warning on line 39 in src/cli.rs

View workflow job for this annotation

GitHub Actions / Cargo check (macos-latest, nightly)

unused import: `ChunkAndResidue`

Check warning on line 39 in src/cli.rs

View workflow job for this annotation

GitHub Actions / Cargo check (windows-latest, stable)

unused import: `ChunkAndResidue`

Check warning on line 39 in src/cli.rs

View workflow job for this annotation

GitHub Actions / Cargo check (windows-latest, nightly)

unused import: `ChunkAndResidue`
use crate::{error, mocker, schema};

Check warning on line 40 in src/cli.rs

View workflow job for this annotation

GitHub Actions / Cargo check (ubuntu-latest, stable)

unused imports: `error`, `mocker`, `schema`

Check warning on line 40 in src/cli.rs

View workflow job for this annotation

GitHub Actions / Cargo check (ubuntu-latest, nightly)

unused imports: `error`, `mocker`, `schema`

Check warning on line 40 in src/cli.rs

View workflow job for this annotation

GitHub Actions / Cargo check (macos-latest, stable)

unused imports: `error`, `mocker`, `schema`

Check warning on line 40 in src/cli.rs

View workflow job for this annotation

GitHub Actions / Cargo check (macos-latest, nightly)

unused imports: `error`, `mocker`, `schema`

Check warning on line 40 in src/cli.rs

View workflow job for this annotation

GitHub Actions / Cargo check (windows-latest, stable)

unused imports: `error`, `mocker`, `schema`

Check warning on line 40 in src/cli.rs

View workflow job for this annotation

GitHub Actions / Cargo check (windows-latest, nightly)

unused imports: `error`, `mocker`, `schema`
Expand Down Expand Up @@ -140,11 +140,11 @@ enum Commands {
impl Cli {
pub fn run<'a>(
&self,
in_buffers: &mut [ChunkAndResidue; IN_MAX_CHUNKS],
) -> Result<()> {
let n_logical_threads = num_cpus::get();
let mut n_threads: usize = self.n_threads as usize;


if n_threads > n_logical_threads {
info!(
"you specified to use {} thread, but your CPU only has {} logical threads",
Expand All @@ -153,6 +153,8 @@ impl Cli {
n_threads = n_logical_threads;
}

// Effektiv med fixa buffrar men fult att allokeringen ligger här ...känns banalt.

let multithreaded: bool = n_threads > 1;
if multithreaded {
info!("multithreading enabled ({} logical threads)", n_threads);
Expand Down Expand Up @@ -197,6 +199,8 @@ impl Cli {
in_file,
out_file,
}) => {


let _in_file = fs::File::open(&in_file).expect("bbb");

let mut slicer_instance: Box<dyn Slicer> = Box::new(OldSlicer {
Expand Down Expand Up @@ -254,7 +258,6 @@ impl Cli {

let r = slicer_instance.slice_and_convert(
converter_instance,
in_buffers,
_in_file,
n_threads as usize,
);
Expand Down
Loading

0 comments on commit f3f147a

Please sign in to comment.