Buffer variables

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

View File

@ -1248,6 +1248,8 @@ AGGenInstance &AGGen::sg_generate(bool batch_process, int batch_num, int numThrd
int state_count = 0;
int first_loop = 1;
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
@ -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();
}