Open MPI logo

Open MPI User's Mailing List Archives

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

Subject: [OMPI users] Fortran - MPI_WORLD_COMM
From: Mihaly Mezei (Mihaly.Mezei_at_[hidden])
Date: 2010-06-22 17:55:32


I used mpich earlier, where I could get the value of MPI_WORLD_COMM in the main program and pass it to subroutines via a common block (as the MPI_WORLD_COMM is assumed to be an integer and I even was able to confirm that it is declared to be an integer in mpif-common.h). However, openmpi does not allow putting MPI_WORLD_COMM into a common block:

mpi0.f(2): error #6414: This PARAMETER constant name is invalid in this context. [MPI_COMM_WORLD]
mpi0.f(21): error #6412: A dummy argument name is invalid in this context. [MPI_COMM_WORLD]

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

What is the correct way to pass the communiator to a subroutine in Fortra90/openmpi?


Mihaly Mezei

Department of Structural and Chemical Biology, Mount Sinai School of Medicine
Voice: (212) 659-5475 Fax: (212) 849-2456
WWW (MSSM home):
WWW (Lab home - software, publications):
WWW (Department):