OpenMP® Forum

Discussion on the OpenMP specification run by the OpenMP ARB. OpenMP and the OpenMP logo are registered trademarks of the OpenMP Architecture Review Board in the United States and other countries. All rights reserved.

Use this forum to discuss the book: Using OpenMP - Portable Shared Memory Parallel Programming, by Barbara Chapman, Gabriele Jost and Ruud van der Pas Read the viewtopic.php?f=8&t=465 for book info and to download the examples. Post your feedback about the book and examples to this forum

anyone has experience using OpenMP for the libraries of CPLEX? I want to optimize parallel models, but despite all considerations still running in series. Anyone know if is possible to optimize in parallel or whether the reverse is not possible.

I'm working with a fairly complex model, but this is a linear programming example illustrates well the problem I have.

In the object "define_modelos" is scheduled processes that want to run in parallel, then the call from the main using "# pragma omp parallel for" is like when I run sequentially, and is most evident when the models are more complex.

Can you check if the openmp setup/initialization is happened correctly (If not done already)?

a) Check the gcc version, you need to use gcc 4.2 or above b) The program need to be compiled with -fopenmp option c) Can you also set OMP_NUM_THREADS environment variable (e.g: setenv OMP_NUM_THREADS=4) d) Run top -H to check whether the code actually runs on multiple threads. You can also execute a call to omp_get_num_threads within a parallel regions to check how many threads are executing a parallel region.