Alfred Huang's Weblog

Disclaimer: Whatever I suggested in my blog is what I would do, it does not necessarily mean the only way to do it.


« On Studio and Gcc... | Main | Compatibility betwee... »
Thursday Jan 04, 2007

Sun Studio Express: A Peek into the Features of the Sun Studio Tool Set

Sun Microsystems is offering free download and usage of the latest Sun Studio under development as a preview with the Sun Studio Express program. Sun Studio is the most complete development tool set available on the market supporting all development stages of highly optimized, serial and parallel applications.

At a glance, Sun Studio consists of high-performance, optimizing C, C++, and Fortran compilers for the Solaris OS on SPARC and Solaris/Linux OS on x86/x64 platforms, plus command-line tools and a NetBeans-based Integrated Development Environment (IDE) for application performance analysis and debugging of mixed source language applications.

As an overview of the newest Sun Studio Express release, with its extensive feature set, Sun Studio can be best described in terms of Performance, Productivity and Parallelism.

Performance

Advanced Compiler Optimiization:

Extensive machine-independent and machine-dependent optimizations

Vectorization support

Instruction scheduling

Data prefetching support

Code/data relocation for optimal cache use

Profile feedback optimization

Crossfile interprocedural optimization

Gcc compatible asm inlining support

Sun specific asm inlining with virtualization support

Gcc/Icc-compatible SSEx intrinsics support (x86/x64)

Binary optimization (Sparc)

Optimized Libraries:

Availability of Sun Performance Library, Rogue Wave Tools.h++, SCL, STLport libraries to increase application performance

Productivity

Sun Studio provides a complete software tool set for source code compatibility across Solaris/Sparc, Solaris/x86 and Linux platforms.

NetBean 6-based IDE with highly convenient user interface

DBX debugger facilitating multi-threaded and multi-language debugging with extensive debugging features including ksh scripting and runtime memory checking

Ease of use Performance Analyzer Tool for multi-language and multi-process application analysis, including memory allocation tracing and hardware counters profiling

Convenient Thread Analyzer to track down the hard-to-detect race conditions and deadlocks during execution time.

Parallel make utility, Dmake, to speed up build process

Parallelism

Multi-threaded model supports both UNIX and POSIX threads

Automatic Parallelization / vectorization

OpenMP 2.5 API support for C, C++ and Fortran

Thread Local Storage support

MPI libraries support (SunCluster 6.0)

Performance Analyzer capable of analyzing multi-threaded, parallel program.

Thread Analyzer to detect data races and deadlock during execution in parallel, multi-threaded program.

Data race and deadlock tracking with static source code analyzer, lock_lint

What's New in the Latest Sun Studio Express?

The newest preview release is Sun Studio Express 3.

With extensive optimization investment in the newest Sun Studio, users can expect visible performance improvement of their applications and benchmarking.

The following list shows some of the more important new features and significant optimization enhancements to be found in Express 3. The list is by no mean exhausive.

Linux Port

The entire Sun Studio development is now available on Linux with the same set of compilers, tools and libraries as found in Solaris-based Sun Studio. Users can now expect source level compatibility for their applications on both Solaris and Linux OS.

Programs developed with Sun Studio under Solaris or Linux enjoy the same source, same components, same performance and same features within boundaries of what the system allows.

Compilers and Libraries

Gcc-compatibility for C

Sun Studio C compiler now supports the following features for Gcc-compatibility:

Alignment Attribute
int __attribute__ ((aligned (16))) i1 = 0; 
Symbol Visibitility

References to the symbol with the following attributes bind to the definition of the first dynamic module that defines the symbol.

int __attribute__ ((visibility ("default"))) i2 = 0;
int __global i3 = 0;

References to the symbol with the following attributes from within the dynamic module being linked bind to the symbol defined within the module. Outside of the module, the symbol appears as though it were global.

int __attribute__ ((visibility ("protected"))) i4 = 0;
int __symbolic i5 = 0;

References to the symbol with the following attributes within a dynamic module bind to a definition within that module. The symbol will not be visible outside of the module.

int __attribute__ ((visibility ("internal"))) i6 = 0;
int __attribute__ ((visibility ("hidden"))) i7 = 0;
int __hidden i8 = 0; 

Other compatibility supports include

Value returning blocks
#define maxint(a,b) \
({int _a = (a), _b = (b); _a > _b ? _a : _b; })
Support for __typeof__
#define max(a,b) \
({ __typeof__ (a) _a = (a); \
__typeof__ (b) _b = (b); \
_a > _b ? _a : _b; })
Zero length arrays

These are useful as the last element of a structure for variable length object.

struct foo {
int len;
int flexarray [0];
};
C++ Libraries Support

Support for the Open Source Libraries of BOOST and LOKI is now available

    BOOST http://www.boost.org
    LOKI http://sourceforge.net/projects/loki-lib

Support of STLport library under Linux OS is also available.

Fortran Enhancement

Interval arithmetic is now supported on Solaris x86 platform with the -xarch=sse2 -xia options.

Machine level Optimization Enhancement

mt-safe -xprofile under x86/x64

Profile feedback optimization for multi-threaded application is now available under x86/x64.

