34
35
36
37
38
39 USE spmd_comm_world_mod, ONLY : spmd_comm_world
40#include "implicit_f.inc"
41
42
43
44#include "spmd.inc"
45
46
47
48#include "com01_c.inc"
49#include "com04_c.inc"
50#include "task_c.inc"
51
52
53
54 INTEGER ICSIZE, LJOINT(*),FR_CJ(*), IADCJ(NSPMD+1,*),
55 . TAG_LNK_SMS(*)
57 . ar(3,*),v(3,*),vr(3,*)
58
59
60
61#ifdef MPI
62 INTEGER MSGTYP,MSGOFF,IERROR,LOC_PROC,NOD,L,I,J,N,
63 . IDEB,,SIZ,A_AR,NBINDEX,
64 . INDEXI(NSPMD),REQ_S(NSPMD),STATUS(MPI_STATUS_SIZE),
65 . LEN(NSPMD)
66 parameter(a_ar = 9)
68 . buf(icsize*a_ar)
69 DATA msgoff/102/
70
71
72
73 loc_proc = ispmd + 1
74 IF (loc_proc==1) THEN
75 l = 0
76 ideb = 1
77
78 DO i = 2, nspmd
79 len(i)=0
80 DO n=1,njoint
81 IF(tag_lnk_sms(n)/=0)
82 . len(i) = len(i)+iadcj(i+1,n)-iadcj(i,n)
83 END DO
84 IF(len(i)>0) THEN
85 l=l+1
86 indexi(l)=i
87 DO n=1,njoint
88 IF(tag_lnk_sms(n)==0)cycle
89 DO j = iadcj(i,n), iadcj(i+1,n)-1
90 nod = fr_cj(j)
91 buf(ideb ) = v(1,nod)
92 buf(ideb+1) = v(2,nod)
93 buf(ideb+2) = v(3,nod)
94 buf(ideb+3) = vr(1,nod)
95 buf(ideb+4) = vr(2,nod)
96 buf(ideb+5) = vr(3,nod)
97 buf(ideb+6) = ar(1,nod)
98 buf(ideb+7) = ar(2,nod)
99 buf(ideb+8) = ar(3,nod)
100 ideb = ideb + a_ar
101 END DO
102 END DO
103 END IF
104 END DO
105 nbindex = l
106
107 ideb = 1
108
109 DO l=1,nbindex
110 i = indexi(l)
111 siz = len(i)*a_ar
112 msgtyp = msgoff
114 s buf(ideb),siz,real,it_spmd(i),msgtyp,
115 g spmd_comm_world,req_s(l),ierror)
116 ideb = ideb + siz
117 END DO
118
119 DO l=1,nbindex
121 ENDDO
122 ELSEIF(icsize>0) THEN
123
124 ideb = 1
125 siz = icsize*a_ar
126 msgtyp = msgoff
128 s buf,siz,real,it_spmd(1),msgtyp,
129 g spmd_comm_world,status,ierror)
130 DO n = 1, njoint
131 IF(tag_lnk_sms(n)==0)cycle
132 DO j = iadcj(1,n),iadcj(nspmd+1,n)-1
133 nod = fr_cj(j)
134 v(1,nod) = buf(ideb)
135 v(2,nod) = buf(ideb+1)
136 v(3,nod) = buf(ideb+2)
137 vr(1,nod)= buf(ideb+3)
138 vr(2,nod)= buf(ideb+4)
139 vr(3,nod)= buf(ideb+5)
140 ar(1,nod)= buf(ideb+6)
141 ar(2,nod)= buf(ideb+7)
142 ar(3,nod)= buf(ideb+8)
143 ideb = ideb + a_ar
144 END DO
145 END DO
146 END IF
147
148#endif
149 RETURN
subroutine mpi_recv(buf, cnt, datatype, source, tag, comm, status, ierr)
subroutine mpi_isend(buf, cnt, datatype, dest, tag, comm, ireq, ierr)
subroutine mpi_waitany(cnt, array_of_requests, index, status, ierr)