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,WEIGHT(*)
48 . v(len),vp0(lenp0),v_tmp(len)
49
50
51
52
53 INTEGER IAD,J,LEN_TMP
54#ifdef MPI
55 INTEGER STATUS(MPI_STATUS_SIZE),IERROR,
56 . MSGTYP,I,SIZ,LENP(NSPMD),DISP(NSPMD)
57
58
59
60 j = 0
61 DO i=1,len/6
62 IF(weight(i) == 1) THEN
63 v_tmp(j+1) = v(6*(i-1)+1)
64 v_tmp(j+2) = v(6*(i-1)+2)
65 v_tmp(j+3) = v(6*(i-1)+3)
66 v_tmp(j+4) = v(6*(i-1)+4)
67 v_tmp(j+5) = v(6*(i-1)+5)
68 v_tmp(j+6) = v(6*(i-1)+6)
69 j = j + 6
70 ENDIF
71 ENDDO
72 len_tmp = j
73
75 s len_tmp ,1 ,mpi_integer,
76 r lenp ,1 ,mpi_integer,it_spmd(1),
77 g spmd_comm_world,ierror)
78
79 iad=0
80 IF(ispmd == 0)THEN
81 DO i=1,nspmd
82 disp(i) = iad
83 iad = iad+lenp(i)
84 END DO
85 END IF
86
88 s v_tmp ,len_tmp ,real,
89 r vp0 ,lenp ,disp,real,it_spmd(1),
90 g spmd_comm_world,ierror)
91#endif
92 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)