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
HP-UX Systems: HP aC++/HP C Programmer's Guide > Chapter 2 Command-Line Options

Parallel Processing Options

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

HP aC++ provides the following optimization options for parallel code.

-mt

The -mt option enables multi-threading capability without the need to set any other flags, such as -l and -D. HP aC++ examines your environment and automatically selects and sets the appropriate flags. There are three possible sets of flags depending on your operating system and the libstd you use. Table 2-4 “Option Matrix for -mt” lists the option matrix for -mt.

Table 2-4 Option Matrix for -mt

Libraries

Flags

old-lib

libstd 1.2.1

(-AP)&

librwtool 7.0.x

-D_REENTRANT

-DRW_MULTI_THREAD

-DRWSTD_MULTI_THREAD

-D_THREAD_SAFE

-D_POSIX_C_SOURCE=199506L

-D_HPUX_SOURCE *

-lpthread

new-lib

(-AA)

libstd 2.2.1

-D_REENTRANT

-D_RW_MULTI_THREAD

-D_RWSTD_MULTI_THREAD

-D_POSIX_C_SOURCE=199506L

-D_HPUX_SOURCE *

-lpthread

C mode

-Ae/-Aa

-D_REENTRANT

-D_POSIX_C_SOURCE_199506L

-lpthread

 

* required if -D_POSIX_C_SOURCE is used.

The following macros are used to compile multi-thread source code:

  • _REENTRANT

    Required by system header files that provide reentrant functions (suffixed by _r).

  • RW_MULTI_THREAD / _RW_MULTI_THREAD

    Required by Rogue Wave toolsh++ header files and libraries. RW_MULTI_THREAD is used by toolsh++ 7.0.x. _RW_MULTI_THREAD is used by toolsh++ 8.x (not available yet).

  • RWSTD_MULTI_THREAD / _RWSTD_MULTI_THREAD

    Required by Rogue Wave standard library header files and libraries. RWSTD_MULTI_THREAD is used by libstd 1.2.1. _RWSTD_MULTI_THREAD is used by libstd 2.2.1 when compiling with -AA.

  • _POSIX_C_SOURCE=199506L

    Required by pthread.

  • libpthread.*

    Kernel thread library used on 11.x systems

See “Using Threads” for more information.

+O[no]report

+O[no]report[=report_type]

The +O[no]report option causes the compiler to display[not to display] various optimization reports.

Usage:

The value of report_type determines which report is displayed, as described below:

loop

Produces the Loop Report that gives information on optimizations performed on loops and calls. +Oreport is equivalent to +Oreport=loop.

private

Produces the loop report and privatization table, that provide information on loop variables that are privatized by the compiler.

all

Produces all reports.

The +Onoreport option does not accept any of the report_type values and turns off all reporting. The +Oreport[=report_type] option is active only at optimization levels 3 and above.

The default is +Onoreport.

See Parallel Programming Guide for HP-UX Systems for more information.

NOTE: The +Oinfo option can be used to display additional information on the various optimizations being performed.

+tls=[static|dynamic]

+tls=[static|dynamic]

The +tls option specifies whether references to thread local data items are to be performed according to the mode.

Usage:

+tls=mode

The defined values of mode are:

static

This is a more efficient mode in which only thread local data in the program startup set can be accessed.

dynamic

This is a less efficient mode in which thread local data outside the program startup set can be accessed as well. This is the default.

Translation units compiled with different settings of this option may be freely mixed, even within the same load module.

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