Skip to content

Commit

Permalink
Fix #239: user may request metrics to be tracked when manually using …
Browse files Browse the repository at this point in the history
…irace, with autoconfig disabled
  • Loading branch information
rmartinsanta committed May 14, 2024
1 parent 8ea73c0 commit 4243d82
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -308,14 +308,20 @@ public List<ExecuteResponse> iraceMultiCallback(List<IraceExecuteConfig> configs
private ExecuteResponse singleExecution(Algorithm<S, I> algorithm, I instance) {
long maxExecTime = solverConfig.getIgnoreInitialMillis() + solverConfig.getIntervalDurationMillis();
if (isAutoconfigEnabled) {
// Autoconfig requires metrics to be enabled to track algorithm performance
Metrics.enableMetrics();
Metrics.resetMetrics();
TimeControl.setMaxExecutionTime(maxExecTime, TimeUnit.MILLISECONDS);
TimeControl.start();
}

long startTime = System.nanoTime();
if(Metrics.areMetricsEnabled()){
// If metrics are enabled, reset them before each execution
// This is independent of the autoconfig configuration because users
// may request metrics to be enabled when manually running Irace
Metrics.resetMetrics();
}

long startTime = System.nanoTime();
var solution = algorithm.algorithm(instance);
long endTime = System.nanoTime();

Expand Down

0 comments on commit 4243d82

Please sign in to comment.