Guest User

Untitled

a guest
Oct 15th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. ...
  2. fread(buffer, sizeof(char), numero_bytes, aux);
  3.  
  4. char * string_sequencial = strtok(strdup(buffer), str);
  5.  
  6. while(string_sequencial != NULL) {
  7.  
  8. if(match(padrao, string_sequencial)) // Método Pattern Matching
  9. {
  10. cont_padroes_sequencial++;
  11. }
  12.  
  13. string_sequencial = strtok(NULL, str);
  14. n_linha++;
  15. }
  16.  
  17. omp_set_num_threads(1);
  18.  
  19. char * string_paralelo = strtok(strdup(buffer), str);
  20. omp_set_num_threads(1); // <<<
  21.  
  22. #pragma omp parallel
  23. {
  24. #pragma omp for
  25. for(int i = 0; i < n_linha; i++)
  26. {
  27. if(match(padrao, string_paralelo))
  28. {
  29. cont_padroes_paralelo++;
  30. }
  31. string_paralelo = strtok(NULL, str);
  32. }
  33. }
Add Comment
Please, Sign In to add comment