Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cppack
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
passwords
cppack
Commits
ce535e43
Commit
ce535e43
authored
Feb 5, 2020
by
Mathieu Valois
Browse files
Options
Downloads
Patches
Plain Diff
Fix wrong job distribution
parent
2a3c41cd
No related branches found
No related tags found
No related merge requests found
Pipeline
#6325
passed
Feb 5, 2020
Stage: test
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/Statsgen.h
+0
-3
0 additions, 3 deletions
include/Statsgen.h
include/ThreadData.h
+3
-0
3 additions, 0 deletions
include/ThreadData.h
src/core/Statsgen.cpp
+6
-4
6 additions, 4 deletions
src/core/Statsgen.cpp
with
9 additions
and
7 deletions
include/Statsgen.h
+
0
−
3
View file @
ce535e43
...
@@ -23,9 +23,6 @@
...
@@ -23,9 +23,6 @@
#include
"ThreadData.h"
#include
"ThreadData.h"
#pragma omp declare reduction(dataSum: ThreadData : omp_out += omp_in ) initializer(omp_priv(omp_orig))
struct
PasswordStats
{
struct
PasswordStats
{
int
pass_length
=
0
;
int
pass_length
=
0
;
std
::
string
advancedmask_string
=
""
;
std
::
string
advancedmask_string
=
""
;
...
...
This diff is collapsed.
Click to expand it.
include/ThreadData.h
+
3
−
0
View file @
ce535e43
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
typedef
std
::
unordered_map
<
std
::
string
,
uint64_t
>
StringOccurrence
;
typedef
std
::
unordered_map
<
std
::
string
,
uint64_t
>
StringOccurrence
;
typedef
std
::
unordered_map
<
int
,
uint64_t
>
IntOccurrence
;
typedef
std
::
unordered_map
<
int
,
uint64_t
>
IntOccurrence
;
/**
/**
* @brief minimal number of digits of a password, etc.
* @brief minimal number of digits of a password, etc.
*/
*/
...
@@ -61,4 +62,6 @@ struct ThreadData {
...
@@ -61,4 +62,6 @@ struct ThreadData {
SecurityRules
sr
;
SecurityRules
sr
;
};
};
#pragma omp declare reduction(dataSum: ThreadData : omp_out += omp_in ) initializer(omp_priv(omp_orig))
#endif // THREAD_DATA_H
#endif // THREAD_DATA_H
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/core/Statsgen.cpp
+
6
−
4
View file @
ce535e43
...
@@ -70,22 +70,24 @@ int Statsgen::generate_stats() {
...
@@ -70,22 +70,24 @@ int Statsgen::generate_stats() {
}
}
started
=
true
;
started
=
true
;
#pragma omp parallel
#pragma omp parallel
reduction(dataSum:results)
{
{
#pragma omp single
#pragma omp single
{
{
nbThread
=
omp_get_num_threads
();
nbThread
=
omp_get_num_threads
();
}
}
uint
thread_id
=
omp_get_thread_num
();
ifstream
inputfile
(
filename
);
ifstream
inputfile
(
filename
);
string
line
;
string
line
;
#pragma omp for schedule(dynamic) private(line) reduction(dataSum:results)
for
(
uint
numline
=
0
;
numline
<
nblines
;
++
numline
){
for
(
uint
numline
=
0
;
numline
<
nblines
;
++
numline
){
getline
(
inputfile
,
line
);
getline
(
inputfile
,
line
);
if
((
numline
%
nbThread
)
==
thread_id
){
handle_password
(
line
,
1
,
results
);
handle_password
(
line
,
1
,
results
);
#pragma omp atomic
#pragma omp atomic
++
processed
;
++
processed
;
}
}
}
}
}
finished
=
true
;
finished
=
true
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment