OMP Single Output

Output from four different runs are shown below. The OMP SINGLE statement implies that the first thread to hit the statement executes the block of code within the scope of the statement. In the first run, thread 0 got to the statement first. In the second and third runs, thread 1 got to the statement first. In the fourth run, thread 3 got to the statement first. In your own runs, the sequence may be different.

 

0 YOU SHOULD ONLY SEE THIS ONCE

 

1 YOU SHOULD ONLY SEE THIS ONCE

 

1 YOU SHOULD ONLY SEE THIS ONCE

 

3 YOU SHOULD ONLY SEE THIS ONCE