Thursday Mar 05, 2009

Reporting bugs

I figured I'd just write up some quick notes about how to report bugs, if you find them, against Sun Studio. There are various mechanisms.

  • First off, there are formal support channels. These are really for the situations where you need a timely response, or are using an older version.
  • The next place that can be useful are the Sun Studio forums. We do read these, and reply - they are very active. It can be useful to discuss problems here in case anyone has hit the same issue, or if you are uncertain whether the code or the compiler is at fault.
  • There is also a formal bug/rfe reporting service. If the compiler dies with an error, this is a good place to file that. Before reporting a new bug or rfe you should first take a look to see if someone else has already reported it. There's also support for watching the status of bugs, or voting for your top three (although the idea of a favourite bug is a bit disturbing).

In terms of what is useful to include:

  • Platform (chip, system type etc)
  • OS version
  • Compiler version
  • Compiler flags/commandline
  • symptoms etc
  • Call stack [dbx - core; whereami]

If the problem causes the compiler to crash with an error, then to reproduce the problem we'll need the source file. Obviously this depends on your environment and header files etc. To produce a preprocessed source file remove any -o <file.o> from the command line and add -P. -P will produce a preprocessed file <file.i>. Check that compiling <file.i> produces the same error, and submit that with the bug report. Obviously, don't submit files that you don't want anyone else to see!

Well, I hope that you never need this info!

Monday Mar 02, 2009

Downloading Sun Studio documentation

It's possible to download the entire set of documentation for Sun Studio. These are both the compiler manuals, plus some of the technical articles. There are some other bundles of docs which may also be worth having locally. The Solaris 10 Developer docs, the Solaris 10 Reference docs, and the Solaris 10 System Administrator docs.

Wednesday Feb 25, 2009

Maximising application performance

I was asked to provide the material for the 2008-2009 Techdays session "Maximising Application Performance". I recorded this as a presentation back last year, and it's now available through SDN. The talk covers basic compiler and profiling material, and is a relatively short 37 minutes in duration.

Wednesday Jan 28, 2009

Tying the bell on the cat

Diane Meirowitz has finally written the document that many of us have either thought about writing, or wished that someone had already written. This is the document that maps gcc compiler flags to Sun Studio compiler flags.

A look inside the Sun compiler team

At the end of last year I was asked to appear in a short video for AMD and give an elevator pitch for performance analysis. The video is now up on the site.

They also took videos of some of the Solaris folks, as well as a few others from the compiler team.

Yuan Lin has a short talk about parallelisation. My manager, Fu-Hwa Wang, talks about the work of our organisation.

Friday Jan 23, 2009

OSUM presentation on multi-threaded coding

I'll be giving a presentation titled "Multi-threaded coding for CMT processors" to OSUM members next friday (8am PST). If you are an OSUM member you can read the details here. OSUM stands for Open Source University Meetup - the definition is

"OSUM (pronounced "awesome") is a global community of students that are passionate about Free and Open Source Software (FOSS) and how it is Changing (Y)Our World. We call it a "Meetup" to encourage collaboration between student groups to create an even stronger open source community.".

Friday Jan 16, 2009

Out of memory in the Performance Analyzer

I've been working on an Analyzer experiment from a long running multithreaded application. Being MT I really needed to see the Timeline view to make sense of what was happening. However, when I switched to the Timeline I got a Java Out of Memory error (insufficient heap space).

Tracking this down, I used prstat to watch the Java application run and the memory footprint increase. I'd expected it to get to 4GB and die at that point, so I was rather surprised when the process was only consuming 1.1GB when the error occurred.

I looked at the commandline options for the Java process using pargs, and spotted the flag -Xmx1024m; which sets the max memory to be 1GB. Ok, found the culprit. You can use the -J option to analyzer to pass flags to the JVM. The following invocation of the analyzer sets the limit to 4GB:

$ analyzer -J-Xmx4096m

If you need more memory than that, you'll have to go to the 64-bit JVM, and allocate an appropriate amount of memory:

$ analyzer -J-d64 -J-Xmx8192m

Thursday Nov 13, 2008

How to learn SPARC assembly language

Got a question this morning about how to learn SPARC assembly language. It's a topic that I cover briefly in my book, however, the coverage in the book was never meant to be complete. The text in my book is meant as a quick guide to reading SPARC (and x86) assembly, so that the later examples make some kind of sense. The basics are the instruction format:

[instruction]  [source register 1], [source register 2], [destination register]

For example:

faddd    %f0, %f2, %f4


%f4 = %f0 + %f2

The other thing to learn that's different about SPARC is the branch delay slot. Where the instruction placed after the branch is actually executed as part of the branch. This is different from x86 where a branch instruction is the delimiter of the block of code.

With those basics out the way, the next thing to do would be to take a look at the SPARC Architecture manual. Which is a very detailed reference to all the software visible implementation details.

Finally, I'd suggest just writing some simple codes, and profiling them using the Sun Studio Performance Analyzer. Use the disassembly view tab and the architecture manual to see how the instructions are used in practice.

