Cypress CSC-1200T Guía de usuario Pagina 64

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 124
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 63
64 Cray T3E User’s Guide
Correspondingly, for C/C++ programs the format is:
#include <mpi.h>
void sub(...)
{
int return_code;
...
return_code = MPI_Routine(parameter_list);
}
7.2.2 Some MPI routines
The MPI standard includes more than 120 routines. However, one needs
only a few of them for efficient message passing and, at minimum, one
can do with six MPI routines. The most important MPI routines are listed
in Table 7.1 (the Fortran syntax is shown).
The variable comm is often set to the value MPI_COMM_WORLD after initial-
ization. For most applications this is the only communicator. It binds
all processes of a parallel application into a single group. The value of
MPI_COMM_WORLD is defined in the MPI header file mpif.h.
MPI_BCAST and MPI_REDUCE are examples of collective operations. MPI
includes advanced features such as defining application topologies and
derived datatypes.
For more information about a particular MPI routine, issue the com-
mand
man mpi_routine
For example, give the command man mpi_send to find documentation
for the MPI_SEND routine. The manual pages show the C language syn-
tax.
7.2.3 An example of using MPI
Below is a short MPI example program which uses collective communi-
cation to calculate the global sum of task id numbers:
PROGRAM example
IMPLICIT NONE
INCLUDE ’mpif.h’
INTEGER :: ntasks, id, rc, data, s
CALL MPI_INIT(rc)
IF (rc /= MPI_SUCCESS) THEN
WRITE(*,*) ’MPI initialization failed’
STOP
END IF
CALL MPI_COMM_SIZE(MPI_COMM_WORLD, ntasks, rc)
Vista de pagina 63
1 2 ... 59 60 61 62 63 64 65 66 67 68 69 ... 123 124

Comentarios a estos manuales

Sin comentarios