MPI_COMM_WORLD is defined by a parameter statement, so it
is a fortran contant. The following f77 program fails to compile.

> cat ts_param.f 
      Program test
      integer mm
      parameter (mm = 9)
      common /cmblk/ mm
      end
> gfortran ts_param.f
ts_param.f:4.23:

      common /cmblk/ mm                                                 
                       1
Error: PARAMETER attribute conflicts with COMMON attribute in 'mm' at (1)
> ifort ts_param.f                                           
ts_param.f(4): error #6414: This PARAMETER constant name is invalid in this 
context.   [MM]
      common /cmblk/ mm
---------------------^
compilation aborted for ts_param.f (code 1)

Don't think you can do that with either MPICH2 or OpenMPI.
Since MPI_COMM_WORLD is a constant, why do you want to put it
in a common block ?

A.Chan

----- "Jeff Squyres" <jsquy...@cisco.com> wrote:

> On Jun 22, 2010, at 5:55 PM, Mihaly Mezei wrote:
> 
> > mpi0.f(2): error #6414: This PARAMETER constant name is invalid in
> this context.   [MPI_COMM_WORLD]
> >       common /MPI_DM/ MPI_COMM_WORLD,NUMNOD,MYRANK
> > ----------------------^
> > mpi0.f(21): error #6412: A dummy argument name is invalid in this
> context.   [MPI_COMM_WORLD]
> >       common /MPI_DM/ MPI_COMM_WORLD,NUMNOD,MYRANK
> > ----------------------^
> 
> Funky.  I'm not a fortran expert, but I didn't know what you couldn't
> put a parameter in a common block.  I guess that's a difference
> between OMPI and MPICH -- sorry!
> 
> > If I try to pass MPI_WORLD_COMM to a subrotine as one of the
> subroutine argument, it aborts at run time whe it comes to using it in
> an MPI_Bcast call
> > 
> > *** An error occurred in MPI_Bcast
> > *** on communicator MPI_COMM_WORLD
> > *** MPI_ERR_TYPE: invalid datatype
> 
> That shouldn't be.  But it does seem to imply that your passing a bad
> datatype, not a bad communicator.  Can you send a small code example
> that shows the problem?
> 
> -- 
> Jeff Squyres
> jsquy...@cisco.com
> For corporate legal information go to:
> http://www.cisco.com/web/about/doing_business/legal/cri/
> 
> 
> _______________________________________________
> users mailing list
> us...@open-mpi.org
> http://www.open-mpi.org/mailman/listinfo.cgi/users

Reply via email to