[mpich-discuss] Fatal error in PMPI_Comm_rank
Pavan Balaji
balaji at mcs.anl.gov
Thu Feb 24 20:57:06 CST 2011
The below program works for me.
#include <stdio.h>
#include "mpi.h"
int main(int argc, char *argv[])
{
int rank, size, err;
MPI_Init(&argc, &argv);
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
MPI_Comm_size(MPI_COMM_WORLD, &size);
MPI_Finalize();
return 0;
}
-- Pavan
On 02/24/2011 08:52 PM, Hong-Jun Kim wrote:
> int main( int argc, char *argv[] )
> {
> int rank, size, err;
> MPI_Init(&argc,&argv);
> MPI_Comm_rank(MPI_COMM_WORLD,&rank);
> MPI_Comm_size(MPI_COMM_WORLD,&size);
> ....
> }
>
> I am currently using MPI_COMM_WORLD communicator as above.
> Can I ask how I can change the communicator to remove the error?
> Thanks.
>
> -----------------------------
> Hong-Jun Kim
> Post-doc researcher
> MCS, Argonne National Laboratory
> 9700 S. Cass Ave. B240/R2147
> Argonne, IL 60439
> 630-252-4791
> hongjun at mcs.anl.gov
> -----------------------------
>
> ----- Original Message -----
> From: "Pavan Balaji"<balaji at mcs.anl.gov>
> To: mpich-discuss at mcs.anl.gov
> Cc: "Hong-Jun Kim"<hongjun at mcs.anl.gov>
> Sent: Thursday, February 24, 2011 7:33:19 PM
> Subject: Re: [mpich-discuss] Fatal error in PMPI_Comm_rank
>
>
> On 02/24/2011 07:29 PM, Hong-Jun Kim wrote:
>> I compiled my program with "mpich2-1.3.2p1" without any problems as at the end of this e-mail.
>> But, if I execute it, I have some errors I can not understand as follows.
>> Could any body give me any advice about this problem?
>
> To state the obvious, looks like you are trying to find the rank in an
> invalid communicator :-).
>
> -- Pavan
>
--
Pavan Balaji
http://www.mcs.anl.gov/~balaji
More information about the mpich-discuss
mailing list