Skip to content

Commit

Permalink
Change to read in batch of 5
Browse files Browse the repository at this point in the history
  • Loading branch information
Suryansh Gupta committed Jan 29, 2025
1 parent 15b7357 commit fe76ff1
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions apps/benchmark_reads.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,14 @@ void do_multiple_reads_with_threads(int thread_count)
string file_name = "F:\\indices\\turing_10m\\disk_index_disk.index";
auto reader = new WindowsAlignedFileReader();
reader->open(file_name.c_str());
int batches_of = 100;
int total_reads = 1000000;
int batches_of = 5;

vector<char *> buffers(thread_count);

omp_set_num_threads(thread_count);
// omp_set_num_threads(thread_count);

#pragma omp parallel for num_threads((int)thread_count)
// #pragma omp parallel for num_threads((int)thread_count)
for (int i = 0; i < thread_count; i++)
{
char *buf = nullptr;
Expand All @@ -53,9 +54,9 @@ void do_multiple_reads_with_threads(int thread_count)
reader->register_thread();
}

int no_of_reads = 10000;
int no_of_reads = total_reads / batches_of;
Timer timer;
#pragma omp parallel for schedule(dynamic, 1)
// #pragma omp parallel for schedule(dynamic, 1)
for (int i = 0; i < no_of_reads; i++)
{
char *buf = buffers[omp_get_thread_num()];
Expand Down

0 comments on commit fe76ff1

Please sign in to comment.