title: openmp: increasing of threads number decreases perfomance
body: <p>I have this C++ code. </p>
  
  <p>Loop goes throgh the matrix, finds the min element in each row and subtracts it from each element of corresponding row.
  Variable myr is a summ of all min elements</p>
  
  <p>Trying to parallel for:</p>
  
  <pre><code>int min = 0;
  int myr = 0;  
  int temp[SIZE][SIZE];
  int size = 0;
  ...//some initialization
  
  omp_set_num_threads(1);
  start_time = omp_get_wtime();
      #ifdef _OPENMP
      #pragma omp parallel for firstprivate(min, size) reduction(+:myr) 
      #endif
      for(int i = 0; i &lt; size; i++){
          min = INFINITY;
          for(int j = 0; j &lt; size; j++){
                  if (temp[i][j] &lt; min)                
                      min = temp[i][j];                        
          }
          myr+=min;
          for(int j = 0; j &lt; size; j++) 
                  temp[i][j]-=min;
      }
  end_time = omp_get_wtime();
  </code></pre>
  
  <p>if I set <code>omp_set_num_threads(2);</code> this part of code starts working slower.</p>
  
  <p>My proc has 2 cores</p>
  
  <p>Why code works slower with 2 threads?</p>