Application development on Solaris OS using Sun Studio compilers and tools
Solaris Developer
ABOUT

We are the Solaris Developer Information Products Team:
Richard Friedman, David Lindt, Kami Shahi, Jyothi Srinath, Paul Echeverri, Ann Rice, Alta Elstad, Susan Morgan, Frank Jennings

DOCUMENTATION
»Solaris OS
»Sun Studio Compilers/Tools

ARTICLES
»Solaris OS
»Sun Studio Compilers/Tools

DOWNLOADS
»Solaris OS
»Sun Studio Compilers/Tools

RECENT ENTRIES
Archives
Click me to subscribe
Search

Links
 

Today's Page Hits: 39

Wednesday Mar 26, 2008
Enter! Win$

Reminder: OpenSolaris Community Innovation Awards

Go to awards.opensolaris.org to register, declare an entry, and submit your entry. See the updated information on the OpenSolaris Community Innovation Awards Program site. Before you can register for the contest, you must already be registered as an OpenSolaris.org member. Before you can submit an entry, you must already have an SCA number. All types of entries are welcome. Deadline is June 13, 2008. See the web site for prizes, details on how to enter, and other information.


Posted at 08:21AM Mar 26, 2008 by Leslie Elstad in Compilers  | 

Thursday Nov 08, 2007
New Book: USING OPENMP

Using OpenMP MIT PressIn October, MIT Press published the first really comprehensive book on parallel programming using the OpenMP API.

Using OpenMP,
Portable Shared Memory Parallel Programming, by Barbara Chapman, Gabriele Jost and Ruud van der Pas, with a foreword by David J. Kuck, covers shared-memory parallelization on a number of platforms.

I've had a pre-publication peek at it (because one of the authors, Ruud van der Pas, is a Sun engineer I work very closely with), and I can say that it packs a lot of very useful information in one place.

Most useful is a discussion of how cache lines can interfere with OpenMP parallelization and cause performance and scaling degradation if you are not aware of what's going on.

This will be a very valuable book on my shelf when it's available.

 

 


Posted at 07:51AM Nov 08, 2007 by Richard Friedman in Compilers  | 

OpenMP 3.0 Spec Open For Public Comment

The OpenMP ARB is pleased to announce the release of a draft of Version 3.0 of the OpenMP specification for public comment. This is the first update to the OpenMP specification since 2005.

This release adds several new features to the OpenMP specification, including:

Larry Meadows, CEO of the OpenMP organization, states: "The creation of OpenMP 3.0 has taken very hard work by a number of people over more than two years. The introduction of a unified tasking model, allowing
creation and execution of unstructured work, is a great step forward for OpenMP. It should allow the use of OpenMP on whole new classes of computing problems."

The draft specification is available in PDF format from the Specifications section of the OpenMP ARB website:

http://www.openmp.org

(Direct link:
http://www.openmp.org/drupal/mp-documents/spec30_draft.pdf)

Mark Bull has led the effort to expand the applicability of OpenMP while improving it for its current uses as the Chair of the OpenMP Language Committee. He states: "The OpenMP language committee has done a fine job
in producing this latest version of OpenMP. It has been difficult to resolve some tricky details and understand how tasks should propagate across the language. But I think we have come up with solid solutions, and the team should be proud of their accomplishment."

The ARB warmly welcomes any comments, corrections and suggestions you have for Version 3.0. For Version 3.0, we are soliciting comments through an on-line forum, located at http://www.openmp.org/forum. The forum is entitled Draft 3.0 Public Comment. You can also send email to feedback-AT-openmp.org if you would rather not use the forum. It is most helpful if you can refer to the page number and line number where appropriate.

The public comment period will close on 31 January 2008.

Posted at 07:49AM Nov 08, 2007 by Richard Friedman in Compilers  | 

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]

Posted at 10:42AM Jun 27, 2007 by Richard Friedman in Compilers  | 

Friday Jun 22, 2007
C and C++ Technical Articles

There are a lot of useful, short, technical articles on the SDN portal directed at the C and C++ programmer on Solaris. 

