by ejd » Wed May 28, 2008 5:56 am
Unfortunately I don't have the setup you have available to me. Maybe someone else reading this forum can help you more.
As for books, there are several out about parallel programing that have mentions of OpenMP. However, as far as I know, there are only three out that go into OpenMP in any real detail. Chandra's book has been around for quite a while and only covers OpenMP version 1. It is interesting from a historical perspective, in that it gives some of the reasoning behind various decisions that were made originally. Mattson's book is not OpenMP specific, but Tim has been very active with OpenMP for years and he uses OpenMP throughout his book. The newest book is by Chapman, Jost, and Ruud (covering through OpenMP V2.5) and I have not yet had a chance to look at it. I know all three of the authors and they have all been very active with OpenMP for many years. Unfortunately, all I can really suggest, is that you try and look at these books and see which fits your needs the best. Again maybe someone else reading this can give you their opinions on these books.
As for documentation about more specific things, each vendor providing an OpenMP compiler and runtime should document it's workings. The OpenMP spec is the basic guideline and while terse, it does provide the basic information. The "questionable" areas may not be documented as well by all vendor's, but you can ask general questions here and more specific questions at each vendor's web site (or if you have a support contract through that mechanism). This forum is available for everyone to use - though only a few of the vendors really monitor it (rather spending time monitoring their own web site forums for questions).
The STL push_back function is a perfect example of what I mean. I haven't looked at the documentation for PGI to see what they say about this - since you only just told me that you were using their compiler. I am only guessing that this is the problem, based on what I have seen from other vendors (and my own company's implementation of the STL). It may be that this is not the problem at all - but looking at your code there isn't much else I can see that could be the cause of it. Looking at the PGI documentation is the only way to be sure - though like I have said before - this might not be as clear as you would hope. Terms like "thread safe" or "MT safe" are not as well defined as you might think. While a library may be said to be "thread safe" - meaning that multiple threads can call it at the same time - the structures that they create may not be.