include("../../include/msg-header.inc"); ?>
From: Rainer Keller (keller_at_[hidden])
Date: 2007-05-14 15:25:34
Hello Jay,
On Monday 14 May 2007 20:29, Jayanta Roy wrote:
> 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)
If You really are doing above, then no one would participate in this
operation, but
> MPI_Reduce(corrbuf,corr_sum,CORR_SIZE,MPI_FLOAT,MPI_SUM,0,MPI_COMM_G1);
> if(myrank = 2 || myrank == 3)
^^^
every one would particpate here (as myrank=2 != 0)
And then the reduce with processes not belonging to it would fail.
> 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?
Just to make sure, the below runs fine.
Please always compile with -Wall or similar compiler-flags.
With best regards,
Rainer
-- ---------------------------------------------------------------- Dipl.-Inf. Rainer Keller http://www.hlrs.de/people/keller High Performance Computing Tel: ++49 (0)711-685 6 5858 Center Stuttgart (HLRS) Fax: ++49 (0)711-685 6 5832 POSTAL:Nobelstrasse 19 email: keller_at_[hidden] ACTUAL:Allmandring 30, R.O.030 AIM:rusraink 70550 Stuttgart