Wednesday Jun 27, 2007

New Article: Prefetching

Prefetching Pragmas and Intrinsics

Diane Meirowitz, Senior Staff Engineer, and Spiros Kalogeropulos, Staff Engineer, June, 2007

Introduction

Explicit data prefetching pragmas and intrinsics for the x86 platform and additional pragmas and intrinscs for the SPARC platform are now available in Sun Studio 12 compilers, released June 2007.

Prefetch instructions can increase the speed of an application substantially by bringing data into cache so that it is available when the processor needs it. This benefits performance because today's processors are so fast that it is difficult to bring data into them quickly enough to keep them busy, even with hardware prefetching and multiple levels of data cache.

The compilers have several options that enable them to generate prefetch instructions automatically: -xprefetch, -xprefetch_level, and -xprefetch_auto_type (described below). The compilers generally do an excellent job of inserting prefetch instructions, and this is the most portable and best way to use prefetch. If finer control of prefetching is desired, prefetch pragmas or intrinsics can be used. Note that the performance benefit due to prefetch instructions is hardware-dependent and prefetches which improve performance on one chip may not have the same effect on a different chip. It is a good idea to study the instruction reference manual for the target hardware before inserting prefetch pragmas or intrinsics. Furthermore, the Sun Studio Performance Analyzer can be used to identify the cache misses of an application.


[Read More]

Friday Jun 22, 2007

New Article: Fortran Library Functions - How To Call Them

Here's a new article from Michael Ingrassia, one of the lead developers in the Fortran Compiler team at Sun:

 

HOW TO CALL A LIBRARY FUNCTION OR SUBROUTINE FROM FORTRAN

The Fortran language, both the standard language adhered to by all vendors and the extended language offered to Sun customers, contains several different models for how to call library functions. Confusion can result if you aren't clear about which model you should use for the particular library function you are calling. In this paper we try to describe the different models and provide examples of what might go wrong.

In general, any function found in a library can be called from Fortran. (Subroutines are rarer; for convenience we'll consistently refer to functions in this article where we should properly say function/subroutine). Here's a recipe for how to do it, which contains several specific recommendations for good coding practices.

To start , gather the following information:

  • The name of the function/subroutine
  • The correct declaration for the function/subroutine
    (sometimes this is provided in a file which must be included into your program)
  • The name of the library in which the function is supplied
    (not required for intrinsic functions)

Depending on what you find, there are 5 different models determining how to properly call this function:

  • It's a standard Fortran intrinsic
  • It's a non-standard Fortran intrinsic
  • It's a non-intrinsic Fortran run-time library function
  • It's a non-intrinsic function not supplied in the Fortran run-time libraries, but callable from Fortran
  • It's not a Fortran-callable function

Lets look at each situation in detail.

 

[Read More]
About

Application development on Solaris OS

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today