Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove nested parallel, run multi-thread without omp env #9

Closed
wants to merge 7 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ void benchmark_t::run() noexcept

float elapsed = 0.0;
stopwatch_t sw;
omp_set_nested(true);
#pragma omp parallel sections num_threads(2)
{
#pragma omp section // Monitor thread
Expand Down Expand Up @@ -152,9 +153,6 @@ void benchmark_t::run() noexcept
// Generate random scrambled key
auto key_ptr = key_generator_->next(op == operation_t::INSERT ? true : false);

// Generate random value
auto value_ptr = value_generator_.next();

switch (op)
{
case operation_t::READ:
Expand All @@ -165,12 +163,16 @@ void benchmark_t::run() noexcept

case operation_t::INSERT:
{
// Generate random value
auto value_ptr = value_generator_.next();
auto r = tree_->insert(key_ptr, key_generator_->size(), value_ptr, opt_.value_size);
break;
}

case operation_t::UPDATE:
{
// Generate random value
auto value_ptr = value_generator_.next();
auto r = tree_->update(key_ptr, key_generator_->size(), value_ptr, opt_.value_size);
break;
}
Expand Down Expand Up @@ -206,6 +208,7 @@ void benchmark_t::run() noexcept
}
}

omp_set_nested(false);
std::unique_ptr<SystemCounterState> after_sstate;
if (opt_.enable_pcm)
{
Expand Down