New Language Extensions in the Sun Studio 12 C Compiler
This article gives an overview of the C-language extensions (part of the GNU C-implementation) introduced in the Sun Studio 12 C compiler. Although these extensions are not part of the latest ISO C99 standard, they are supported by the popular gcc compilers. (June 13, 2007)
 
A Look Inside a Solaris C++ Shared Libraries Patch
Ever wonder what's in a patch? Take a look inside a typical Sun Studio compiler patch that includes updated C++ shared libraries. (November 10, 2006)
 
Comparing C++ Standard Libraries
The Sun C++ compiler ships with two libraries that implement the C++ standard library: libCstd and libstlport. This article discusses the differences between the two libraries and explores the situations in which one library is preferred over the other. (May 17, 2006)
 
Reducing Symbol Scope with Sun Studio C/C++
Hiding non-interface symbols of a library within the library makes the library more robust and less vulnerable to symbol collisions from outside the library. To get the appropriate linker scoping in a source program, you can now use language extensions built into the Sun Studio C/C++ compilers. (May 17, 2005)
 
Mixed-Language Programming and External Linkage
The author shows how a simple C++ program fails without language linkage, but can succeed with proper linkage. (This article is on the Solaris portal.) (March 23, 2005)
 
Using DTrace to Profile and Debug A C++ Program
In this test case, the DTrace capability in the Solaris 10 OS is used to identify an error common to C++ applications -- the memory leak. (This article is on the Solaris OS developer portal.) (February 17, 2005)
 
Mixing C and C++ Code in the Same Program
The C++ language provides mechanisms for mixing code that is compiled by compatible C and C++ compilers in the same program. You can experience varying degrees of success as you port such code to different platforms and compilers. This article shows how to solve common problems that arise when you mix C and C++ code, and highlights the areas where you might run into portability issues. (July 25, 2003)
 
Using the C/C++ Garbage Collection Library, libgc
This article discusses some of the runtime errors related to memory management and how you can use the garbage collection library, libgc to fix these errors. In most cases, just linking with the library without making any changes to your code will fix the errors. (July 25, 2003)
 
How to Use the restrict Qualifier in C
Using the restrict qualifier appropriately in C programs may allow the compiler to produce significantly faster executables. (July 17, 2003)
 
The Stability of the C++ ABI
A discussion of the evolution of the C++ Application Binary Interface, and its implications. (March 20,2003)
 
Developing on the New Solaris Platform While Supporting Older Versions
Application software developers can learn to use the latest version of the Solaris OS while supporting previous versions. (January 1, 2002)
 

Posted at 06:05PM Jun 22, 2007 by Richard Friedman in Compilers  | 

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:

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

Lets look at each situation in detail.

 

[Read More]

Posted at 02:49PM Jun 22, 2007 by Richard Friedman in Compilers  | 

Wednesday Jun 13, 2007
New Sun Studio Article: C Language Extensions

There's a new article on the Sun Studio SDN portal: 

New Language Extensions in the Sun Studio 12 C Compiler

By Dmitry Mikhailichenko, Sun Microsystems, St Petersburg, Russia, June 2007  

This article gives an overview of the following C-language extensions (part of the GNU C-implementation) introduced in the Sun Studio 12 C compiler. Although these extensions are not part of the latest ISO C99 standard, they are supported by the popular gcc compilers.

The article also demonstrates how to use the new C compiler features for creating generic macros on example of linked-list manipulation-routines. Such macros semantically mimic C++ Standard Template Library, support arbitrary data types and provide strict compile-time type-checking.

 »Read the entire article on the Sun Studio portal


Posted at 12:51PM Jun 13, 2007 by Richard Friedman in Compilers  | 

Friday Jun 08, 2007
New Features in Sun Studio 12 Compilers

Here's what's new and changed in the Sun Studio 12 compilers: 

A New Way To Specify 32-bit or 64-bit Address Model

You no longer need use the -xarch option to specify a 32-bit or 64-bit address model (LP64 versus ILP32). Two new options make it easier:

Deprecated -xarch Flags and Their Replacements Across SPARC and x86

If you are using -xarch=v9 or -xarch=amd64 to specify a 64-bit address model, use just -m64 instead. No -xarch value is required.

[Read More]

Posted at 03:49PM Jun 08, 2007 by Richard Friedman in Compilers  |