November Sun Studio Express release

The November release of Sun Studio Express is out now. The features are listed on the wiki. The main news is that the OpenMP 3.0 implementation has been completed in this release.

Monday Nov 10, 2008

Compiler flags for building python

One of my colleagues has posted compiler flags for building python. The quick summary is that you can get about a 25+% performance gain from using crossfile optimisation, -xO4, and profile feedback.

Poster for London workshop

Just got the poster for the OpenSPARC Workshop in London in December.

Wednesday Nov 05, 2008

OpenSPARC workshop in London

I'm thrilled to have been asked to present at the OpenSPARC workshop to be run in London, on December 4 and 5th. I'll be covering the 'software topics'. There's no charge for attending the workshop.

OpenSPARC presentations

As part of the OpenSPARC book, we were asked to provide slideware and to present that slideware. The details of what's available are listed on the OpenSPARC site, and are available for free from the site on

I contributed two sections. I produced the slides and did the voice over for the material on developing for CMT, the accompanying slides are also available. I also did a voice over for someone else's slides on Operating Systems for CMT (again slides available).

The recording sessions were ok, but a bit strange since it was just myself and the sound engineer working in a meeting room in Santa Clara. I get a lot of energy from live presentations, particularly the interactions with people, and I found the setup rather too quiet for my liking.

The Sun Studio presentation was relatively easy. It runs for nearly an hour, and there's a couple of places where I felt that additional slides would have helped the flow. The Operating Systems presentation was much harder as it was trying to weave a story around someone else's slide deck.

OpenSPARC Internals book

The OpenSPARC Internals book has been released. This is available as a free (after registration) pdf or as a print-on-demand book. The book contains a lot of very detailed information about the OpenSPARC processors, and my contribution was a chapter about Sun Studio, tools, and developing for CMT.

Tuesday Nov 04, 2008

Job available in this performance analysis team

We're advertising a job opening in this group. We're looking for someone who's keen on doing performance analysis on x86 and SPARC platforms. The req number is 561456, and you can read the details on If you have any questions, please do feel free to contact me.

Tuesday Oct 28, 2008

Second life - Utilising CMT slides and transcript

Just finished presenting in second life. This time the experience was not so good, my audio cut out unexpected during the presentation, so I ended up having to use chat to present the material. I was very glad that I'd gone to the effort of writing a script before the presentation, however, reading off the screen is not as effective as presenting the material.

Anyway, I found 'statistics' panel in the environment and looking at this indicated that I was down to <1 FPS, with massive lag. Interestingly, after the presentation and once everyone had left the presentation area, the FPS went up to 10-12. The SL program was still maxing out the CPU (as you might expect, I guess there's no reason to back off until the program hits the frame rate of the screen), but much more responsive - things actually happened when I clicked the on-screen controls.

So, I'm sorry for anyone who found the experience frustrating. I did too. And thank you to those people who turned up, and persevered, and particularly to the bunch of people who participated in the discussion at the end.

Anyway, for those who are interesting the slides and transcript for the presentation are available.

More Sun Studio resources from AMD

Bao from AMD pointed me at these two additional resources. A cheat sheet for Sun Studio. I disagree with the suggestion on it to use -xO2, I would suggest using -O instead. There's also a Solaris Developer Zone.

Monday Oct 27, 2008

x86 compiler flags

This AMD document summarises the optimisation flags available for many x86 compilers (Sun Studio, PGI, Intel etc.). It's about a year old, but it looks ok for Sun Studio. However it talks about -xcrossfile which is ancient history - use -xipo instead!

Sunday Oct 26, 2008

Second life presentation

I'll be presenting in Second Life on Tuesday 28th at 9am PST. The title of the talk is "Utilising CMT systems".

Friday Sep 12, 2008

Innovation insider audio available

The Innovation Insider discussion seemed to go well. I'd expected it to be mainly at a higher level, but we had the time to talk about some technical stuff - I'd not expected to mention hardware performance counters, but I guess they are one of my pet topics ;)

The audio is now available for your listening pleasure.

Thursday Sep 11, 2008

Innovation insider information

Had my briefing for Innovation Insider this morning. I'll be on the show tomorrow (12th September) from 1-2pm PST. I expect to be talking about the book, Sun Studio, and parallelisation.

The format of the show is Q&A, plus phone-ins. So the discussion could go anywhere. Basically you can phone-in to the show to listen and ask questions. It's also streamed live over the net - although that apparently cuts off at 2pm sharp. Then it gets archived for on-demand replay. Should be an interesting experience.

Wednesday Aug 13, 2008

Sun Studio documentation

The documentation for Sun Studio has had an overhaul, the new layout and consolidation looks like it should make the docs much more accessible.

Thursday Jul 31, 2008

GCC for Sun Systems

Ok, so I'm going to have to talk about compiler releases again. That's twice in two days. Again, this is an interesting release. GCC for SPARC Systems has become GCC for Sun Systems, the change in name reflects a new functionality as a cross-compiler. GCC for Sun Systems can be run on an x86 box and build SPARC binaries. Installation is a bit complex since building a SPARC binary requires SPARC header files, but other than setting up access to the files from a SPARC machine, the entire process looks pretty easy. So it should be possible to do all the development work locally on an x86 laptop, then copy the final binary over to a SPARC machine for testing.

Wednesday Jul 30, 2008

Sun Studio Express release

I don't normally talk about Sun Studio Express releases, but this release is important for two reasons.

First of all it's the first release that includes spot. It's a really good feeling to finally get spot into the compiler suite, I've been using it and working on it for probably about six years. Over that time it's proved to be incredibly useful both in terms of productivity (it's easy to gather a spot report and then view it through a browser from home), and in terms of catching performance issues that we might otherwise have missed. Distributing it as a cooltool has been very successful, quite a large number of people have downloaded it, but it's going to be so much more accessible to people when available as part of Sun Studio.

The other really big event is the support of OpenMP 3.0. I believe that Sun Studio is the first compiler to support the new standard! OpenMP 3.0 should make it very easy to parallelise a wide range of applications - no longer just loop based apps. Yuan Lin has put up a wiki page to help get people started with tasks.

There's actually a significant number of other features in this release, it's a pretty major rev.

Monday Jul 28, 2008

OpenSolaris presentation in Japan

I'm back from the trip to Japan. I got to visit a number of customers and talk with them about the compilers and tools. However, the highpoint for me was the OpenSolaris event on the Friday evening. Jim Grisanzio has put up a set of photos from the event and the meal afterwards. (Yes, I was wearing a shirt and tie - the outside temperature and humidity was far to great to also wear a jacket.)

You can probably see in the pictures that the room was full - about 70 people turned up, listened, and asked some excellent questions. Keiichi Oono translated for me, and did a superb job, I think I managed to talk in short chunks, but there were a couple of occasions where I probably talked way too much. There's a couple of pictures of me using the whiteboard, and this turned out to be quite a burden to translate - I plan to do a proper write up in the next day or so.

Hisayoshi Kato did a nice talk (with live demos on a V490) of various performance tools, including some dtrace. I must admit that since Hisayoshi's talk was in Japanese I didn't actually attend all of it, and instead chatted to Jim and Takanobu Masuzuki.

Wednesday Jul 23, 2008

Hot topics presentation: "Compilers, Tools, and Performance"

Just put together the slides for tomorrow's presentation: "Compilers, Tools, and Performance". One of my colleagues has kindly agreed to translate the presentation into Japanese, so I don't expect to get much material into half an hour, since we'll be sharing the time.

Friday Jul 18, 2008

OpenSolaris Hot Topics talk 25th July - Tokyo!

The last few weeks have been quite manic, which is why I've managed to write fewer blog entries than I'd hoped. Unfortunately that's likely to continue for a while longer - I'm traveling to Japan next week for some customer visits. Due to some fortuitous timing, there's an OpenSolaris meeting on Friday the 25th. I've been invited to talk for half an hour.

Monday Jun 09, 2008

Compiler Forensics - update

In my post on compiler forensics I talk about how to find out as much build information as possible from the metadata left in the compiler. Richard Friedman has pointed me to the table which enables you to go from the internal version number to the name of the actual product.

Thursday Jun 05, 2008

HPC tools video

A while back Rebecca Arney and I were interviewed by Kuldip Oberoi about the use of Sun Studio in HPC. The video is now up, and I'm embedding it here:

Ok, there's a few glitches. I need to coach Kuldip on pronouncing my last name 'Gove' - think 'mauve' or 'stove' rather than 'love' or 'glove'. Hopefully, they can revise the caption to correct my first name to 'Darryl' rather than 'Darrel', and also to remove the suggestion that I'm a director of anything (still early stages for my plans of world domination ;). That said I'm used to my name being mangled, so this is not a big thing.

Wednesday May 28, 2008

Updated article on compiler options

An updated version of my article on compiler options has been put up. I think I last refreshed this a couple of years back. It's interesting to see what difference a couple of years makes. I'd started the update with the expectation that things would have become much simpler, although this is true, there's still some complexity left. The major changes were:

  • More focus on -xtarget=generic. Really that's the best option to start with and to use when possible. But there are exceptions....
    • For x86 it's a good plan to use -xarch=sse2 -xvector=simd to get the compiler to use the SSE2 instruction set which is common on all recent x86 processors.
    • For SPARC the SPARC64 VI processor supports floating point multiply accumulate instructions. These are a boost for floating point codes, and are generated under the flags -xarch=sparcfmaf -xfma=fused
  • The compiler is pretty good at generating prefetch instructions by default, so there's no real need to emphasise the prefetch flags.
  • Profile feedback and crossfile optimisation are pretty common options, and should be considered for all applications.

Darryl Gove is a senior engineer in the Solaris Studio team, working on optimising applications and benchmarks for current and future processors. He is also the author of the books:
Multicore Application Programming
Solaris Application Programming
The Developer's Edge


« April 2014
The Developer's Edge
Solaris Application Programming
OpenSPARC Book
Multicore Application Programming