Buffer variables

This commit is contained in:
Noah L. Schrick 2022-02-08 18:17:53 -06:00
parent e639ade004
commit 52aed47d00

View File

@ -1247,7 +1247,9 @@ AGGenInstance &AGGen::sg_generate(bool batch_process, int batch_num, int numThrd
int send_msg = 0; int send_msg = 0;
int state_count = 0; int state_count = 0;
int first_loop = 1; 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::random_device rd; // obtain a random number from hardware
std::mt19937 gen(rd()); // seed the generator 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<Factbase>().swap(instance.factbases); std::vector<Factbase>().swap(instance.factbases);
std::vector<Edge>().swap(instance.edges); std::vector<Edge>().swap(instance.edges);
std::vector<FactbaseItems>().swap(instance.factbase_items); std::vector<FactbaseItems>().swap(instance.factbase_items);
NetworkState current_state; NetworkState current_state;
world.recv(0, 1, current_state); world.recv(0, 1, current_state);
state_count = 0; 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.hash_table[new_state.compound_assign(fact)]=instance.facts.size();
instance.facts.length++; instance.facts.length++;
instance.facts.str_vector.push_back(new_state.compound_assign(fact)); 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 //Update ALL nodes (include ttwo_comm nodes) with new data
for (int w = 0; w < world.size(); w++) for (int w = 0; w < world.size(); w++)
{ {
if(w != world.rank() && w != 1) if(w != world.rank() && w != 1)
{ {
mpi::request ns_req = world.isend(w, 5, new_state); mpi::request ns_req = world.isend(w, 5, buffer_state);
mpi::request fact_req = world.isend(w, 6, fact); mpi::request fact_req = world.isend(w, 6, buffer_fact);
//ns_req.wait(); //ns_req.wait();
//fact_req.wait(); //fact_req.wait();
} }