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
39519d89
Valider
39519d89
rédigé
13 oct. 2023
par
Nicolas MARIE
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
rank collectives sequences
parent
c1737900
Aucune branche associée trouvée
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
+7
-1
7 ajouts, 1 suppression
include/pass_mpi_collective.hpp
src/pass_mpi_collective.cpp
+56
-11
56 ajouts, 11 suppressions
src/pass_mpi_collective.cpp
avec
63 ajouts
et
12 suppressions
include/pass_mpi_collective.hpp
+
7
−
1
Voir le fichier @
39519d89
...
@@ -30,6 +30,7 @@ struct bb_data
...
@@ -30,6 +30,7 @@ struct bb_data
std
::
set
<
basic_block
>
dom_front
;
std
::
set
<
basic_block
>
dom_front
;
std
::
set
<
basic_block
>
post_dom_front
;
std
::
set
<
basic_block
>
post_dom_front
;
int
mark
;
// for graph parkour
int
mark
;
// for graph parkour
int
collective_rank
;
};
};
struct
edge_data
struct
edge_data
...
@@ -78,6 +79,11 @@ public:
...
@@ -78,6 +79,11 @@ public:
void
mark_edge
(
function
*
fun
);
void
mark_edge
(
function
*
fun
);
void
mark_edge
(
basic_block
bb
,
int
mark
);
void
mark_edge
(
basic_block
bb
,
int
mark
);
// rank definition
void
rank_collective
(
function
*
fun
);
int
rank_collective
(
basic_block
bb
,
mpi_collective_code
mpi_code
,
int
rank
);
private:
private:
// MPI function / collectives detections
// MPI function / collectives detections
bool
__is_mpi_func
(
gimple
*
stmt
);
bool
__is_mpi_func
(
gimple
*
stmt
);
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
src/pass_mpi_collective.cpp
+
56
−
11
Voir le fichier @
39519d89
...
@@ -66,6 +66,8 @@ unsigned int pass_mpi_collective::execute(function *fun)
...
@@ -66,6 +66,8 @@ unsigned int pass_mpi_collective::execute(function *fun)
mark_edge
(
fun
);
mark_edge
(
fun
);
reset_bb_mark
(
fun
);
reset_bb_mark
(
fun
);
rank_collective
(
fun
);
cfgviz_dump
(
fun
,
"_split"
);
cfgviz_dump
(
fun
,
"_split"
);
free_dom_data
();
free_dom_data
();
...
@@ -98,7 +100,8 @@ void pass_mpi_collective::print_tree(function *fun)
...
@@ -98,7 +100,8 @@ void pass_mpi_collective::print_tree(function *fun)
{
{
printf
(
"
\t\t\t
Statement is a MPI function call (%s)
\n
"
,
printf
(
"
\t\t\t
Statement is a MPI function call (%s)
\n
"
,
fndecl_name
(
gimple_call_fndecl
(
stmt
)));
fndecl_name
(
gimple_call_fndecl
(
stmt
)));
if
(
__is_mpi_collec
(
stmt
)
!=
LAST_AND_UNUSED_MPI_COLLECTIVE_CODE
)
if
(
__is_mpi_collec
(
stmt
)
!=
LAST_AND_UNUSED_MPI_COLLECTIVE_CODE
)
{
{
printf
(
"
\t\t\t\t
Statement is a MPI collective (%s)
\n
"
,
printf
(
"
\t\t\t\t
Statement is a MPI collective (%s)
\n
"
,
fndecl_name
(
gimple_call_fndecl
(
stmt
)));
fndecl_name
(
gimple_call_fndecl
(
stmt
)));
...
@@ -131,15 +134,13 @@ mpi_collective_code pass_mpi_collective::__is_mpi_collec(gimple *stmt)
...
@@ -131,15 +134,13 @@ mpi_collective_code pass_mpi_collective::__is_mpi_collec(gimple *stmt)
size_t
i
;
size_t
i
;
const
char
*
callee_name
;
const
char
*
callee_name
;
i
=
0
;
callee_name
=
fndecl_name
(
gimple_call_fndecl
(
stmt
));
callee_name
=
fndecl_name
(
gimple_call_fndecl
(
stmt
));
while
(
i
<
LAST_AND_UNUSED_MPI_COLLECTIVE_CODE
)
for
(
i
=
0
;
i
<
LAST_AND_UNUSED_MPI_COLLECTIVE_CODE
;
++
i
)
{
{
if
(
strcmp
(
mpi_collective_name
[
i
],
callee_name
)
==
0
)
if
(
strcmp
(
mpi_collective_name
[
i
],
callee_name
)
==
0
)
{
{
return
(
enum
mpi_collective_code
)
i
;
return
(
enum
mpi_collective_code
)
i
;
}
}
++
i
;
}
}
return
LAST_AND_UNUSED_MPI_COLLECTIVE_CODE
;
return
LAST_AND_UNUSED_MPI_COLLECTIVE_CODE
;
}
}
...
@@ -419,16 +420,60 @@ void pass_mpi_collective::mark_edge(basic_block bb, int mark)
...
@@ -419,16 +420,60 @@ void pass_mpi_collective::mark_edge(basic_block bb, int mark)
{
{
((
edge_data
*
)
e
->
aux
)
->
loop
=
true
;
((
edge_data
*
)
e
->
aux
)
->
loop
=
true
;
}
}
if
(((
bb_data
*
)
bb_dest
->
aux
)
->
mark
==
0
)
{
mark_edge
(
bb_dest
,
mark
+
1
);
}
}
}
}
FOR_EACH_EDGE
(
e
,
ei
,
bb
->
succs
)
void
pass_mpi_collective
::
rank_collective
(
function
*
fun
)
{
{
bb_dest
=
e
->
dest
;
size_t
i
;
if
(((
bb_data
*
)
bb_dest
->
aux
)
->
mark
==
0
)
int
next_rank
=
1
;
for
(
i
=
0
;
i
<
LAST_AND_UNUSED_MPI_COLLECTIVE_CODE
;
++
i
)
{
{
mark_edge
(
bb_dest
,
mark
+
1
);
next_rank
=
rank_collective
(
EXIT_BLOCK_PTR_FOR_FN
(
fun
),
(
enum
mpi_collective_code
)
i
,
next_rank
);
reset_bb_mark
(
fun
);
}
}
}
}
int
pass_mpi_collective
::
rank_collective
(
basic_block
bb
,
mpi_collective_code
mpi_code
,
int
rank
)
{
edge
e
;
edge_iterator
ei
;
int
next_rank
;
next_rank
=
rank
;
FOR_EACH_EDGE
(
e
,
ei
,
bb
->
preds
)
{
if
(((
edge_data
*
)
e
->
aux
)
->
loop
)
{
continue
;
}
if
(((
bb_data
*
)
e
->
src
->
aux
)
->
mark
)
{
//printf("caching from %d to %d\n", e->src->index, bb->index);
next_rank
=
std
::
max
(
next_rank
,
((
bb_data
*
)
e
->
src
->
aux
)
->
mark
);
}
else
{
//printf("going from %d to %d\n", e->src->index, bb->index);
next_rank
=
std
::
max
(
next_rank
,
rank_collective
(
e
->
src
,
mpi_code
,
rank
));
}
}
if
(((
bb_data
*
)
bb
->
aux
)
->
mpi_code
==
mpi_code
)
{
((
bb_data
*
)
bb
->
aux
)
->
collective_rank
=
next_rank
;
next_rank
++
;
}
((
bb_data
*
)
bb
->
aux
)
->
mark
=
next_rank
;
return
next_rank
;
}
}
//============================ GRAPHVIZ =====================================
//============================ GRAPHVIZ =====================================
...
@@ -471,8 +516,8 @@ void pass_mpi_collective::cfgviz_internal_dump(function *fun, FILE *out)
...
@@ -471,8 +516,8 @@ void pass_mpi_collective::cfgviz_internal_dump(function *fun, FILE *out)
fprintf
(
out
,
"%d [label=
\"
BB %d"
,
bb
->
index
,
bb
->
index
);
fprintf
(
out
,
"%d [label=
\"
BB %d"
,
bb
->
index
,
bb
->
index
);
if
(
data
->
mpi_code
!=
LAST_AND_UNUSED_MPI_COLLECTIVE_CODE
)
if
(
data
->
mpi_code
!=
LAST_AND_UNUSED_MPI_COLLECTIVE_CODE
)
{
{
fprintf
(
out
,
"|%s (%d) "
,
mpi_collective_name
[
data
->
mpi_code
],
fprintf
(
out
,
"|%s"
,
mpi_collective_name
[
data
->
mpi_code
]
);
data
->
collective_rank
);
}
}
if
(
!
data
->
dom
.
empty
())
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