2.11. Optimization (Task)

The following sections describe task optimization options.

2.11.1. -h taskn (CC, cc Commands)

Default option: 

-h task0

The -h taskn option specifies the level of automatic tasking (Autotasking) to be performed. Tasking allows segments of code to execute in parallel on multiple processors. This option has no effect on tasking directives. Tasking and tasking directives are described in Section 4.8.

Note: The -h taskn option is accepted and ignored on UNICOS/mk systems.

Argument n can be one of the following:

n 

Description

0 

No Autotasking.

1 

Conservative Autotasking. Same as task0 in this release.

2 

Moderate Autotasking. Same as task0 in this release.

3 

Aggressive Autotasking. This includes loop restructuring for improved tasking performance. Aliasing assumptions specified in the standard are also used; for example, it is assumed that no aliasing will occur between two pointers to different structure types.

Autotasking is disabled when -h nostack is specified.

2.11.2. -h taskprivate (cc Command)

This option gives task private status to all statically-allocated objects in the program. It has no effect if -h nostack is specified.

Unlike -h taskcommon, initialized objects can be made private to each task with the -h taskprivate option. They are initialized at startup for each task prior to the execution of the main entry point.

For information on tasking and tasking directives, see Section 4.8.

2.11.3. -h taskcommon, -h common (CCcc commands)

Default option: 

-h common

The -h taskcommon option gives task common status to all statically-allocated objects in the program. It has no effect if -h nostack is specified. The -h common option gives common (as opposed to taskcommon) status to all global objects in the program. Tasking and tasking directives are described in Section 4.8.

Objects that are initialized will not be marked as task common. The -h taskprivate option can be used to make these objects private to each task and be initialized at startup for each task prior to the execution of the main entry point.

2.11.4. -h [no]taskinner (CC, cc Commands)

Default option: 

-h notaskinner

(UNICOS systems) Autotasking attempts to maximize the amount of parallel work in a taskable loop by interchanging the loop outwards. Sometimes this fails and a taskable loop remains innermost. By default, such a remaining innermost and taskable loop will not task if, at compile time, sufficient parallel work cannot be found. The -h taskinner option enables tasking of the innermost loop with a run-time threshold check to ensure that there is sufficient parallel work in the loop. Aggressive Autotasking (-h task3) must also be specified for this option to take effect.

2.11.5. -h [no]threshold (CC, cc Commands)

Default option: 

-h threshold

(UNICOS systems) The -h [no]threshold option enables or disables generation of run-time threshold testing for autotasked loops. Aggressive Autotasking (-h task3) must also be specified for this option to take effect.