diff --git a/include/pass_mpi_collective.hpp b/include/pass_mpi_collective.hpp index a2b3d62ad9f1b8bd1031803e6a0c05880c078e64..c95fcca7b18a9247bb1b823bdece269b3cf34d39 100644 --- a/include/pass_mpi_collective.hpp +++ b/include/pass_mpi_collective.hpp @@ -57,7 +57,9 @@ public: // MPI function / collectives detections bool is_func(gimple *stmt); + bool __is_mpi_func(gimple *stmt); bool is_mpi_func(gimple *stmt); + mpi_collective_code __is_mpi_collec(gimple *stmt); mpi_collective_code is_mpi_collec(gimple *stmt); // split blocks according to mpi collectives @@ -79,6 +81,8 @@ public: void free_edge_aux(function *fun); // loop detection + void __mark_edge_naif(function *fun); + void __mark_edge_naif(basic_block bb); void mark_edge(function *fun); // rank definition @@ -89,11 +93,6 @@ public: int __better_rank_collective(basic_block bb, mpi_collective_code mpi_code, int rank); -private: - // MPI function / collectives detections - bool __is_mpi_func(gimple *stmt); - mpi_collective_code __is_mpi_collec(gimple *stmt); - // GRAPHVIZ char *cfgviz_generate_filename(function *fun, const char *suffix); diff --git a/src/pass_mpi_collective.cpp b/src/pass_mpi_collective.cpp index 7da61f6715183525554c4954d936672556cca40a..24b4b3d79da374c31c05cf4d3dd4cb693cec0178 100644 --- a/src/pass_mpi_collective.cpp +++ b/src/pass_mpi_collective.cpp @@ -66,8 +66,8 @@ unsigned int pass_mpi_collective::execute(function *fun) alloc_edge_aux(fun); mark_edge(fun); - //rank_collective(fun); - better_rank_collective(fun); + rank_collective(fun); + //better_rank_collective(fun); cfgviz_dump(fun, "_split"); @@ -399,29 +399,29 @@ 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_naif(function *fun) +void pass_mpi_collective::__mark_edge_naif(function *fun) { - mark_edge(ENTRY_BLOCK_PTR_FOR_FN(fun)); + __mark_edge_naif(ENTRY_BLOCK_PTR_FOR_FN(fun)); } -void pass_mpi_collective::mark_edge_naif(basic_block bb) +void pass_mpi_collective::__mark_edge_naif(basic_block bb) { edge e; edge_iterator ei; - ((bb_data *) bb->aux)->mark = 1; + ((bb_data *) bb->aux)->mark1 = 1; FOR_EACH_EDGE(e, ei, bb->succs) { - if (((bb_data *) e->dest->aux)->mark) + if (((bb_data *) e->dest->aux)->mark1) { ((edge_data *) e->aux)->loop = true; } else { - mark_edge(e->dest); + __mark_edge_naif(e->dest); } } - ((bb_data *) bb->aux)->mark = 0; + ((bb_data *) bb->aux)->mark1 = 0; } void pass_mpi_collective::mark_edge(function *fun)