.


:




:

































 

 

 

 





int MPI_Gather(void *sbuf, int scount, MPI_Datatype stype, void *rbuf, int rcount, MPI_Datatype rtype, int dest, MPI_Comm comm)

int MPI_Allgather(void *sbuf, int scount, MPI_Datatype stype, void *rbuf, int rcount, MPI_Datatype rtype, int dest, MPI_Comm comm)

int MPI_Allgatherv(void* sendbuf, int sendcount, MPI_Datatype sendtype, void* recvbuf, int *recvcounts, int *displs, MPI_Datatype recvtype, MPI_Comm comm)

rbuf dest. , dest, sbuf dest. rbuf, . rbuf , count, datatype dest .

allgather allgatherv . 8, 3 3, 3 2 . : recvcounts [3] = {3, 3, 2}, displs [3] = {0, 3, 6}.

sbuf -

scount - ; , .

stype -

rbuf -

rcount - ( scount)

rtype -

dest - ,

recvcounts ,

displs

comm -

:

#define N 10 #define PROCS 5 int buf[N],buf1[N/PROCS],size; MPI_Gather(buf1,N/PROCS,MPI_INT, buf,N/PROCS,MPI_INT,0,MPI_COMM_WORLD);

 

int MPI_Barrier(MPI_Comm comm)

, , , comm .

comm -

:

MPI_Barrier(MPI_COMM_WORLD);

 

int MPI_Reduce (void *sbuf, void *rbuf, int count, MPI_Datatype stype; MPI_Op op, int dest, MPI_Comm comm)

int MPI_Allreduce (void *sbuf, void *rbuf, int count, MPI_Datatype stype; MPI_Op op, MPI_Comm comm)

. buf count. op. - dest. allreduce .

sbuf -

rbuf -

count - /

stype -

op - ,

dest - ,

comm -

:

  • MPI_MAX
  • MPI_MIN
  • MPI_SUM
  • MPI_PROD

:

#define N 10 int v[N],u[N]; MPI_Reduce(v,u,N,MPI_INT,MPI_SUM,0,MPI_COMM_WORLD);

1. .., .. . :. -, 2002, 608. (2- 2004)

2. .., .. MPI: . .: , 2002. -323 .

3. ... MPI: . .: - , 2004.-71 .





:


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


:

:

, , . , .
==> ...

1585 - | 1420 -


© 2015-2024 lektsii.org - -

: 0.011 .