Qlogic OFED+ Host Specifikace Strana 150

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 204
  • Tabulka s obsahem
  • ŘEŠENÍ PROBLÉMŮ
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 149
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
Zobrazit stránku 149
1 2 ... 145 146 147 148 149 150 151 152 153 154 155 ... 203 204

Komentáře k této Příručce

Žádné komentáře