Fixing Task 2 bounds

This commit is contained in:
Noah L. Schrick 2022-01-29 17:38:34 -06:00
parent 2156e30c57
commit 6a6893fc21
2 changed files with 3 additions and 2 deletions

Binary file not shown.

View File

@ -449,7 +449,7 @@ AGGenInstance &AGGen::generate(bool batch_process, int batch_size, int numThrd,
//Execute Task 2
//if(world.rank() == send_check(world, alloc) && world.rank() <= send_check(world, 2*two_alloc))
if(world.rank() == send_check(world, alloc) && world.rank() <= (2*two_alloc))
if(world.rank() >= send_check(world, alloc) && world.rank() <= (2*two_alloc))
{
//Execute Task 2
struct timeval t21,t22;
@ -467,7 +467,7 @@ AGGenInstance &AGGen::generate(bool batch_process, int batch_size, int numThrd,
if(ttwo_comm.rank() == 0){
for (int w = 0; w < world.size(); w++)
{
if(w != world.rank() && w > send_check(world, 2*two_alloc))
if(w < world.rank() || w > (2*two_alloc))
{
world.isend(w, 2, 1);
}
@ -527,6 +527,7 @@ AGGenInstance &AGGen::generate(bool batch_process, int batch_size, int numThrd,
//Receive the message so it doesn't just sit there
int ttwo_done;
world.recv(mpi::any_source, 2, ttwo_done);
std::cout << "Else nodes received task 2 completion message." << std::endl;
}
//Task Four