Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
C
COAV2023
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Wiki externe
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Extraits de code
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Déploiement
Releases
Registre de paquets
Registre de conteneurs
Registre de modèles
Opération
Environnements
Modules Terraform
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse CI/CD
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté GitLab
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Anzo
COAV2023
Validations
164c9e48
Valider
164c9e48
rédigé
Il y a 1 an
par
Nicolas MARIE
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
implement prof new bad algo for ranking collective
parent
162ea917
Branches
Branches contenant la validation
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
2
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
include/pass_mpi_collective.hpp
+6
-3
6 ajouts, 3 suppressions
include/pass_mpi_collective.hpp
src/pass_mpi_collective.cpp
+129
-35
129 ajouts, 35 suppressions
src/pass_mpi_collective.cpp
avec
135 ajouts
et
38 suppressions
include/pass_mpi_collective.hpp
+
6
−
3
Voir le fichier @
164c9e48
...
...
@@ -31,7 +31,7 @@ struct bb_data
std
::
set
<
basic_block
>
post_dom_front
;
int
mark1
;
// for graph parkour
int
mark2
;
int
collective_rank
;
int
*
collective_rank
;
};
struct
edge_data
...
...
@@ -83,7 +83,10 @@ public:
// rank definition
void
rank_collective
(
function
*
fun
);
int
__rank_collective
(
basic_block
bb
,
void
__rank_collective
(
basic_block
bb
);
void
better_rank_collective
(
function
*
fun
);
int
__better_rank_collective
(
basic_block
bb
,
mpi_collective_code
mpi_code
,
int
rank
);
private:
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
src/pass_mpi_collective.cpp
+
129
−
35
Voir le fichier @
164c9e48
...
...
@@ -66,7 +66,8 @@ unsigned int pass_mpi_collective::execute(function *fun)
alloc_edge_aux
(
fun
);
mark_edge
(
fun
);
rank_collective
(
fun
);
//rank_collective(fun);
better_rank_collective
(
fun
);
cfgviz_dump
(
fun
,
"_split"
);
...
...
@@ -196,6 +197,13 @@ void pass_mpi_collective::alloc_bb_aux(function *fun)
FOR_ALL_BB_FN
(
bb
,
fun
)
{
bb
->
aux
=
(
bb_data
*
)
new
bb_data
();
((
bb_data
*
)
bb
->
aux
)
->
collective_rank
=
new
int
[(
int
)
LAST_AND_UNUSED_MPI_COLLECTIVE_CODE
];
for
(
int
i
=
0
;
i
<
LAST_AND_UNUSED_MPI_COLLECTIVE_CODE
;
++
i
)
{
((
bb_data
*
)
bb
->
aux
)
->
collective_rank
[
i
]
=
0
;
}
}
}
...
...
@@ -229,6 +237,7 @@ void pass_mpi_collective::free_bb_aux(function *fun)
{
if
(
bb
->
aux
!=
NULL
)
{
delete
((
bb_data
*
)
bb
->
aux
)
->
collective_rank
;
delete
(
bb_data
*
)
bb
->
aux
;
bb
->
aux
=
NULL
;
}
...
...
@@ -390,28 +399,30 @@ void pass_mpi_collective::free_edge_aux(function *fun)
}
// naive version of mark_edge (work but Omax(2^n))
//void pass_mpi_collective::mark_edge(function *fun)
//{
// mark_edge(ENTRY_BLOCK_PTR_FOR_FN(fun));
//}
//
//void pass_mpi_collective::mark_edge(basic_block bb)
//{
// edge e;
// edge_iterator ei;
//
// ((bb_data *) bb->aux)->mark = 1;
// FOR_EACH_EDGE(e, ei, bb->succs)
// {
// if (((bb_data *) e->dest->aux)->mark)
// {
// ((edge_data *) e->aux)->loop = true;
// } else {
// mark_edge(e->dest);
// }
// }
// ((bb_data *) bb->aux)->mark = 0;
//}
void
pass_mpi_collective
::
mark_edge_naif
(
function
*
fun
)
{
mark_edge
(
ENTRY_BLOCK_PTR_FOR_FN
(
fun
));
}
void
pass_mpi_collective
::
mark_edge_naif
(
basic_block
bb
)
{
edge
e
;
edge_iterator
ei
;
((
bb_data
*
)
bb
->
aux
)
->
mark
=
1
;
FOR_EACH_EDGE
(
e
,
ei
,
bb
->
succs
)
{
if
(((
bb_data
*
)
e
->
dest
->
aux
)
->
mark
)
{
((
edge_data
*
)
e
->
aux
)
->
loop
=
true
;
}
else
{
mark_edge
(
e
->
dest
);
}
}
((
bb_data
*
)
bb
->
aux
)
->
mark
=
0
;
}
void
pass_mpi_collective
::
mark_edge
(
function
*
fun
)
{
...
...
@@ -486,20 +497,101 @@ void pass_mpi_collective::mark_edge(function *fun)
reset_bb_mark
(
fun
);
}
// WIP for new mark edge
//struct basic_block_elem {
// bitmap_head seen;
// basic_block bb;
//}
//
//struct basic_block_elem *new_bb_elem(){
// return new
//}
//
//void free_bb_elem(){
//
//}
//
//
//void mark_loop(){
// vect<struct basic_block_elem> pile;
// struct basic_block_elem *first;
//
// first = new_bb_elem();
// first->bb = ENTRY_BLOCK_PTR_FOR_FN(fun);
// pile.push(first);
//
// while(pile.length() != 0){
// // mettre a jour edge & already seen
//
// }
//
//}
//
//void pass_mpi_collective::mark_edge(function *fun)
//{
// edge e;
// edge_iterator ei;
// std::list<basic_block> nodes;
// basic_block bb;
//
//
//
//}
void
pass_mpi_collective
::
rank_collective
(
function
*
fun
)
{
__rank_collective
(
EXIT_BLOCK_PTR_FOR_FN
(
fun
));
reset_bb_mark
(
fun
);
}
void
pass_mpi_collective
::
__rank_collective
(
basic_block
bb
)
{
edge
e
;
edge_iterator
ei
;
((
bb_data
*
)
bb
->
aux
)
->
mark1
=
1
;
FOR_EACH_EDGE
(
e
,
ei
,
bb
->
preds
)
{
if
(((
edge_data
*
)
e
->
aux
)
->
loop
)
{
continue
;
}
if
(
!
((
bb_data
*
)
e
->
src
->
aux
)
->
mark1
)
{
__rank_collective
(
e
->
src
);
}
for
(
int
mpi_code
=
0
;
mpi_code
<
LAST_AND_UNUSED_MPI_COLLECTIVE_CODE
;
++
mpi_code
)
{
((
bb_data
*
)
bb
->
aux
)
->
collective_rank
[
mpi_code
]
=
std
::
max
(((
bb_data
*
)
bb
->
aux
)
->
collective_rank
[
mpi_code
],
((
bb_data
*
)
e
->
src
->
aux
)
->
collective_rank
[
mpi_code
]);
if
(((
bb_data
*
)
bb
->
aux
)
->
mpi_code
==
mpi_code
)
{
((
bb_data
*
)
bb
->
aux
)
->
collective_rank
[
mpi_code
]
++
;
}
}
}
return
;
}
void
pass_mpi_collective
::
better_rank_collective
(
function
*
fun
)
{
size_t
i
;
int
next_rank
=
1
;
int
next_rank
=
0
;
for
(
i
=
0
;
i
<
LAST_AND_UNUSED_MPI_COLLECTIVE_CODE
;
++
i
)
{
next_rank
=
__rank_collective
(
EXIT_BLOCK_PTR_FOR_FN
(
fun
),
next_rank
=
__
better_
rank_collective
(
EXIT_BLOCK_PTR_FOR_FN
(
fun
),
(
enum
mpi_collective_code
)
i
,
next_rank
);
reset_bb_mark
(
fun
);
}
reset_bb_mark
(
fun
);
}
int
pass_mpi_collective
::
__rank_collective
(
basic_block
bb
,
int
pass_mpi_collective
::
__
better_
rank_collective
(
basic_block
bb
,
mpi_collective_code
mpi_code
,
int
rank
)
{
edge
e
;
...
...
@@ -507,6 +599,8 @@ int pass_mpi_collective::__rank_collective(basic_block bb,
int
next_rank
;
next_rank
=
rank
;
((
bb_data
*
)
bb
->
aux
)
->
mark1
=
mpi_code
+
1
;
FOR_EACH_EDGE
(
e
,
ei
,
bb
->
preds
)
{
if
(((
edge_data
*
)
e
->
aux
)
->
loop
)
...
...
@@ -515,25 +609,25 @@ int pass_mpi_collective::__rank_collective(basic_block bb,
}
// cache or travell
if
(((
bb_data
*
)
e
->
src
->
aux
)
->
mark1
)
if
(((
bb_data
*
)
e
->
src
->
aux
)
->
mark1
<=
mpi_code
)
{
next_rank
=
std
::
max
(
next_rank
,
((
bb_data
*
)
e
->
src
->
aux
)
->
mark1
);
__better_rank_collective
(
e
->
src
,
mpi_code
,
rank
)
);
}
else
{
next_rank
=
std
::
max
(
next_rank
,
__rank_
collective
(
e
->
src
,
mpi_code
,
rank
)
);
((
bb_data
*
)
e
->
src
->
aux
)
->
collective
_rank
[
mpi_code
]
);
}
}
// set mpi code
if
(((
bb_data
*
)
bb
->
aux
)
->
mpi_code
==
mpi_code
)
{
((
bb_data
*
)
bb
->
aux
)
->
collective_rank
=
next_rank
;
next_rank
++
;
printf
(
"set rank %d at %d for coll %d
\n
"
,
next_rank
,
bb
->
index
,
mpi_code
);
}
// set mark before recusion
((
bb_data
*
)
bb
->
aux
)
->
mark1
=
next_rank
;
((
bb_data
*
)
bb
->
aux
)
->
collective_rank
[
mpi_code
]
=
next_rank
;
return
next_rank
;
}
...
...
@@ -578,7 +672,7 @@ void pass_mpi_collective::cfgviz_internal_dump(function *fun, FILE *out)
if
(
data
->
mpi_code
!=
LAST_AND_UNUSED_MPI_COLLECTIVE_CODE
)
{
fprintf
(
out
,
"|%s (%d) "
,
mpi_collective_name
[
data
->
mpi_code
],
data
->
collective_rank
);
data
->
collective_rank
[
data
->
mpi_code
]
);
}
if
(
!
data
->
dom
.
empty
())
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter