Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pcg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Bouillaguet Charles
pcg
Commits
a4a266e7
Commit
a4a266e7
authored
5 years ago
by
Bouillaguet Charles
Browse files
Options
Downloads
Patches
Plain Diff
omp benchmark
parent
dc6361d6
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
Cunknown/Makefile
+13
-3
13 additions, 3 deletions
Cunknown/Makefile
Cunknown/benchmark_omp.c
+62
-0
62 additions, 0 deletions
Cunknown/benchmark_omp.c
with
76 additions
and
3 deletions
.gitignore
+
1
−
0
View file @
a4a266e7
...
@@ -5,3 +5,4 @@
...
@@ -5,3 +5,4 @@
/Cunknown/test_falsenegative
/Cunknown/test_falsenegative
/Cunknown/benchmark
/Cunknown/benchmark
/Cunknown/main
/Cunknown/main
/Cunknown/benchmark_omp
This diff is collapsed.
Click to expand it.
Cunknown/Makefile
+
13
−
3
View file @
a4a266e7
# icc (avec "source /usr/intel/compilers_and_libraries/linux/bin/compilervars.sh intel64" avant)
#CC = icc
#CFLAGS = -O3 -xHost -qopt-zmm-usage=high -qopenmp
#LDFLAGS = -fopenmp -qopenmp
# gcc
CFLAGS
=
-O3
-Wall
-Wextra
-Werror
-march
=
native
-mtune
=
native
-fopenmp
-g
CFLAGS
=
-O3
-Wall
-Wextra
-Werror
-march
=
native
-mtune
=
native
-fopenmp
-g
LDFLAGS
=
-fopenmp
LDFLAGS
=
-fopenmp
LDLIBS
=
-lm
LDLIBS
=
-lm
all
:
main benchmark test test_falsenegative
all
:
main benchmark test test_falsenegative
benchmark_omp
fonctions.o
:
fonctions.h
fonctions.o
:
fonctions.h
fonctions_bonus.o
:
fonctions.h
main.o
:
fonctions.h pcg_setseq.h
main.o
:
fonctions.h pcg_setseq.h
test.o
:
fonctions.h pcg_setseq.h
test.o
:
fonctions.h pcg_setseq.h
test_falsenegative.o
:
fonctions.h pcg_setseq.h
test_falsenegative.o
:
fonctions.h pcg_setseq.h
benchmark.o
:
fonctions.h pcg_setseq.h
benchmark.o
:
fonctions.h pcg_setseq.h
benchmark_omp.o
:
fonctions.h pcg_setseq.h
main
:
fonctions.o main.o
main
:
fonctions.o main.o
benchmark
:
fonctions.o benchmark.o
benchmark
:
fonctions.o benchmark.o
benchmark_omp
:
fonctions.o benchmark_omp.o
test
:
fonctions.o test.o fonctions_bonus.o
test
:
fonctions.o test.o fonctions_bonus.o
test_falsenegative
:
fonctions.o test_falsenegative.o
test_falsenegative
:
fonctions.o test_falsenegative.o
...
@@ -23,5 +32,6 @@ clean:
...
@@ -23,5 +32,6 @@ clean:
check
:
test test_falsenegative
check
:
test test_falsenegative
prove
-v
./test ./test_falsenegative
prove
-v
./test ./test_falsenegative
bench
:
benchmark
bench
:
benchmark
benchmark_omp
./benchmark
./benchmark
./benchmark_omp
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Cunknown/benchmark_omp.c
0 → 100644
+
62
−
0
View file @
a4a266e7
#include
<stdlib.h>
#include
<stdio.h>
#include
<omp.h>
#include
"fonctions.h"
static
const
u64
WORK_FACTOR
=
1
<<
(
nbiter
*
known_up
);
int
main
()
{
/* INITIALISATION DES PARAMETRES */
init_var_globales
();
/********** prepare test input ***********/
u64
X
[
nboutput
];
pcg128_t
S0
=
(((
pcg128_t
)
5995207026785010249u
)
<<
k
)
+
((
pcg128_t
)
179350442155841024u
);
pcg128_t
c
=
((((
pcg128_t
)
6364136223846793005u
)
<<
k
)
+
1442695040888963407u
)
>>
1
;
pcg128_t
vraiS
[
nboutput
];
pcg
(
vraiS
,
X
,
S0
,
&
c
,
nboutput
);
int
T
=
omp_get_max_threads
();
u64
W0
=
5018
,
WC
=
335
-
T
/
2
;
printf
(
"known_low = %d
\n
"
,
known_low
);
printf
(
"# threads = %d
\n
"
,
T
);
printf
(
"Début du benchmark
\n
"
);
double
t1
=
wtime
();
#pragma omp parallel
{
int
tid
=
omp_get_thread_num
();
struct
task_t
task
;
init_task
(
&
task
);
prepare_task
(
X
,
W0
,
WC
+
tid
,
&
task
);
for
(
u64
r
=
0
;
r
<
WORK_FACTOR
;
r
++
)
{
/***** Modification de rot et unrotX *****/
task
.
rot
[
0
]
=
(
task
.
rot
[
0
]
+
1
)
%
k
;
int
i
=
0
;
while
(
task
.
rot
[
i
]
==
0
&&
i
<
nbiter
)
{
i
++
;
task
.
rot
[
i
]
=
(
task
.
rot
[
i
]
+
1
)
%
k
;
}
if
(
solve_isgood
(
&
task
))
{
printf
(
"thread %d, candidat DS64 trouvé !!
\n
"
,
tid
);
printf
(
"temps pour trouver la solution = %f
\n
"
,
wtime
()
-
t1
);
}
}
}
double
t
=
wtime
()
-
t1
;
printf
(
"Durée benchmark = %.2fs
\n
"
,
t
);
printf
(
"Itérations/s (%d threads) = %.1fM/s
\n
"
,
T
,
WORK_FACTOR
/
t
/
1e6
*
T
);
printf
(
"Itérations/s (1 threads) = %.1fM/s
\n
"
,
WORK_FACTOR
/
t
/
1e6
);
printf
(
"Attaque complète = %.0fK h-CPU
\n
"
,
t
/
WORK_FACTOR
*
(
1ull
<<
(
nbiter
*
known_up
+
2
*
known_low
-
1
))
/
3600
/
1e3
);
exit
(
0
);
}
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