PGO and OpenMP

Alan Ning just posted about a cool hack of VS’s PGO switch, which was a sad reminder of all the wonderful goodies I’d never taste in my present job.

PGO builds can incorporate many optimizations that regular builds cannot, thereby leading to ~7.5% speedup (as measured by the VC++ team) with *zero* coding effort.  Still, eagerly trying it – I got struck with "Fatal Error C1310: profile guided optimizations are not available with OpenMP".

You see occasional rants about this incompatibility, but these are met with consistent MS reluctance to address it. Quoting from the Connect bug:

Since PGO and OpenMP are both designed to increase performance, it is a shame that they can’t be used together, but there were some major design issues preventing this. There is an ordering dependency in the designs of PGO and OpenMP. OpenMP changes some things about the program state that are important to PGO, and it does this after PGO has already processed the program state and made many decisions based on it.

And further yet –

We will be considering a modification of the designs of PGO and/or OpenMP to get this to work in a future product version.

That was written in April 2005. 3 VC++ versions later, the incompatibility persists.

We are using OpenMP, extensively, as do probably all dev shops today who care about performance. Seems anyone who does any new native code today probably cares deeply about performance – and those are exactly the devs that both OpenMP and PGO are aimed at!  The stated obstacles in addressing this issue (essentially, getting the order of operations right) don’t sound that insurmountable to me. I’d be surprised if other compilers suffer similar limitations (but frankly I have no idea. Anyone has better info?).

As crescens2k answered me some time ago,

The way Microsoft generally do things is by demand. So if you think this is something which should get fixed soon, the best thing you can do is submit a suggestion and get everyone you know to support it.

Well said.  Please, take 20 seconds and upvote it.

This entry was posted in VC++. Bookmark the permalink.

Leave a comment