Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
Parallel Programming Guide for HP-UX Systems > Chapter 6 Parallel optimization features

Preventing parallelization

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

You can prevent parallelization on a loop-by-loop basis using the no_parallel directive or pragma. The form of this directive and pragma is shown in Table 6-4 “Form of no_parallel directive and pragma”.

Table 6-4 Form of no_parallel directive and pragma

LanguageForm
Fortran

C$DIR NO_PARALLEL

C

#pragma _CNX no_parallel

 

Use these directives to prevent parallelization of the loop that immediately follows them. Only parallelization is inhibited; all other loop optimizations are still applied.

Example 6-8 no_parallel

The following Fortran example illustrates the use of no_parallel:

      DO I = 1, 1000
C$DIR NO_PARALLEL
DO J = 1, 1000
A(I,J) = B(I,J)
ENDDO
ENDDO

In this example, parallelization of the J loop is prevented. The I loop can still be parallelized.

The +Onoautopar compiler option is available to disable automatic parallelization but allows parallelization of directive-specified loops. Refer to Chapter 7 “Controlling optimization”, and Chapter 9 “Parallel programming techniques”, for more information on +Onoautopar.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.