From: Jayanta Roy (jay.roys_at_[hidden])
Date: 2007-05-14 14:29:18


Hi,

In my 4 nodes cluster I want to run two MPI_Reduce on two communicators (one
using Node1, Node2 and other using Node3, Node4).
Now to create communicator I used ...
MPI_Comm MPI_COMM_G1, MPI_COMM_G2;
MPI_Group g0, g1, g2;
MPI_Comm_group(MPI_COMM_WORLD,&g0);
MPI_Group_incl(g0,g_size,&r_array[0],&g1);
MPI_Group_incl(g0,g_size,&r_array[2],&g2);
MPI_Comm_create(MPI_COMM_WORLD,g1,&MPI_COMM_G1);
MPI_Comm_create(MPI_COMM_WORLD,g2,&MPI_COMM_G2);

And then I used

f(myrank = 0 || myrank == 1)
MPI_Reduce(corrbuf,corr_sum,CORR_SIZE,MPI_FLOAT,MPI_SUM,0,MPI_COMM_G1);
if(myrank = 2 || myrank == 3)
MPI_Reduce(corrbuf,corr_sum,CORR_SIZE,MPI_FLOAT,MPI_SUM,0,MPI_COMM_G2);

But the program terminate because of "An error occurred in MPI_Reduce"!

Can anybody help me, what is the wrong I am doing?