27.12.2014 Views

QLogic OFED+ Host Software User Guide, Rev. B

QLogic OFED+ Host Software User Guide, Rev. B

QLogic OFED+ Host Software User Guide, Rev. B

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

F–Troubleshooting<br />

<strong>QLogic</strong> MPI Troubleshooting<br />

If you know that an argument can accept a data type that the MPI module does<br />

not explicitly allow, you can extend the interface for yourself. For example, the<br />

following program shows how to extend the interface for mpi_bcast so that it<br />

accepts a character type as its first argument, without losing the ability to accept<br />

an integer type as well:<br />

module additional_bcast<br />

use mpi<br />

implicit none<br />

interface mpi_bcast<br />

module procedure additional_mpi_bcast_for_character<br />

end interface mpi_bcast<br />

contains<br />

subroutine additional_mpi_bcast_for_character(buffer, count,<br />

datatype, & root, comm, ierror)<br />

character*(*) buffer<br />

integer count, datatype, root, comm, ierror<br />

! Call the Fortran 77 style implicit interface to "mpi_bcast"<br />

external mpi_bcast<br />

call mpi_bcast(buffer, count, datatype, root, comm, ierror)<br />

end subroutine additional_mpi_bcast_for_character<br />

end module additional_bcast<br />

program myprogram<br />

use mpi<br />

use additional_bcast<br />

implicit none<br />

character*4 c<br />

integer master, ierr, i<br />

! Explicit integer version obtained from module "mpi"<br />

call mpi_bcast(i, 1, MPI_INTEGER, master, MPI_COMM_WORLD, ierr)<br />

! Explicit character version obtained from module<br />

"additional_bcast"<br />

call mpi_bcast(c, 4, MPI_CHARACTER, master, MPI_COMM_WORLD,<br />

ierr)<br />

end program myprogram<br />

D000046-005 B F-21

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!