Product specifications

Table Of Contents
D–Troubleshooting
QLogic MPI Troubleshooting
D-22 IB6054601-00 H
S
If you know that an argument can accept a data type that the MPI module does
not explicitly allow, you can extend the interface for yourself. For example, the
following program shows how to extend the interface for mpi_bcast so that it
accepts a character type as its first argument, without losing the ability to accept
an integer type as well:
module additional_bcast
use mpi
implicit none
interface mpi_bcast
module procedure additional_mpi_bcast_for_character
end interface mpi_bcast
contains
subroutine additional_mpi_bcast_for_character(buffer, count,
datatype, & root, comm, ierror)
character*(*) buffer
integer count, datatype, root, comm, ierror
! Call the Fortran 77 style implicit interface to "mpi_bcast"
external mpi_bcast
call mpi_bcast(buffer, count, datatype, root, comm, ierror)
end subroutine additional_mpi_bcast_for_character
end module additional_bcast
program myprogram
use mpi
use additional_bcast
implicit none
character*4 c
integer master, ierr, i
! Explicit integer version obtained from module "mpi"
call mpi_bcast(i, 1, MPI_INTEGER, master, MPI_COMM_WORLD, ierr)
! Explicit character version obtained from module
"additional_bcast"
call mpi_bcast(c, 4, MPI_CHARACTER, master, MPI_COMM_WORLD,
ierr)
end program myprogram