Gcc/Intel Icc-Compatible SSEx Intrinsics under x86/x64

MMX and SSEx vector instructions can be generated via the use of inline intrinsics. Function prototypes are available in mmintrin.h (MMX instructions), xmmintrin.h (SSE instructions), emmintrin.h (SSE2 instructions) and pmmintrin.h (SSE3 instructions).

Compiler optimizer can in cases vectorize matrix operations in loop. Alternatively, one may use SSEx instrinsics to explicitly perform the task resulting in the generation of low level vectorized code, largely suitable for image processing and floating point operations.

These new intrinsics are largely compatible with those supported in Gcc and Intel Icc, enabling easy migration for these popular intrinsics.

As an example, using SSE intrinsics, we may convert the following loop:
 float in1[4] = { 1.0, 2.0, 3.0, 4.0 };
 float in2[4] = { -1.0, -2.0, -3.0, -4.0 };
 float out[4];
 for (i = 0; i < 4; i++) {
     out[i] = in1[i] + in2[i];
 }
with a vectorized version provided in1,in2 and out are 16-byte aligned.
 #include <emmintrin.h>
__m128 x, y, z; x = _mm_load_ps(in1); y = _mm_load_ps(in2); z = _mm_add_ps(x, z); _mm_store_ps(out,z);

Sun Performance Library Enhancement

Major improvements in the performance of the Fast Fourier Transform software for the 1- and 2-dimensional cases on SPARC and x86/x64, and for the 3-dimensional case on SPARC.

Tools

New IDE Integration

All new IDE, based on NetBean 6.

New and improved user interface.

Tightly integrated with C/C++ project system.

New persistent, global breakpoints to be shared between debugged executables.

DBX Debugger

All Sun Studio compilers are now generating Dwarf debugging information by default. This will make it easier for 3rd party debuggers and other tools to interoperate with Studio compilers. The Dwarf format also enhanced debugging optimized code.

Debugging of OpenMP code is now improved.

New Performance Analyzer Features

Race Condition/ Deadlock Data Collection

The collect command accepts a new option, -r [datarace|deadlock|all|on|off], which specifies collecting data race detection and deadlock data.

Time Duration

The collect command accepts a new option, -t <duration>, which specifies a time range for data collection.

Count data (SPARC)

Function and instruction count data can be recorded using the collect -c on option. Data will be collected for the executable only, not the shared libraries. The executable is required to be compiled with the -xbinopt=prepare flag.

Clock-based Dataspace Profiling (SPARC)

Since UltraSparc-T1 does not support Hardware Counter Profiling, Performance Analyzer now has Clock-based Dataspace Profiling. This can be done by prepending + before the -p <interval> option of collect. It will generate additional data if the instruction immediately preceeding the interrupt PC is a memory operation.

Descendant Processes Data collection

Data may now be selectively collected on descendant processes, by using a new collect option -F =<regex>.

Process Attachment

Collect now accepts a new option, -P <pid>, which specifies attaching <pid> to the process and collecting data from it.

Thread Analyzer (THA)

Thread Analyzer is to detect data races and deadlocks that occur during the execution of a single or multi-threaded process.

Use -xinstrument=datarace during compilation time to instrument the program for data race detection. No instrumentation is needed for deadlock detection.

Use collect -r all to collect data race and deadlock data at runtime.

Review the collected data with the new RACES and DEADLOCK tabs in the Performance Analyzer or by using the GUI tool tha, the Thread Analyzer.

lock_lint for the x86 Platform

The static data race and deadlock utility, lint_lock is now available for the x86 platform. Use -Zll flag under the C compiler to create the lock_lint database files.

Some Interesting Data

Sun Studio is famous for its compatibility with past releases. The compilers are tested extensively with past Sun Studio releases from Workshop 5.0 onwards and on Solaris from Solaris 8 onwards.

Sun Studio has been tested with 400+ Open Source Applications. Solaris Enterprise System built entirely with Sun Studio + Java Infrastructure.

All popular benchmarks tested regularly, particularly SPEC CPU 2000, CPU 2006 and SPEC OMP.

Useful links to Solaris Developers Network for Sun Studio

Description

Link

Technical articles, Demos, Whitepapers, CodeSample, Heroes Profiles, Documentation, Customer endorsements http://developers.sun.com/sunstudio
Technical documentations including installation guides, individual product books, FAQs, READMEs, etc http://docs.sun.com
Service Plans http://www.sun.com/service/serviceplans/software.jsp
Service Plans for Developer Support http://www.sun.com/service/serviceplans/developer/buyingguide.pdf
Expert Assistance Program http://developers.sun.com/services/expertassistance/index.jsp
Studio 11 Download (and older versions) or via media kits (charge for shipping and handling only) http://developers.sun.com/sunstudio/downloads/
Download of Express program binaries http://developers.sun.com/sunstudio/downloads/express.jsp
Learning site for SunStudio 11 and Realtime programming for Solaris http://developers.sun.com/sunstudio/learning/
Take a short product tour http://developers.sun.com/sunstudio/product_tour.jsp
Forums for posting questions on compilers, tools, IDE; regularly answered by engineers http://developers.sun.com/sunstudio/community/forums.jsp

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed

Today's Page Hits: 6