diff --git a/stim/envi/binary.h b/stim/envi/binary.h index 13c9422..2540b4a 100644 --- a/stim/envi/binary.h +++ b/stim/envi/binary.h @@ -54,7 +54,7 @@ protected: public: //constructor initializes a stream optimizer - stream_optimizer(size_t min_batch_size, size_t max_batch_size, double a = 0.0001, size_t window = 1000){ + stream_optimizer(size_t min_batch_size, size_t max_batch_size, double a = 0.001, double probe_step = 5, size_t window = 2000){ //Bps = 0; //initialize to zero bytes per second processed Bps[0] = Bps[1] = 0; //initialize the bits per second to 0 interval_B = 0; //zero bytes have been processed at initialization @@ -62,7 +62,7 @@ public: dn = min_batch_size; //set the minimum batch size as the minimum change in batch size maxn = max_batch_size; //set the maximum batch size n[0] = max_batch_size; //set B - h = (max_batch_size / min_batch_size) / 10 * dn; + h = (max_batch_size / min_batch_size) / probe_step * dn; std::cout<<"h = "<::buffer_size/(double)1000000<<" MB"< Y()) N[b] = Y() - y_load; //if the next batch would process more than the total slices, adjust the batch size rthread = std::async(std::launch::async, &stim::bsq::readlines, this, src[b], y_load, N[b]); - rt_total += rthread.get(); + //rt_total += rthread.get(); y_load += N[b]; //increment the number of loaded slices } @@ -461,7 +461,7 @@ public: t_end = std::chrono::high_resolution_clock::now(); t_batch = std::chrono::duration_cast(t_end-t_start).count(); t_total += t_batch; - //if(y_load < Y()) rt_total += rthread.get(); //if a new batch was set to load, make sure it loads after calculations + if(y_load < Y()) rt_total += rthread.get(); //if a new batch was set to load, make sure it loads after calculations N[b] = O.update(N[!b] * slice_bytes, t_batch, data_rate); //set the batch size based on optimization //std::cout<<"New N = "<