# par-threshold, Qpar-threshold

Sets a threshold for the auto-parallelization of loops.

## Syntax

Linux: | -par-threshold[n]

macOS: | -par-threshold[n]

Windows: | /Qpar-threshold[[:]n]

## Arguments

n | Is an integer whose value is the threshold for the auto-parallelization of loops. Possible values are 0 through 100. If n is 0, loops get auto-parallelized always, regardless of computation work volume. If n is 100, loops get auto-parallelized when performance gains are predicted based on the compiler analysis data. Loops get auto-parallelized only if profitable parallel execution is almost certain. The intermediate 1 to 99 values represent the percentage probability for profitable speed-up. For example, n=50 directs the compiler to parallelize only if there is a 50% probability of the code speeding up if executed in parallel.

## Default

-par-threshold100 or /Qpar-threshold100 | Loops get auto-parallelized only if profitable parallel execution is almost certain. This is also the default if you do not specify n.

## Description

This option sets a threshold for the auto-parallelization of loops based on the probability of profitable execution of the loop in parallel. To use this option, you must also specify option [Q]parallel.

This option is useful for loops whose computation work volume cannot be determined at compile-time. The threshold is usually relevant when the loop trip count is unknown at compile-time.

The compiler applies a heuristic that tries to balance the overhead of creating multiple threads versus the amount of work available to be shared amongst the threads.

### Note

This option may behave differently on Intel® microprocessors than on non-Intel microprocessors.

## IDE Equivalent

Visual Studio: None

Eclipse: Optimization > Auto-Parallelization Threshold

Xcode: Optimization > Auto-Parallelization Threshold

## Alternate Options

None

Parent topic: OpenMP* Options and Parallel Processing Options