Greetings,
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]
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
----------------------^
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?
Thanks,
regards,
Mihaly Mezei
Department of Structural and Chemical Biology, Mount Sinai School of Medicine
Voice: (212) 659-5475 Fax: (212) 849-2456
WWW (MSSM home):
http://www.mountsinai.org/Find%20A%20Faculty/profile.do?id=0000072500001497192632
WWW (Lab home - software, publications): http://inka.mssm.edu/~mezei
WWW (Department): http://atlas.physbio.mssm.edu