From 52aed47d008d2cce2b2f186cf752b9d901a21f10 Mon Sep 17 00:00:00 2001 From: noah Date: Tue, 8 Feb 2022 18:17:53 -0600 Subject: [PATCH] Buffer variables --- src/ag_gen/ag_gen.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/ag_gen/ag_gen.cpp b/src/ag_gen/ag_gen.cpp index 3654b98..6448d39 100755 --- a/src/ag_gen/ag_gen.cpp +++ b/src/ag_gen/ag_gen.cpp @@ -1247,7 +1247,9 @@ AGGenInstance &AGGen::sg_generate(bool batch_process, int batch_num, int numThrd int send_msg = 0; int state_count = 0; int first_loop = 1; - int msg_sends = 0; + int msg_sends = 0; + NetworkState buffer_state; + Quality buffer_fact; std::random_device rd; // obtain a random number from hardware std::mt19937 gen(rd()); // seed the generator @@ -1295,7 +1297,7 @@ AGGenInstance &AGGen::sg_generate(bool batch_process, int batch_num, int numThrd std::vector().swap(instance.factbases); std::vector().swap(instance.edges); std::vector().swap(instance.factbase_items); - + NetworkState current_state; world.recv(0, 1, current_state); state_count = 0; @@ -1445,14 +1447,16 @@ AGGenInstance &AGGen::sg_generate(bool batch_process, int batch_num, int numThrd 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)); + buffer_state = new_state; + buffer_fact = fact; //Update ALL nodes (include ttwo_comm nodes) with new data for (int w = 0; w < world.size(); w++) { if(w != world.rank() && w != 1) { - mpi::request ns_req = world.isend(w, 5, new_state); - mpi::request fact_req = world.isend(w, 6, fact); + mpi::request ns_req = world.isend(w, 5, buffer_state); + mpi::request fact_req = world.isend(w, 6, buffer_fact); //ns_req.wait(); //fact_req.wait(); }