Skip to content
Snippets Groups Projects
Commit 8cd16f4a authored by Mathieu Valois's avatar Mathieu Valois
Browse files

Merge branch 'omp' into dev

parents 30a28145 aa4c980f
No related branches found
No related tags found
No related merge requests found
Pipeline #6328 passed
...@@ -79,10 +79,20 @@ int Statsgen::generate_stats() { ...@@ -79,10 +79,20 @@ int Statsgen::generate_stats() {
uint thread_id = omp_get_thread_num(); uint thread_id = omp_get_thread_num();
ifstream inputfile(filename); ifstream inputfile(filename);
string line; string line;
int nbpasswords = 1;
istringstream iss;
for(uint numline = 0; numline < nblines; ++numline){ for(uint numline = 0; numline < nblines; ++numline){
getline(inputfile, line); getline(inputfile, line);
if(withcount){
iss = istringstream(line);
iss >> nbpasswords;
iss >> line;
}
else {
nbpasswords = 1;
}
if((numline % nbThread) == thread_id){ if((numline % nbThread) == thread_id){
handle_password(line, 1, results); handle_password(line, nbpasswords, results);
#pragma omp atomic #pragma omp atomic
++processed; ++processed;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment