@@ -103,17 +103,17 @@ class Initiator : public TT<int,
103103 public:
104104 Initiator (Matrix<T>* adjacency_matrix_ttg, const std::string& name)
105105 : baseT(name, {}, {" outA" , " outB" , " outC" , " outD" }), adjacency_matrix_ttg(adjacency_matrix_ttg) {
106- /* Initiator should run on all ranks */
107- auto rank = ttg::default_execution_context ().rank ();
108- this ->set_keymap ([=](int i){ return rank; });
109- }
106+ /* Initiator should run on all ranks */
107+ auto rank = ttg::default_execution_context ().rank ();
108+ this ->set_keymap ([=](int i) { return rank; });
109+ }
110110 Initiator (Matrix<T>* adjacency_matrix_ttg, const typename baseT::output_edges_type& outedges, const std::string& name)
111111 : baseT(edges(), outedges, name, {}, {" outA" , " outB" , " outC" , " outD" })
112112 , adjacency_matrix_ttg(adjacency_matrix_ttg) {
113- /* Initiator should run on all ranks */
114- auto rank = ttg::default_execution_context ().rank ();
115- this ->set_keymap ([=](int i){ return rank; });
116- }
113+ /* Initiator should run on all ranks */
114+ auto rank = ttg::default_execution_context ().rank ();
115+ this ->set_keymap ([=](int i) { return rank; });
116+ }
117117
118118 ~Initiator () {}
119119
@@ -122,8 +122,7 @@ class Initiator : public TT<int,
122122 // This triggers for the immediate execution of function A at tile [0, 0]. But
123123 // functions B, C, and D have other dependencies to meet before execution; They wait
124124 std::for_each (adjacency_matrix_ttg->get ().begin (), adjacency_matrix_ttg->get ().end (),
125- [&out](const std::pair<std::pair<int , int >, BlockMatrix<T>>& kv)
126- {
125+ [&out](const std::pair<std::pair<int , int >, BlockMatrix<T>>& kv) {
127126 auto [i, j] = kv.first ;
128127 if (i == 0 && j == 0 ) { // A function call
129128 ::send<0 >(Key (std::make_pair (std::make_pair (i, j), 0 )), kv.second , out);
@@ -288,8 +287,8 @@ class FuncA : public TT<Key,
288287 }
289288
290289 // making x_ready for the computation on the SAME block in the NEXT iteration
291- if (K < (blocking_factor - 1 )) { // if there is a NEXT iteration
292- std::get<0 >(bcast_keys)[0 ] = {I, J, K+ 1 };
290+ if (K < (blocking_factor - 1 )) { // if there is a NEXT iteration
291+ std::get<0 >(bcast_keys)[0 ] = {I, J, K + 1 };
293292 if (I == K + 1 && J == K + 1 ) { // in the next iteration, we have A function call
294293 // cout << "Send " << I << " " << J << " " << K << endl;
295294 // ::send<0>(Key(std::make_pair(std::make_pair(I, J), K + 1)), m_ij, out);
@@ -378,8 +377,8 @@ class FuncB : public TT<Key,
378377 }
379378
380379 // making x_ready for the computation on the SAME block in the NEXT iteration
381- if (K < (blocking_factor - 1 )) { // if there is a NEXT iteration
382- std::get<0 >(bcast_keys)[0 ] = {I, J, K+ 1 };
380+ if (K < (blocking_factor - 1 )) { // if there is a NEXT iteration
381+ std::get<0 >(bcast_keys)[0 ] = {I, J, K + 1 };
383382 if (I == K + 1 && J == K + 1 ) { // in the next iteration, we have A function call
384383 // cout << "Send " << I << " " << J << " " << K << endl;
385384 // ::send<0>(Key(std::make_pair(std::make_pair(I, J), K + 1)), m_ij, out);
@@ -467,8 +466,8 @@ class FuncC : public TT<Key,
467466 }
468467
469468 // making x_ready for the computation on the SAME block in the NEXT iteration
470- if (K < (blocking_factor - 1 )) { // if there is a NEXT iteration
471- std::get<0 >(bcast_keys)[0 ] = {I, J, K+ 1 };
469+ if (K < (blocking_factor - 1 )) { // if there is a NEXT iteration
470+ std::get<0 >(bcast_keys)[0 ] = {I, J, K + 1 };
472471 if (I == K + 1 && J == K + 1 ) { // in the next iteration, we have A function call
473472 // cout << "Send " << I << " " << J << " " << K << endl;
474473 // ::send<0>(Key(std::make_pair(std::make_pair(I, J), K + 1)), m_ij, out);
@@ -580,10 +579,10 @@ class FloydWarshall {
580579 int blocking_factor;
581580
582581 public:
583- template <typename Keymap>
582+ template <typename Keymap>
584583 FloydWarshall (Matrix<T>* adjacency_matrix_ttg, Matrix<T>* result_matrix_ttg, int problem_size, int blocking_factor,
585- const std::string& kernel_type, int recursive_fan_out, int base_size, T* adjacency_matrix_serial, Keymap&& keymap,
586- bool verify_results = false )
584+ const std::string& kernel_type, int recursive_fan_out, int base_size, T* adjacency_matrix_serial,
585+ Keymap&& keymap, bool verify_results = false )
587586 : initiator(adjacency_matrix_ttg, " initiator" )
588587 , funcA(adjacency_matrix_ttg, problem_size, blocking_factor, kernel_type, recursive_fan_out, base_size, " funcA" )
589588 , funcB(adjacency_matrix_ttg, problem_size, blocking_factor, kernel_type, recursive_fan_out, base_size, " funcB" )
@@ -677,7 +676,7 @@ int main(int argc, char** argv) {
677676
678677 ttg::World world = ttg::default_execution_context ();
679678
680- using mpqc ::Debugger;
679+ using ttg ::Debugger;
681680 auto debugger = std::make_shared<Debugger>();
682681 Debugger::set_default_debugger (debugger);
683682 debugger->set_exec (argv[0 ]);
@@ -721,15 +720,15 @@ int main(int argc, char** argv) {
721720 int n_bcols = n_brows;
722721
723722 int rank = world.rank ();
724- int P = std::sqrt (world.size ());
725- int Q = world.size () / P;
726- auto keymap = [=](const Key & key) {
723+ int P = std::sqrt (world.size ());
724+ int Q = world.size () / P;
725+ auto keymap = [=](const Key& key) {
727726 int I = key.execution_info .first .first ;
728727 int J = key.execution_info .first .second ;
729- return ((I% P) + (J%Q)* P);
728+ return ((I % P) + (J % Q) * P);
730729 };
731730
732- auto predicate = [=](int i, int j){ return keymap (Key{i, j, 0 }) == rank; };
731+ auto predicate = [=](int i, int j) { return keymap (Key{i, j, 0 }) == rank; };
733732
734733 Matrix<double >* m = new Matrix<double >(n_brows, n_bcols, block_size, block_size, predicate);
735734 Matrix<double >* r = new Matrix<double >(n_brows, n_bcols, block_size, block_size, predicate);
@@ -738,13 +737,12 @@ int main(int argc, char** argv) {
738737 adjacency_matrix_serial = (double *)malloc (sizeof (double ) * problem_size * problem_size);
739738 }
740739
741- // double start = madness::wall_time();
740+ // double start = madness::wall_time();
742741 m->fill ();
743- if (verify_results)
744- init_square_matrix (problem_size, blocking_factor, adjacency_matrix_serial);
745- // std::cout << "Init took: " << madness::wall_time() - start << std::endl;
746- // Run in every process to be able to verify? Is there another way?
747- // Calling the iterative fw-apsp
742+ if (verify_results) init_square_matrix (problem_size, blocking_factor, adjacency_matrix_serial);
743+ // std::cout << "Init took: " << madness::wall_time() - start << std::endl;
744+ // Run in every process to be able to verify? Is there another way?
745+ // Calling the iterative fw-apsp
748746 if (verify_results) {
749747 std::chrono::high_resolution_clock::time_point t1 = std::chrono::high_resolution_clock::now ();
750748 floyd_iterative (adjacency_matrix_serial, problem_size);
@@ -830,11 +828,11 @@ void init_square_matrix(int problem_size, int blocking_factor, double* adjacency
830828 for (int nc = 0 ; nc < n_brows; nc++) {
831829 for (int i = 0 ; i < block_size; ++i) {
832830 int row = (i + nr * block_size) * problem_size;
833- // int blockX = i / block_size;
834- // int x = i % block_size;
831+ // int blockX = i / block_size;
832+ // int x = i % block_size;
835833 for (int j = 0 ; j < block_size; ++j) {
836- // int blockY = j / block_size;
837- // int y = j % block_size;
834+ // int blockY = j / block_size;
835+ // int y = j % block_size;
838836 /* if (i != j) {
839837 double value = i * blocking_factor + j; // rand() % 100 + 1;
840838 ((*m)(blockX, blockY))(x, y, value);
0 commit comments