Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

Subject: Re: [OMPI users] wrong rank and process number
From: Ralph Castain (rhc_at_[hidden])
Date: 2009-10-22 16:48:43


If you google this list for entries about ubuntu, you will find a
bunch of threads discussing problems on that platform. This sounds
like one of the more common ones - I forget all the issues, but most
dealt with ubuntu coming with a very old OMPI version on it, and
issues with ensuring your path and ld_library_path are pointing to the
correct distribution. Also believe there are issues with figuring out
we are launching locally and other such things.

On Oct 22, 2009, at 1:40 PM, Victor Rosas Garcia wrote:

> Hello everybody,
>
> I have just installed openmpi v. 1.2.5 under ubuntu 8.04 and I have
> compiled the following "hello world" program:
>
> ------start code------
> #include <stdio.h>
> #include <mpi.h>
>
> int main(int argc, char *argv[]){
> int rank, size, len;
> char hostname[256] = "";
>
> MPI_Init(&argc, &argv);
> MPI_Comm_rank(MPI_COMM_WORLD, &rank);
> MPI_Comm_size(MPI_COMM_WORLD, &size);
> MPI_Get_processor_name(hostname, &len);
>
> printf("Hello World! I am %d of %d running on %s\n",
> rank, size, hostname);
>
> MPI_Finalize();
>
> return 0;
> }
> ------end code------
>
> which I think is pretty basic stuff. Anyway, when I run it (single
> node, three cores), I get the following output:
>
> mpiexec.openmpi -np 6 hello
>
> Hello World! I am 0 of 1 running on el-torito
> Hello World! I am 0 of 1 running on el-torito
> Hello World! I am 0 of 1 running on el-torito
> Hello World! I am 0 of 1 running on el-torito
> Hello World! I am 0 of 1 running on el-torito
> Hello World! I am 0 of 1 running on el-torito
>
> where "el-torito" is the hostname. Shouldn't it be something like?:
> Hello World! I am 0 of 6 running on el-torito
> Hello World! I am 1 of 6 running on el-torito
> Hello World! I am 2 of 6 running on el-torito
> ...
> etc.
>
> Any ideas as to why I keep getting wrong numbers for rank and number
> of processes?
>
> Greetings from Monterrey, Mexico
> --
> Victor M. Rosas García
> _______________________________________________
> users mailing list
> users_at_[hidden]
> http://www.open-mpi.org/mailman/listinfo.cgi/users