Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
E77790.pdf
Скачиваний:
2
Добавлен:
16.05.2024
Размер:
1.29 Mб
Скачать

3.4 Options Reference

3.4.159 –xopenmp[={parallel|noopt|none}]

Enable explicit parallelization with OpenMP directives.

The flag accepts the following sub-option keywords:

parallel

Enables recognition of OpenMP pragmas. The optimization level under -

 

xopenmp=parallel is -xO3. The compiler raises the optimization level to

 

-xO3 if necessary and issues a warning.

 

This flag also defines the preprocessor macro _OPENMP. The _OPENMP

 

macro is defined to have the decimal value yyyymm where yyyy and mm

 

are the year and month designations of the version of the OpenMP API

 

that the implementation supports. Refer to the Oracle Developer Studio

 

12.6: OpenMP API User’s Guide for the value of the _OPENMP macro for

 

a particular release.

noopt

Enables recognition of OpenMP pragmas. The compiler does not raise

 

the optimization level if it is lower than -xO3. If you explicitly set the

 

optimization lower than -xO3, as in f95 -xO2 -xopenmp=noopt, the

 

compiler issues an error. If you do not specify an optimization level with

 

-xopenmp=noopt, the OpenMP pragmas are recognized, the program is

 

parallelized accordingly, but no optimization is done. This sub-option

 

also defines the preprocessor macro _OPENMP.

none

Does not enable the recognition of OpenMP pragmas, makes no change

 

to the optimization level of your program, and does not define any

 

preprocessor macros. This is the default when -xopenmp is not specified.

If you specify -xopenmp, but do not specify a sub-option keyword, the compiler assumes -xopenmp=parallel. If you do not specify -xopenmp at all, the compiler assumes -

xopenmp=none.

Sub-options parallel and noopt will invoke -stackvar automatically.

If you are debugging an OpenMP program with dbx, compile with -g -xopenmp=noopt so you can breakpoint within parallel regions and display the contents of variables.

The default for -xopenmp might change in a future release. You can avoid warning messages by explicitly specifying an appropriate optimization level.

Use the OMP_NUM_THREADS environment variable to specify the number of threads to use when running an OpenMP program. If OMP_NUM_THREADS is not set, the default number of threads

144 Oracle Developer Studio 12.6: Fortran User's Guide • July 2017

3.4 Options Reference

used is a multiple of the number of cores per socket (that is, cores per processor chip), which is less than or equal to the total number of cores or 32, whichever is less. You can specify a

different number of threads by setting the OMP_NUM_THREADS environment variable, or by calling the omp_set_num_threads() OpenMP runtime routine, or by using the num_threads clause

on the parallel region directive. For best performance, the number of threads used to execute a parallel region should not exceed the number of hardware threads (or virtual processors) available on the machine. On Oracle Solaris systems, this number can be determined by using the psrinfo(1M) command. On Oracle Linux systems, this number can be determined by

inspecting the file /proc/cpuinfo. See the Oracle Developer Studio 12.6: OpenMP API User’s Guide for more information.

Nested parallelism is disabled by default. To enable nested parallelism, you must set the

OMP_NESTED environment variable to TRUE. See the Oracle Developer Studio 12.6: OpenMP API User’s Guide.

If you compile and link in separate steps, specify -xopenmp in both the compilation step and the link step. When used with the link step, the -xopenmp option will link with the OpenMP runtime support library, libmtsk.so.

For up-to-date functionality and performance, make sure that the latest patch of the OpenMP runtime library, libmtsk.so, is installed on the system.

For more information about the OpenMP Fortran 95, C, and C++ application program interface (API) for building multithreaded applications, see the Oracle Developer Studio 12.6: OpenMP API User’s Guide.

3.4.160 –xpad

Synonym for -pad.

3.4.161 –xpagesize=size

Set the preferred page size for the stack and the heap.

On SPARC platforms, the size value must be one of the following:

8K 64K 512K 4M 32M 256M 2G 16G or default

On x86 platforms, the size value must be one of the following:

4K 2M 4M or default

Chapter 3 • Fortran Compiler Options

145

3.4 Options Reference

For example: -xpagesize=4M

Not all these page sizes are supported on all platforms and depend on the architecture and Oracle Solaris environment. The page size specified must be a valid page size for the Oracle Solaris operating environment on the target platform. If it is not, the request will be silently ignored at run-time.

Use the pagesize(1) Oracle Solaris command to determine the number of bytes in a page. The operating system offers no guarantee that the page size request will be honored. However,

appropriate segment alignment can be used to increase the likelihood of obtaining the requested page size. See the -xsegment_align option on how to set the segment alignment. You can use pmap(1) or meminfo(2) to determine page size of the target platform.

If you specify -xpagesize=default, the flag is ignored; -xpagesize specified without a size value is equivalent to -xpagesize=default.

This option is a macro for the combination -xpagesize_heap=size -xpagesize_stack=size. These two options accept the same arguments as -xpagesize. You can set them both with the same value by specifying -xpagesize=size or you can specify them individually with different values.

Compiling with this flag has the same effect as setting the LD_PRELOAD environment variable to mpss.so.1 with the equivalent options, or running the Oracle Solaris command ppgsz(1) with the equivalent options, before starting the program. See the Oracle Solaris man pages for details.

The libhugetlbfs library is required for -xpagesize to work on Oracle Linux. See the Oracle Linux libhugetlbfs(7) man page for more information.

3.4.162 –xpagesize_heap=size

Set the preferred page size for the heap.

The size value is the same as described for -xpagesize.

See -xpagesize for details.

3.4.163 –xpagesize_stack=size

(SPARC) Set the preferred page size for the stack.

146 Oracle Developer Studio 12.6: Fortran User's Guide • July 2017

3.4 Options Reference

The size value is the same as described for -xpagesize.

See -xpagesize for details.

3.4.164 -xpatchpadding[={fix|patch|size}]

Reserve an area of memory before the start of each function. If fix is specified, the compiler will reserve the amount of space required by fix and continue. This is the first default. If either patch or no value is specified, the compiler will reserve a platform-specific default value. A value of -xpatchpadding=0 will reserve 0 bytes of space. The maximum value for size on x86 is 127 bytes and on SPARC is 2048 bytes.

3.4.165 –xpec[={yes|no}]

Generate a PEC (Portable Executable Code) binary.

This option puts the program intermediate representations in the object file and the binary. This binary may be used later for tuning and troubleshooting.

A binary built with -xpec is usually 5 to 10 times larger than if it is built without. The default is

-xpec=no.

Without an argument, -xpec is equivalent to -xpec=yes.

3.4.166 –xpg

Synonym for -pg.

3.4.167 –xpp={fpp|cpp}

Select source file preprocessor.

The default is -xpp=fpp.

Chapter 3 • Fortran Compiler Options

147

Соседние файлы в предмете Информационные и сетевые технологии