Skip to content

Conversation

@nathanweeks
Copy link
Contributor

Given following program:

program test_spawn
   use mpi_f08
   implicit none

   character(len=:), allocatable  :: command
   integer :: command_length, rank
   type(MPI_Comm) :: intercomm, parent

   call get_command_argument(number=0, length=command_length)
   allocate(character(len=command_length) :: command)
   call get_command_argument(number=0, value=command)

   call MPI_Init
   call MPI_Comm_get_parent(parent=parent)
   if (parent == MPI_COMM_NULL) then
      call MPI_Comm_spawn(command=command, argv=MPI_ARGV_NULL, maxprocs=2, info=MPI_INFO_NULL, root=0, &
                         comm=MPI_COMM_WORLD, intercomm=intercomm, array_of_errcodes=MPI_ERRCODES_IGNORE)
      write(unit=*, fmt='(*(g0))') 'parent'
   else
      call MPI_Comm_rank(comm=MPI_COMM_WORLD, rank=rank)
      write(unit=*, fmt='(*(g0))') 'child ', rank
   end if
   call MPI_Finalize
end program test_spawn

gfortran 7.1.0 emits the following error:

$ mpifort test_spawn.f90

                           comm=MPI_COMM_WORLD, intercomm=intercomm, array_of_errcodes=MPI_ERRCODES_IGNORE)
                                                                                                          1
Error: There is no specific subroutine for the generic 'mpi_comm_spawn' at (1)

Per MPI 3.1, the data type of the array_of_errcodes argument is:

INTEGER :: array_of_errcodes(*)

Changing the data type of the mpi_f08 version of MPI_ERRCODES_IGNORE from "integer" to "integer, dimension(1)" seems to resolve the issue:

$ mpifort -o test_spawn.x test_spawn.f90 
$ mpiexec -n 1 -mca btl self,tcp ./test_spawn.x
child 0
child 1
parent

@ompiteam-bot
Copy link

Can one of the admins verify this patch?

@ggouaillardet
Copy link
Contributor

Thanks for the patch !

can you please sign-off your commit ?
first make sure you understand what it means (IANAL), and then you can

git commit --amend -s
git push --force issue/f08_mpi_errcodes_ignore <your remote repository>

Signed-off-by: Nathan T. Weeks <weeks@iastate.edu>
@nathanweeks
Copy link
Contributor Author

Done.

@rhc54
Copy link
Contributor

rhc54 commented Jan 7, 2018

ok to test

@artpol84
Copy link
Contributor

bot:mellanox:retest

1 similar comment
@artpol84
Copy link
Contributor

bot:mellanox:retest

Copy link
Member

@jsquyres jsquyres left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch -- thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants