Cypress CSC-1200T Guia do Utilizador Página 73

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 124
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 72
Chapter 7. Interprocess communication 73
7.4.3 Point-to-point communication
Point-to-point communication is the most widely occuring form of data
transfer in parallel computing in shared-memory computers. There are
two basic routines for this purpose in the SHMEM library, shmem_get
and shmem_put. Since SHMEM routines are one-sided, only one of these
is needed to transfer data.
shmem_get
The C language syntax of a call to shmem_get is
void shmem_get(void *target, void *source, int len, int pe);
For Fortran 90, the syntax is
INTEGER :: len, pe
CALL SHMEM_GET(target, source, len, pe)
The routine shmem_get copies data of length len (in 8-byte words) from
the memory of PE pe. The copying is started at address source in this
PE, and the data is moved to the address target in the calling PE’s
memory. The calling PE is blocked during the transfer, i.e., it waits until
the transfer is finished before moving on to the next command in the
program.
shmem_put
The C syntax of a call to shmem_put is
void shmem_put(void *target, void *source, int len, int pe);
For Fortran 90 the syntax is
INTEGER :: len, pe
CALL SHMEM_PUT(target, source, len, pe)
The routine shmem_put copies data of length len (in 8-byte words) from
the memory of the calling PE starting at address source to address
target in the memory of PE pe. The calling PE is not blocked during
the transfer, but it continues with the program as soon as the transfer
is initiated. Therefore, the programmer should consider using some
synchronizing routine such as shmem_wait.
In terms of efficiency, there is not much difference between shmem_put
and shmem_get. For faster performance one should try to concentrate
data transfers into as few and large blocks of data as possible. Having
len a multiple of 8 is optimal for these routines.
Vista de página 72
1 2 ... 68 69 70 71 72 73 74 75 76 77 78 ... 123 124

Comentários a estes Manuais

Sem comentários