I want to use openmp to speed up my program (in c++). I have a method (lets call it method A) which consists of a big loop that has to be done serially. This loop call method B which among other thing has a loop in it that can be parellized. However, simply using a parallel for on the loop only makes things worse since the loop in method B isn't that time consuming (per one iteration of method A, but taking into account all of the iteration of method A this loop takes most of the time) so I spend much more time on creating and synchronizing threads then I do calculating. Is there a way to tell the compiler to always have several threads "on" but only to use one of them and the minute that thread enters the loop in method B use all of the other threads. I thought about using the single clause, but once I use that on the loop in method A I can't do anything on the loop in method B. Any ideas??
Thank you for your help,