Skip to content
Extraits de code Groupes Projets

Comparer les révisions

Les modifications sont affichées comme si la révision source était fusionnée avec la révision cible. En savoir plus sur la comparaison des révisions.

Source

Sélectionner le projet cible
No results found
Sélectionner une révision Git
Loading items

Cible

Sélectionner le projet cible
  • de-carva2021/coav2023
1 résultat
Sélectionner une révision Git
Loading items
Afficher les modifications
Validations sur la source (2)
......@@ -89,10 +89,7 @@ public:
void reset_bb_mark(function *fun);
void alloc_edge_aux(function *fun);
void free_edge_aux(function *fun);
// loop detection algorithms
void __mark_edge_naif(function *fun);
void __mark_edge_naif(basic_block bb);
void __mark_edge_test(function *fun);
// loop detection algorithm
void mark_edge(function *fun);
void mark_edge(basic_block bb);
......@@ -121,9 +118,6 @@ public:
// functions that rank mpi collectives
void rank_collective(function *fun);
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);
// function that calculate agregate a mpi collective
// with the same rank in a bitmap
void get_mpi_coll_rank(
......
......@@ -92,105 +92,6 @@ void pass_mpi_collective::free_edge_aux(function *fun)
}
// loop detection
// naive version of mark_edge (work but Omax(2^n))
void pass_mpi_collective::__mark_edge_naif(function *fun)
{
__mark_edge_naif(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)->mark1 = 1;
FOR_EACH_EDGE(e, ei, bb->succs)
{
if (((bb_data *) e->dest->aux)->mark1)
{
((edge_data *) e->aux)->loop = true;
}
else
{
__mark_edge_naif(e->dest);
}
}
((bb_data *) bb->aux)->mark1 = 0;
}
void pass_mpi_collective::__mark_edge_test(function *fun)
{
edge e1;
edge_iterator ei1;
std::list<basic_block> nodes1;
basic_block bb;
edge e2;
edge_iterator ei2;
std::list<basic_block> nodes2;
basic_block cursor;
int index;
index = 0;
nodes1.push_back(ENTRY_BLOCK_PTR_FOR_FN(fun));
((bb_data *) ENTRY_BLOCK_PTR_FOR_FN(fun)->aux)->mark1 = 1;
while (!nodes1.empty())
{
bb = nodes1.front();
nodes1.pop_front();
FOR_EACH_EDGE(e1, ei1, bb->succs)
{
if (((bb_data *) e1->dest->aux)->mark1)
{
continue;
}
((bb_data *) bb->aux)->mark1 = 1;
nodes1.push_back(e1->dest);
}
if (EDGE_COUNT(bb->preds) < 2)
{
continue;
}
++index;
nodes2.clear();
nodes2.push_back(bb);
((bb_data *) bb->aux)->mark2 = index;
while (!nodes2.empty())
{
cursor = nodes2.front();
nodes2.pop_front();
FOR_EACH_EDGE(e2, ei2, cursor->succs)
{
if (e2->dest == bb)
{
((edge_data *) e2->aux)->loop = true;
}
if (((edge_data *) e2->aux)->loop)
{
continue;
}
if (((bb_data *) e2->dest->aux)->mark2 >= index)
{
continue;
}
((bb_data *) cursor->aux)->mark2 = index;
nodes2.push_back(e2->dest);
}
}
}
reset_bb_mark(fun);
}
void pass_mpi_collective::mark_edge(function *fun)
{
mark_edge(ENTRY_BLOCK_PTR_FOR_FN(fun));
......
......@@ -47,60 +47,6 @@ void pass_mpi_collective::__rank_collective(basic_block bb)
}
}
void pass_mpi_collective::better_rank_collective(function *fun)
{
size_t i;
int next_rank = 0;
for (i = 0; i < LAST_AND_UNUSED_MPI_COLLECTIVE_CODE; ++i)
{
next_rank = __better_rank_collective(EXIT_BLOCK_PTR_FOR_FN(fun),
(enum mpi_collective_code) i,
next_rank);
}
reset_bb_mark(fun);
}
int pass_mpi_collective::__better_rank_collective(basic_block bb,
mpi_collective_code mpi_code, int rank)
{
edge e;
edge_iterator ei;
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)
{
continue;
}
// cache or travell
if (((bb_data *) e->src->aux)->mark1 <= mpi_code)
{
next_rank =
std::max(next_rank,
__better_rank_collective(e->src, mpi_code, rank));
}
else
{
next_rank =
std::max(next_rank,
((bb_data *) e->src->aux)->collective_rank[mpi_code]);
}
}
// set mpi code
if (((bb_data *) bb->aux)->mpi_code == mpi_code)
{
next_rank++;
}
((bb_data *) bb->aux)->collective_rank[mpi_code] = next_rank;
return next_rank;
}
void pass_mpi_collective::get_mpi_coll_rank(function *fun,
int rank, int mpi_code, bitmap mpi_coll)
{
......