32
33
34
35 USE spmd_comm_world_mod, ONLY : spmd_comm_world
36#include "implicit_f.inc"
37#include "spmd.inc"
38
39
40
41#include "task_c.inc"
42#include "com01_c.inc"
43
44
45
46 INTEGER LEN,LENP0
47 integer
48 . v(len),vp0(lenp0),weight(*)
49
50
51
52
53 INTEGER IAD,J,LEN_TMP
54#ifdef MPI
55 INTEGER STATUS(MPI_STATUS_SIZE),IERROR,
56 . MSGTYP,,SIZ,LENP(NSPMD),DISP(NSPMD),
57 . V_TMP(LEN)
58
59 j = 0
60 DO i=1,len
61 IF(weight(i) == 1) THEN
62 j = j + 1
63 v_tmp(j) = v(i)
64 ENDIF
65 ENDDO
66 len_tmp = j
67
69 s len_tmp ,1 ,mpi_integer,
70 r lenp ,1 ,mpi_integer,it_spmd(1),
71 g spmd_comm_world,ierror)
72
73 iad=0
74 IF(ispmd == 0)THEN
75 DO i=1,nspmd
76 disp(i) = iad
77 iad = iad+lenp(i)
78 END DO
79 END IF
80
82 s v_tmp ,len_tmp ,mpi_integer,
83 r vp0 ,lenp ,disp,mpi_integer,it_spmd(1),
84 g spmd_comm_world,ierror)
85#endif
86 RETURN
subroutine mpi_gather(sendbuf, cnt, datatype, recvbuf, reccnt, rectype, root, comm, ierr)
subroutine mpi_gatherv(sendbuf, cnt, datatype, recvbuf, reccnt, displs, rectype, root, comm, ierr)