title: How to use OpenMP to deal with two for loops with
body: <p>I am new to OpenMP... Please help me with this dumb question. Thank you :)</p>
  
  <p>Basically, I want to use OpenMP to speed up two for loops. But I do not know why it keeps saying: <strong>invalid controlling predicate</strong> for the for loop. </p>
  
  <p>By the way, my GCC version is gcc (Ubuntu 6.2.0-5ubuntu12) 6.2.0 20161005, and OS I am using is Ubuntu 16.10.</p>
  
  <p>Basically, I generate a toy data that has a typical Key-Value style, like this:</p>
  
  <pre><code>Data = {
      "0": ["100","99","98","97",..."1"];
      "1": ["100","99","98","97",..."1"];
      ...
      "999":["100","99","98","97",..."1"];
  }
  </code></pre>
  
  <p>Then, for each key, I want to compare its value with the rest of the keys. Here, I sum them up through "user1_list.size()+user2_list.size();". As for each key, the sum-up process is totally independent of other keys, which means this works for parallelism.</p>
  
  <p>Here is my toy example code. </p>
  
  <pre><code>#include &lt;map&gt;
  #include &lt;vector&gt;
  #include &lt;string&gt;
  #include &lt;iostream&gt;
  
  #include "omp.h"
  
  using namespace std;
  
  int main(){
      // Create Data
      map&lt;string, vector&lt;string&gt;&gt; data;
      for(int i=0; i != 1000; i++){
          vector&lt;string&gt; list;
          for (int j=100; j!=0; j--){
              list.push_back(to_string(j));
          }
          data[to_string(i)]=list;
      }
      cout &lt;&lt; "Data Total size: " &lt;&lt; data.size() &lt;&lt; endl; 
  
      int count = 1;
      #pragma omp parallel for private(count)
      for (auto it=data.begin(); it!=data.end(); it++){
          //cout &lt;&lt; "Evoke Thread: " &lt;&lt; omp_get_thread_num();
          cout &lt;&lt; " count: " &lt;&lt; count &lt;&lt; " / " &lt;&lt; data.size() &lt;&lt; endl;
          count ++;
          string user1 = it-&gt;first;
          vector&lt;string&gt; user1_list = it-&gt;second;
  
          for (auto it2=data.begin(); it2!=data.end(); it2++){
              string user2 = it2-&gt;first;
              vector&lt;string&gt; user2_list = it2-&gt;second;
  
              cout &lt;&lt; "u1:" &lt;&lt; user1 &lt;&lt; " u2:" &lt;&lt; user2;
              int total_size = user1_list.size()+user2_list.size();
              cout &lt;&lt; " total size: " &lt;&lt; total_size &lt;&lt; endl;
          }
      }
      return 0;
  }
  </code></pre>