Skip to content

Commit

Permalink
Fixing exhaustive search when the best setting is the last setting te…
Browse files Browse the repository at this point in the history
…sted.
  • Loading branch information
khuck committed Aug 27, 2024
1 parent 314bb8d commit 3b62949
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/apex/apex_policies.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,13 @@ int apex_exhaustive_policy(shared_ptr<apex_tuning_session> tuning_session,
// the context data is a pointer to a boolean value
force = *((bool*)(context.data));
}

// get a measurement of our current setting - before we check for convergence!
double new_value = tuning_session->metric_of_interest();

if (tuning_session->exhaustive_session.converged() && force) {
/* Report the performance we've just measured. */
tuning_session->exhaustive_session.evaluate(new_value);
if (!tuning_session->converged_message) {
tuning_session->converged_message = true;
cout << "APEX: Tuning has converged for session " << tuning_session->id
Expand All @@ -974,9 +980,6 @@ int apex_exhaustive_policy(shared_ptr<apex_tuning_session> tuning_session,
return APEX_NOERROR;
}

// get a measurement of our current setting
double new_value = tuning_session->metric_of_interest();

/* Report the performance we've just measured. */
tuning_session->exhaustive_session.evaluate(new_value);

Expand Down

0 comments on commit 3b62949

Please sign in to comment.