Thank to you also Gus for replying.
All of your tips helped.

Thanks

Trent
> Date: Tue, 26 May 2009 20:50:38 -0400
> From: gus@ldeo.columbia.edu
> To: users@open-mpi.org
> Subject: Re: [OMPI users] MPI_COMM_WORLD Error
>
> Hi Trent, list
>
> mtcreekmore@broncs.utpa.edu wrote:
> > Thanks for your reply Eugene.
> >
> >
> >
> > Here is the result of the mpif90 -showme
> >
> >
> > /state/partition1/apps/intel/fce/10.1.015/bin/ifort
> > -I/share/apps/openmpi-1.2.6-intel/include -pthread
> > -I/share/apps/openmpi-1.2.6-intel/lib -L/usr/pbs/lib
> > -L/share/apps/openmpi-1.2.6-intel/lib -lmpi_f90 -lmpi_f77 -lmpi
> > -lopen-rte -lopen-pal -lrt -lpbs -lnuma -ldl -Wl,--export-dynamic -lnsl
> > -lutil
> >
> >
> > The mpif.h file I got off the site. I used the Google "site: mcs.anl.gov
> > <http://www.mcs.anl.gov/research/projects/mpi/usingmpi/examples/simplempi/main.htm> mpif.h"
> > search and placed it into the same directory as the main program.
> >
>
>
> Then you are using the MPICH mpif.h file, not the OpenMPI one,
> and the mix is probably the reason for the error.
> You can/should remove it from the directory where your pi.f program is.
>
> Actually, if you use the OpenMPI wrappers to compile,
> they know exactly where to find the right mpif.h,
> i.e., to compile pi.f just do "mpif90 pi.f".
>
> Make sure your PATH is points to the OpenMPI executables (mpif90,
> mpiexec, etc) ahead of other flavors of MPI that may be installed on
> your system. Or simply use the full path names to the OpenMPI mpif90
> and to mpiexec. Inadvertent mix of these executables
> from different MPIs is a common source of frustration too.
>
> I hope this helps,
> Gus Correa
> ---------------------------------------------------------------------
> Gustavo Correa
> Lamont-Doherty Earth Observatory - Columbia University
> Palisades, NY, 10964-8000 - USA
> ---------------------------------------------------------------------
>
>
>
> > So if it is the correct one, I am not sure.
> >
> > Trent
> >
> >
> >
> > ------------------------------------------------------------------------
> > Date: Tue, 26 May 2009 16:54:02 -0700
> > From: Eugene.Loh@Sun.COM
> > To: users@open-mpi.org
> > Subject: Re: [OMPI users] MPI_COMM_WORLD Error
> >
> > mtcreekmore@broncs.utpa.edu <mailto:mtcreekmore@broncs.utpa.edu> wrote:
> >
> >
> > I and new to OpenMPI and have looked for this, but not getting
> > anywhere.
> >
> > I got an example program off this site:
> >
> > The compute PI in Fortran example.
> > http://www.mcs.anl.gov/research/projects/mpi/usingmpi/examples/simplempi/main.htm
> >
> > Compiled it with "mpif90" and no errors.
> > Then used the qsub -I and tried both executing directly and "mpirun"
> > and still receive these errors:
> >
> > [MGT-2-1:02994] *** An error occurred in MPI_Comm_rank
> > [MGT-2-1:02994] *** on communicator MPI_COMM_WORLD
> > [MGT-2-1:02994] *** MPI_ERR_COMM: invalid communicator
> > [MGT-2-1:02994] *** MPI_ERRORS_ARE_FATAL (goodbye)
> >
> > Any guidance in the right direction would be appreciated.
> >
> > First, the example works fine for me.
> >
> > You seem to be bombing in MPI_Comm_rank and before it asks you for any
> > input. I guess it's having problems with the MPI_COMM_WORLD
> > communicator being passed to MPI_Comm_rank? Maybe it's having problems
> > finding the mpif.h include file? It's finding *some* mpif.h include
> > file, but presumably not the right one. Make sure the mpif90 and mpirun
> > commands are the ones you think you should be getting and, if they are,
> > try adding -showme to the mpif90 line to see where it's looking for the
> > mpif.h include file.
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > users mailing list
> > users@open-mpi.org
> > http://www.open-mpi.org/mailman/listinfo.cgi/users
>
> _______________________________________________
> users mailing list
> users@open-mpi.org
> http://www.open-mpi.org/mailman/listinfo.cgi/users