title: OpenMP implement switch ... case
body: <p>I'm trying to parallelize <code>switch ... case</code> (c++) using OpenMP directive, but despite my best efforts, the code goes slower than normal sequential execution.</p>
  
  <p>I have used <code>#pragma parallel</code>, <code>#pragma sections</code>,
  I have tried to rewrite the switch case with an if ... else statement
  but with no good result ...</p>
  
  <pre><code>switch (number) {
    case 1:
      f1();
      break;
    case 2:
      f2();
      break;
    case 3:
      f3();
      break;
    case 4:
      fn();
      break;
  }
  </code></pre>
  
  <p>Then there is a second problem, OpenMP won't break or return.</p>