Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
ProgrammationParallelle
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
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Admin message
Arrêt du service - 11/07 de 07h30 à 07h45 - Mise à jour de sécurité
Show more breadcrumbs
JACQUIER Timeo
ProgrammationParallelle
Commits
29421c31
Commit
29421c31
authored
2 years ago
by
timeo
Browse files
Options
Downloads
Patches
Plain Diff
Version de test de vitesse de OpenMP
parent
3aadc6e2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/ProgrammesEnVrac/main.cpp
+109
-6
109 additions, 6 deletions
src/ProgrammesEnVrac/main.cpp
with
109 additions
and
6 deletions
src/ProgrammesEnVrac/main.cpp
+
109
−
6
View file @
29421c31
...
...
@@ -212,9 +212,10 @@ uint64_t nbAdditifWithSommeOpenMp(int nb){
int
nbAdditive
=
0
;
//#pragma omp parallel for num_threads(nb)
for
(
int
tailleBloc
=
1
;
tailleBloc
<=
fichier
.
size
()
/
3
;
tailleBloc
++
)
//Test pour chaque taille de bloc possible
{
#pragma omp parallel for
for
(
int
i
=
0
;
i
<=
fichier
.
size
()
-
tailleBloc
*
3
;
i
++
)
// Permet de créer les 3 blocs succéssifs
{
int
additionbloc1
=
valeurBloc
(
i
+
0
,
i
+
tailleBloc
-
1
);
...
...
@@ -277,7 +278,7 @@ void nbAdditifsAvecSansOpenMP(){
std
::
cout
<<
"Durée :"
<<
time_span
.
count
()
<<
" secondes avec OpenMp"
<<
std
::
endl
;
#endif
std
::
cout
<<
std
::
endl
<<
nbAdditifWithSomme
()
<<
std
::
endl
;
nbAdditifWithSomme
();
#ifdef CHRONO
...
...
@@ -318,11 +319,113 @@ void ecrireSommeCentre(){
}
int
main
(){
parseFile
(
"testfiles/ACF_70880000_over_0123.txt"
);
sommeAdditive
();
//parseFile("testfiles/100000fromCorrect.txt");
/*sommeAdditive();
nbAdditifsAvecSansOpenMP();*/
ofstream
flux
(
"tempsExecInterne.csv"
);
for
(
int
i
=
0
;
i
<
6
;
i
++
){
std
::
cout
<<
"Tir "
<<
i
<<
std
::
endl
;
parseFile
(
"testfiles/5000fromCorrect.txt"
);
sommeAdditive
();
#ifdef CHRONO
high_resolution_clock
::
time_point
t1
=
high_resolution_clock
::
now
();
#endif
//std::cout << std::endl << nbAdditif() << std::endl;
std
::
cout
<<
"5 000 char"
<<
std
::
endl
;
std
::
cout
<<
nbAdditifWithSommeOpenMp
(
8
)
<<
std
::
endl
;
#ifdef CHRONO
high_resolution_clock
::
time_point
t2
=
high_resolution_clock
::
now
();
duration
<
double
>
time_span
=
duration_cast
<
duration
<
double
>>
(
t2
-
t1
);
flux
<<
"5000,"
<<
time_span
.
count
()
<<
std
::
endl
;
std
::
cout
<<
"Durée :"
<<
time_span
.
count
()
<<
" secondes"
<<
std
::
endl
<<
std
::
endl
;
#endif
parseFile
(
"testfiles/10000fromCorrect.txt"
);
sommeAdditive
();
#ifdef CHRONO
t1
=
high_resolution_clock
::
now
();
#endif
//std::cout << std::endl << nbAdditif() << std::endl;
std
::
cout
<<
"10 000 char"
<<
std
::
endl
;
std
::
cout
<<
nbAdditifWithSommeOpenMp
(
8
)
<<
std
::
endl
;
#ifdef CHRONO
t2
=
high_resolution_clock
::
now
();
time_span
=
duration_cast
<
duration
<
double
>>
(
t2
-
t1
);
flux
<<
"10000,"
<<
time_span
.
count
()
<<
std
::
endl
;
std
::
cout
<<
"Durée :"
<<
time_span
.
count
()
<<
" secondes"
<<
std
::
endl
<<
std
::
endl
;
#endif
parseFile
(
"testfiles/50000fromCorrect.txt"
);
sommeAdditive
();
#ifdef CHRONO
t1
=
high_resolution_clock
::
now
();
#endif
//std::cout << std::endl << nbAdditif() << std::endl;
std
::
cout
<<
"50 000 char"
<<
std
::
endl
;
std
::
cout
<<
nbAdditifWithSommeOpenMp
(
8
)
<<
std
::
endl
;
#ifdef CHRONO
t2
=
high_resolution_clock
::
now
();
time_span
=
duration_cast
<
duration
<
double
>>
(
t2
-
t1
);
flux
<<
"50000,"
<<
time_span
.
count
()
<<
std
::
endl
;
std
::
cout
<<
"Durée :"
<<
time_span
.
count
()
<<
" secondes"
<<
std
::
endl
<<
std
::
endl
;
#endif
parseFile
(
"testfiles/100000fromCorrect.txt"
);
sommeAdditive
();
#ifdef CHRONO
t1
=
high_resolution_clock
::
now
();
#endif
//std::cout << std::endl << nbAdditif() << std::endl;
std
::
cout
<<
"100 000 char"
<<
std
::
endl
;
std
::
cout
<<
nbAdditifWithSommeOpenMp
(
8
)
<<
std
::
endl
;
#ifdef CHRONO
t2
=
high_resolution_clock
::
now
();
time_span
=
duration_cast
<
duration
<
double
>>
(
t2
-
t1
);
flux
<<
"100000,"
<<
time_span
.
count
()
<<
std
::
endl
;
std
::
cout
<<
"Durée :"
<<
time_span
.
count
()
<<
" secondes"
<<
std
::
endl
<<
std
::
endl
;
#endif
parseFile
(
"testfiles/500000fromCorrect.txt"
);
sommeAdditive
();
#ifdef CHRONO
t1
=
high_resolution_clock
::
now
();
#endif
//std::cout << std::endl << nbAdditif() << std::endl;
std
::
cout
<<
"500 000 char"
<<
std
::
endl
;
std
::
cout
<<
nbAdditifWithSommeOpenMp
(
8
)
<<
std
::
endl
;
#ifdef CHRONO
t2
=
high_resolution_clock
::
now
();
time_span
=
duration_cast
<
duration
<
double
>>
(
t2
-
t1
);
flux
<<
"500000,"
<<
time_span
.
count
()
<<
std
::
endl
;
std
::
cout
<<
"Durée :"
<<
time_span
.
count
()
<<
" secondes"
<<
std
::
endl
<<
std
::
endl
;
#endif
parseFile
(
"testfiles/1000000fromCorrect.txt"
);
sommeAdditive
();
#ifdef CHRONO
t1
=
high_resolution_clock
::
now
();
#endif
//std::cout << std::endl << nbAdditif() << std::endl;
std
::
cout
<<
" 1 000 000 char"
<<
std
::
endl
;
std
::
cout
<<
nbAdditifWithSommeOpenMp
(
8
)
<<
std
::
endl
;
#ifdef CHRONO
t2
=
high_resolution_clock
::
now
();
time_span
=
duration_cast
<
duration
<
double
>>
(
t2
-
t1
);
flux
<<
"1000000,"
<<
time_span
.
count
()
<<
std
::
endl
;
std
::
cout
<<
"Durée :"
<<
time_span
.
count
()
<<
" secondes"
<<
std
::
endl
<<
std
::
endl
;
#endif
}
// ecrireSommeCentre();
int32_t
*
T
=
new
int32_t
[
fichier
.
size
()
+
1
];
/*
int32_t* T = new int32_t[fichier.size() + 1];
for (int i = 0; i < fichier.size() + 2; i++){
T[i] = sommeAdditiveArray[i];
}
...
...
@@ -331,7 +434,7 @@ int main(){
int32_t k = maxi - mini;
std::cout << "k : " << k << " maxi : " << maxi << " mini : " << mini << std::endl;
std
::
cout
<<
libsais_int
(
T
,
SA
,
70880000
,
k
,
fs
)
<<
std
::
endl
;
//
std::cout << libsais_int(T, SA, 70880000, k, fs) << std::endl;
*/
// free(T);
// free(SA);
...
...
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