diff --git a/build/ag_gen b/build/ag_gen index 9df45c9..5257629 100755 Binary files a/build/ag_gen and b/build/ag_gen differ diff --git a/src/ag_gen/ag_gen.cpp b/src/ag_gen/ag_gen.cpp index 90206a6..fde4f92 100755 --- a/src/ag_gen/ag_gen.cpp +++ b/src/ag_gen/ag_gen.cpp @@ -460,6 +460,18 @@ AGGenInstance &AGGen::generate(bool batch_process, int batch_size, int numThrd, ttwo_comm, ex_groups, hash_map); std::cout << "Finished Task 2 as Node: " << world.rank() << std::endl; //Wait for all Task 2 nodes to finish + + while(ttwo_comm.iprobe(mpi::any_source, 3) || ttwo_comm.iprobe(mpi::any_source, 4)){ + NetworkState new_state; + Quality fact; + + ttwo_comm.irecv(mpi::any_source, 3, fact); + ttwo_comm.irecv(mpi::any_source, 4, new_state); + + instance.facts.hash_table[new_state.compound_assign(fact)]=instance.facts.size(); + instance.facts.length++; + instance.facts.str_vector.push_back(new_state.compound_assign(fact)); + } ttwo_comm.barrier(); gettimeofday(&t22,NULL); total_task2+=(t22.tv_sec-t21.tv_sec)*1000.0+(t22.tv_usec-t21.tv_usec)/1000.0; diff --git a/src/main.cpp b/src/main.cpp index 9c8296f..a174b0f 100755 --- a/src/main.cpp +++ b/src/main.cpp @@ -571,7 +571,7 @@ int main(int argc, char *argv[]) { gettimeofday(&tf2,NULL); double tdiff2=(tf2.tv_sec-ts1.tv_sec)*1000.0+(tf2.tv_usec-ts1.tv_usec)/1000.0; std::cout<< "Node " << world.rank() << " finished db connection\n" << std::endl; - std::cout << "Initialization and Connecting to DB took " << tdiff2 << " for Process " << world.rank() << std::endl; + std::cout << "Initialization and Connecting to DB took " << tdiff2 << " ms for Process " << world.rank() << std::endl; //printf("Initialization and Connecting to DB took %lf ms for this process. \n",tdiff2); printf("\n"); } diff --git a/src/mpi/tasks.cpp b/src/mpi/tasks.cpp index ddff2c8..dd0077f 100644 --- a/src/mpi/tasks.cpp +++ b/src/mpi/tasks.cpp @@ -166,6 +166,7 @@ void task_two(AGGenInstance &instance, int alloc, int two_alloc, boost::mpi::com world.recv(mpi::any_source, 40, current_state); std::cout << "Process " << world.rank() << " received Task 1 data." << std::endl; + std::cout << "Appl exploit size " << appl_exploits.size() << std::endl; std::vector> partial_appl_exploits; if(ttwo_comm.size() > 1) @@ -247,7 +248,7 @@ void task_two(AGGenInstance &instance, int alloc, int two_alloc, boost::mpi::com break; } } - + std::cout << "Sync exploit size " << sync_exploits.size() << std::endl; for(auto sync_itr=sync_exploits.begin(); sync_itr!=sync_exploits.end(); sync_itr++){ e = *sync_itr; exploit = std::get<0>(e); @@ -284,12 +285,21 @@ void task_two(AGGenInstance &instance, int alloc, int two_alloc, boost::mpi::com instance.facts.str_vector.push_back(new_state.compound_assign(fact)); for (int w = 0; w < world.size(); w++) { - if(w != 1 + alloc && w > two_alloc) + if(w < 1 + alloc && w > two_alloc) { world.isend(w, 3, new_state); world.isend(w, 4, fact); } } + //Update ttwo_comm Nodes + if (ttwo_comm.size() > 1){ + for (int t = 0; t < ttwo_comm.size(); t++){ + if (t != ttwo_comm.rank()){ + ttwo_comm.isend(t, 3, new_state); + ttwo_comm.isend(t, 4, fact); + } + } + } } } break;