Ruud Schramp <spam2@xxxxxxxxxxx> wrote: > > I am trying to familiarize myself with openmp and gomp. I hope that you are young, because that could take a while :-) > I noticed it is almost imposible to get a performance boost. I do > notice that things are in different threads when e.g. I parrellize > a small loop of sleep(1)'s. > > However when trying to optimize any of the examples from the several > presentations performance gain is negative. Even when making constructions > with a big inner loop and a small outerloop. That is regrettably common. Unfortunately, I don't have time to help you in detail, but I may be able to save you wasting too much effort. That effect can be because of memory conflicts in the cache or memory, and that is the explantion that almost all courses on OpenMP tell you to look for. To track them down, you need to know a fair amount about the hardware, and look at the generated code in detail. There are a few tools that can help in SOME compilers (e.g. Sun's). It can be due to the parallelisation introducing more instructions to maintain the semantics, and that can be told only by inspecting the generated code (assembler). This is generally denied by the compiler writers, and you would have to 'compile' the code by hand to see if the compiler is being stupid. It can be due to the scheduler. Unix schedulers are traditional interactive workstation ones, and are VERY bad at handling the gang scheduling that most OpenMP programs need. I could go into that at length but, again, it is often denied by the operating system writers. It is made worse by the ghastly primitives that the hardware provides to the operating system and program, and the ghastly ones that the operating system provides to the program. Almost everybody who tries serious OpenMP tuning on non-trivial programs gives up. It may APPEAR more complicated to use, but most HPC experience is that using MPI is easier - because it is so much easier to debug and tune. If you DO persevere and become an OpenMP tuning expert, you will have a very rare skill. Whether that will help your career, I can't say .... Regards, Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pembroke Street, Cambridge CB2 3QH, England. Email: nmm1@xxxxxxxxx Tel.: +44 1223 334761 Fax: +44 1223 334679