My computer has four cores. I'm running Ubuntu 15.10, and compiling using g++ -fopenmp ...

I have two different types of jobs, and both are mutually independent: Work1 and Work2. In particular, Work1 should run on a single processor, but Work2 should be parallelized. I tried using omp\_set\_num\_threads():

```
#pragma omp parallel sections
{
    #pragma omp section
    {
        // Should run on one processor.
        omp_set_num_threads(1);
        Work1();
    }

    #pragma omp section
    {
        // Should run on as many processors as possible.
        omp_set_num_threads(3);
        Work2();
    }
}

```

Say Work2 is something like this:

```
void Work2(...){
    #pragma omp parallel for
    for (...) ...

    return;
}

```

When the program is run, only two processors are used. Obviously omp\_set\_num\_threads() is not working as I expected. Is there anything that can be done using OpenMP to remedy this situation?

Thanks to all,

Rodrigo