Fixing Task 2 bounds
This commit is contained in:
parent
2156e30c57
commit
6a6893fc21
BIN
build/ag_gen
BIN
build/ag_gen
Binary file not shown.
@ -449,7 +449,7 @@ AGGenInstance &AGGen::generate(bool batch_process, int batch_size, int numThrd,
|
|||||||
|
|
||||||
//Execute Task 2
|
//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() <= 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
|
//Execute Task 2
|
||||||
struct timeval t21,t22;
|
struct timeval t21,t22;
|
||||||
@ -467,7 +467,7 @@ AGGenInstance &AGGen::generate(bool batch_process, int batch_size, int numThrd,
|
|||||||
if(ttwo_comm.rank() == 0){
|
if(ttwo_comm.rank() == 0){
|
||||||
for (int w = 0; w < world.size(); w++)
|
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);
|
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
|
//Receive the message so it doesn't just sit there
|
||||||
int ttwo_done;
|
int ttwo_done;
|
||||||
world.recv(mpi::any_source, 2, ttwo_done);
|
world.recv(mpi::any_source, 2, ttwo_done);
|
||||||
|
std::cout << "Else nodes received task 2 completion message." << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Task Four
|
//Task Four
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user