fixed offset being way off
This commit is contained in:
parent
1573de227c
commit
00ea574448
1 changed files with 4 additions and 2 deletions
|
@ -33,19 +33,21 @@ fn large_random_file_generation(path: String) {
|
|||
|
||||
fn _large_random_file_generation_helper(i: &u64, out: Arc<Mutex<Result<File, Error>>>) {
|
||||
let mut rng = XorShiftRng::seed_from_u64(2484345508);
|
||||
let block_size = 1310720;
|
||||
// NOTE: update this both here and in `large_random_file_generation()`
|
||||
let num_threads = 12;
|
||||
let mut data = [0u8; 1310720];
|
||||
let block_size = 1310720;
|
||||
|
||||
// enter desired size in bytes, must be a multiple of 655360
|
||||
// this is not a typo, the extra zero after 65536is for the threads
|
||||
// 26843545600 = 25 GiB
|
||||
let blocks_per_thread: u64 = 26843545600 / (block_size * num_threads);
|
||||
println!("{}", i);
|
||||
for u in (i * blocks_per_thread)..((i + 1) * blocks_per_thread) {
|
||||
rng.fill_bytes(&mut data);
|
||||
|
||||
let offset: u64 = (i * blocks_per_thread * 1310720) + (1310720 * u);
|
||||
//let offset: u64 = (i * blocks_per_thread * 1310720) + (1310720 * u);
|
||||
let offset: u64 = u * block_size;
|
||||
let mut out = out.lock().unwrap();
|
||||
out.as_mut().unwrap().write_all_at(&data, offset);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue