Go to main content
Oracle® Developer Studio 12.5: Performance Library User's Guide

Exit Print View

Updated: June 2016
 
 

Getting Started With Oracle Developer Studio Performance Library

This section shows the most basic compiler options used to compile an application that uses the Oracle Developer Studio Performance Library routines.

To use the Oracle Developer Studio Performance Library, type one of the following commands.

On x86/x64 and SPARC platforms:

my_system% f95 -dalign my_file.f -library=sunperf

On SPARC platforms:

my_system% cc -xmemalign=8s my_file.c -library=sunperf
my_system% CC -xmemalign=8s my_file.cpp -library=sunperf

On x86/64 platforms, -xmemalign=8s is ignored and therefore can be omitted:

my_system% cc my_file.c -library=sunperf
my_system% CC my_file.cpp -library=sunperf

To link with the Oracle Developer Studio Performance Library statically, add –staticlib=sunperf to the command line.

Because Oracle Developer Studio Performance Library routines are compiled with –dalign, this option should be used for compilation of all Fortran files if any routine in the program makes a Oracle Developer Studio Performance Library call. On SPARC platforms, C and C++ user code that calls Oracle Developer Studio Performance Library routines should be compiled with option –xmemalign=8s. If –xmemalign=8s cannot be used, enabling trap 6 is a low performance workaround that allows misaligned data. See Enabling Trap 6 on SPARC Platforms for more details.

While there are no data alignment restrictions on x86/x64 platforms, misaligned data might require extra instructions to properly handle memory transfers, which in turn can cause poor performance.

The –library=sunperf option includes additional compiler and system libraries such as the Fortran run-time and micro-tasking library and sets run-time search paths for the resulting executable or shared library.

To summarize, use the following options:

  • –dalign on all Fortran files at compile time.

    –xmemalign=8s on SPARC platforms, or enable trap 6

  • The same command line options for compiling and linking

  • –library=sunperf or -library=sunperf -staticlib=sunperf

See About Compiling and Parallel Processing for additional options that optimize application performance.

Enabling Trap 6 on SPARC Platforms

On SPARC platforms where data misalignment can cause failure, if an application cannot be compiled using –dalign or –xmemalign=8s, enable trap 6 to provide a handler for misaligned data. To enable trap 6 on SPARC platforms, do the following:

  1. Place this assembly code in a file called trap6_handler.s.
    	.global trap6_handler_
    	.text
    	.align 4
    trap6_handler_:
    	retl
    	ta    6
    
  2. Assemble trap6_handler.s.
    my_system% fbe trap6_handler.s

    fbe is the command that will create object files from assembly language source files.

    The first parallelizable subroutine invoked from Oracle Developer Studio Performance Library will call a routine named trap6_handler_. If a trap6_handler_ is not specified, Oracle Developer Studio Performance Library will call a default handler that does nothing. Not supplying a handler for any misaligned data will cause a trap that will be fatal.

  3. Include trap6_handler.o on the command line.
    my_system% f95 any.f trap6_handler.o -library=sunperf