35
36
37
38
39
40 USE spmd_comm_world_mod, ONLY : spmd_comm_world
41#include "implicit_f.inc"
42
43
44
45#include "spmd.inc"
46
47
48
49#include "com01_c.inc"
50#include "com04_c.inc"
51#include "task_c.inc"
52
53
54
55 INTEGER ICSIZE, LJOINT(*),FR_CJ(*), IADCJ(NSPMD+1,*),
56 . TAG_LNK_SMS(*)
58 . a(3,*)
59
60
61
62#ifdef MPI
63 INTEGER MSGTYP,MSGOFF,IERROR,LOC_PROC,NOD,L,I,J,N,
64 . IDEB,IAD,SIZ,A_AR,NBINDEX,
65 . INDEXI(NSPMD),REQ_S(NSPMD),STATUS(MPI_STATUS_SIZE),
66 . LEN(NSPMD)
67 parameter(a_ar = 3)
69 . buf(icsize*a_ar)
70 DATA msgoff/103/
71
72
73
74 loc_proc = ispmd + 1
75 IF (loc_proc==1) THEN
76 l = 0
77 ideb = 1
78
79 DO i = 2, nspmd
80 len(i)=0
81 DO n=1,njoint
82 IF(tag_lnk_sms(n)/=0)
83 . len(i) = len(i)+iadcj(i+1,n)-iadcj(i,n)
84 END DO
85 IF(len(i)>0) THEN
86 l=l+1
87 indexi(l)=i
88 DO n=1,njoint
89 IF(tag_lnk_sms(n)==0)cycle
90 DO j = iadcj(i,n), iadcj(i+1,n)-1
91 nod = fr_cj(j)
92 buf(ideb ) = a(1,nod)
93 buf(ideb+1) = a(2,nod)
94 buf(ideb+2) = a(3,nod)
95 ideb = ideb + a_ar
96 END DO
97 END DO
98 END IF
99 END DO
100 nbindex = l
101
102 ideb = 1
103
104 DO l=1,nbindex
105 i = indexi(l)
106 siz = len(i)*a_ar
107 msgtyp = msgoff
109 s buf(ideb),siz,real,it_spmd(i),msgtyp,
110 g spmd_comm_world,req_s(l),ierror)
111 ideb = ideb + siz
112 END DO
113
114 DO l=1,nbindex
116 ENDDO
117 ELSEIF(icsize>0) THEN
118
119 ideb = 1
120 siz = icsize*a_ar
121 msgtyp = msgoff
123 s buf,siz,real,it_spmd(1),msgtyp,
124 g spmd_comm_world,status,ierror)
125 DO n = 1, njoint
126 IF(tag_lnk_sms(n)==0)cycle
127 DO j = iadcj(1,n),iadcj(nspmd+1,n)-1
128 nod = fr_cj(j)
129 a(1,nod) = buf(ideb)
130 a(2,nod) = buf(ideb+1)
131 a(3,nod) = buf(ideb+2)
132 ideb = ideb + a_ar
133 END DO
134 END DO
135 END IF
136
137#endif
138 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)