.


:




:

































 

 

 

 





, , . , , - , . , , , () . , var ( ), , , SUM , . .

MPI :

  • (MPI_Reduce).
  • (MPI_Allreduce).
  • , . i- i (MPI_Scan).
  • Reduce/Scatter (MPI_Reduce_scatter).

MPI_Reduce . , op, , root. ..

:

int MPI_Reduce(void* sendbuf, void* recvbuf, int count, MPI_Datatype datatype,

MPI_Op op, int root, MPI_Comm comm)

 

IN sendbuf - ;
OUT recvbuf - ( - root);
IN count - ;
IN datatype - ;
IN op - , ;
IN root - - ;
IN comm - .

. 4.8 Reduce. "+" .

. 4.8. Reduce.

op , , . . , , . . datatype op. 4.1 , MPI.

4.1. MPI
MPI_MAX MPI_MIN C integer, FORTRAN integer, Floating point</TD< tr>
MPI_SUM MPI_PROD C integer, FORTRAN integer, Floating point, Complex</TD< tr>
MPI_LAND MPI_LOR MPI_LXOR AND OR OR C integer, Logical</TD< tr>
MPI_BAND MPI_BOR MPI_BXOR AND OR OR C integer, FORTRAN integer, Byte</TD< tr>
MPI_MAXLOC MPI_MINLOC </TD< tr>

:

C integer: MPI_INT, MPI_LONG, MPI_SHORT, MPI_UNSIGNED_SHORT, MPI_UNSIGNED, MPI_UNSIGNED_LONG
Floating point: MPI_FLOAT, MPI_DOUBLE, MPI_REAL, MPI_DOUBLE_PRECISION, MPI_LONG_DOUBLE
Logical: MPI_LOGICAL
Complex: MPI_COMPLEX
Byte: MPI_BYTE

MAXLOC MINLOC , : , , . MPI 9 .

C:  
MPI_FLOAT_INT float and int  
MPI_DOUBLE_INT double and int  
MPI_LONG_INT long and int  
MPI_2INT int and int  
MPI_SHORT_INT short and int  
MPI_LONG_DOUBLE_INT long double and int  

 

MPI_Allreduce , root. , , .

:

int MPI_Allreduce(void* sendbuf, void* recvbuf, int count,

MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)

IN sendbuf - ;
OUT recvbuf - ;
IN count - ;
IN datatype - ;
IN op - , ;
IN comm - .

. 4.9 Allreduce.

. 4.9. Allreduce.

MPI_Reduce_scatter .

:

MPI_Reduce_scatter(void* sendbuf, void* recvbuf, int *recvcounts,

MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)

IN sendbuf - ;
OUT recvbuf - ;
IN revcount - , , ;
IN datatype - ;
IN op - , ;
IN comm - .

MPI_Reduce_scatter MPI_Allreduce , , i- i- . , . . 4.10 Reduce_scatter.

. 4.10. Reduce_scatter.

MPI_Scan . , MPI_Allreduce, . i- 0,... i .

:

int MPI_Scan(void* sendbuf, void* recvbuf, int count,

MPI_Datatype datatype, MPI_Op op, MPI_Comm comm)

IN sendbuf -
OUT recvbuf -
IN count -
IN datatype -
IN op - ,
IN comm -

. 4.11 Scan.

. 4.11. Scan.

 





:


: 2016-07-29; !; : 468 |


:

:

- , .
==> ...

1689 - | 1502 -


© 2015-2024 lektsii.org - -

: 0.013 .