Push new data to all nodes from Task 2

This commit is contained in:
Noah L. Schrick 2022-01-30 19:51:21 -06:00
parent 1e2f5ca9ad
commit bf397e3996
2 changed files with 2 additions and 10 deletions

Binary file not shown.

View File

@ -286,23 +286,15 @@ void task_two(AGGenInstance &instance, int alloc, int two_alloc, boost::mpi::com
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));
//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 < 1 + alloc && w > two_alloc) if(w != world.rank())
{ {
world.isend(w, 3, new_state); world.isend(w, 3, new_state);
world.isend(w, 4, fact); 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; break;