rbanos wrote:the thing is that "function_objective" is called several hundred thousand times, and perhaps, these multiple fork-join calls could produce large overheas that would not compensate the parallel work.
I have a very large source code, and, while I have successfully parallelized it using MPI, I have this problem with OpenMP.
Yes, it is possible there is not enough work to compensate for the parallel overhead. If each MPI process is calling function_objective lots of times, it may be better to call different instances of the function on each thread, instead of trying to parallelise within the function.
Is there some problem with your MPI code that you are trying to solve by adding OpenMP?
rbanos wrote:Do you recommend me to use omp parallel sections to parallelize a complex code, such that each section could include the same "sequential code" (the aim of this parallelization is to improve the quality of the solutions without increasing the runtime.
I'm sorry, I don't really understand what you are suggesting here!