On Feb 28, 2006, at 7:00 PM, George Bosilca wrote:

I run in the same kind of troubles few days ago with a f90 code.
After banging my head against all solid objects around my office, I
switched to vim (it doesn't make sense yet ...). And suddenly I saw
the light !!! F90 inherit from F77 one of it's most "ancient"
feature. The limit on the number of chars one can put on a line of
code, and this limit is a 79 by default (and don't forget the first 7
chars that have a special meaning).

I'm sorry I don't understand what you are saying. Are you saying that when using "free source form" Fortran 90 code that the default line length of 132 characters is ignored when compiling MPI function calls? I know for a fact this is not true in general and very much doubt that this is the case here.

More likely is a missing interface for MPI_Comm_Spawn in OpenMPI 1.0.1

In case you're not aware of the difference between "fixed source form" and "free source form" Fortran 90 code (1) "fixed source form" source code has the extension .f with most compilers and has to meet the requirements of Fortran 77, that is 80 line length, source code starts at position 7, the continuation is anything in column 6 except 0, officially a comment marker is C or * in column 1 or ! anywhere except column 6, (2) "free source form" source code has the extension .f90 with most compilers, line length is 132 characters, source code can start in any position, the continuation character is a trailing &, the comment marker is !. Also "fixed source form" ignores spaces except in character strings, i.e. SIN(X) and S I N ( X ) are the same.

Most of the compilers have
special flags to remove this limit but they are not enabled by default.

Now, if I copy and paste your code in my vim ... everything after
"universe_size-1" is over the limit. Rewrite the line as

      call MPI_Comm_spawn('subprocess', MPI_ARGV_NULL,
universe_size-1, &
MPI_INFO_NULL, 0, MPI_COMM_WORLD, slavecomm, &
                          MPI_ERRCODES_IGNORE, ierr )

and everything should work just fine.

Just as a test I did this, no effect.  The error remains.

Michael


   george.

PS: Use vim and the force will be with you. You have a similar
problem down in the MPI_RECV call.

On Feb 28, 2006, at 6:13 PM, Michael Kluskens wrote:

Using OpenMPI 1.0.1 compiled with g95 on OS X (same problem on Debian
Linux with g95, I have not tested other compilers yet)

mpif90 spawn.f90 -o spawn
In file spawn.f90:35

     MPI_COMM_WORLD, slavecomm, MPI_ERRCODES_IGNORE, ierr )
                                                           1
Error: Generic subroutine 'mpi_comm_spawn' at (1) is not consistent
with a specific subroutine interface
make: *** [spawn] Error 1

I can't see the problem with the following, all the arguments match
the info presented in the book "Using MPI-2" page 236:

   call MPI_Comm_spawn('subprocess', MPI_ARGV_NULL, universe_size-1,
MPI_INFO_NULL, 0, &
     MPI_COMM_WORLD, slavecomm, MPI_ERRCODES_IGNORE, ierr )

the entire test program follows:

program main
   USE MPI
   implicit none
   integer :: ierr,size,rank,slavecomm
   integer  (kind=MPI_ADDRESS_KIND) :: universe_size
   integer :: status(MPI_STATUS_SIZE)
   logical :: flag
   integer :: ans
   integer :: k

   call MPI_INIT(ierr)
   call MPI_COMM_RANK(MPI_COMM_WORLD,rank,ierr)
   call MPI_COMM_SIZE(MPI_COMM_WORLD,size,ierr)

   if ( size /= 1 ) then
     if ( rank == 0 ) then
       write(*,*) 'Only one master process permitted'
       write(*,*) 'Terminating all but root process'
     else
       call MPI_FINALIZE(ierr)
       stop
     end if
   end if

   call MPI_Comm_get_attr(MPI_COMM_WORLD, MPI_UNIVERSE_SIZE,
universe_size, flag,ierr)
   if ( .not. flag ) then
     write(*,*) 'This MPI does not support UNIVERSE_SIZE.'
     write(*,*) 'How many processes total?'
     read(*,*) universe_size
   else if ( universe_size < 2 ) then
     write(*,*) 'How many processes total?'
     read(*,*) universe_size
   end if
   call MPI_Comm_spawn('subprocess', MPI_ARGV_NULL, universe_size-1,
MPI_INFO_NULL, 0, &
     MPI_COMM_WORLD, slavecomm, MPI_ERRCODES_IGNORE, ierr )

   do k = 1, universe_size-1
     write(*,*) 'master receiving'
     call MPI_RECV( ans, 1, MPI_INTEGER, MPI_ANY_SOURCE, MPI_ANY_TAG,
slavecomm, status, ierr )
     write(*,*) 'answer=',ans,' from alpha',k
   end do

   call MPI_COMM_FREE(slavecomm,ierr)

   call MPI_FINALIZE(ierr)
end

_______________________________________________
users mailing list
us...@open-mpi.org
http://www.open-mpi.org/mailman/listinfo.cgi/users

"Half of what I say is meaningless; but I say it so that the other
half may reach you"
                                   Kahlil Gibran


_______________________________________________
users mailing list
us...@open-mpi.org
http://www.open-mpi.org/mailman/listinfo.cgi/users


Reply via email to