34
35
36
37 USE intbufdef_mod
38
39
40
41 USE spmd_comm_world_mod, ONLY : spmd_comm_world
42#include "implicit_f.inc"
43
44
45
46#include "spmd.inc"
47
48
49
50#include "task_c.inc"
51#include "com01_c.inc"
52#include "com04_c.inc"
53#include "param_c.inc"
54
55
56
57 INTEGER IPARI(NPARI,*),INDSEGLO(*),IBUFSEGLO(*)
58
59 TYPE(INTBUF_STRUCT_) INTBUF_TAB(*)
60
61
62
63#ifdef MPI
64 INTEGER MSGOFF1 ,MSGOFF2, MSGTYP, LOC_PROC,IERROR,REQ_S1(NSPMD),REQ_S2(NSPMD),
65 . STATUS(MPI_STATUS_SIZE)
66 INTEGER RSEGLO(NINTER+1)
67
68 INTEGER NRTM,NG,IND_SEG
69 INTEGER I,SIZ,IAD
70 INTEGER, DIMENSION(:), ALLOCATABLE :: RBUF
71
72 DATA msgoff1/125/
73 DATA msgoff2/126/
74
75
76 loc_proc = ispmd+1
77 DO i = 1, nspmd
78 IF(i/=loc_proc) THEN
79 msgtyp = msgoff1
81 c indseglo,ninter+1,mpi_integer,it_spmd(i),msgtyp,
82 g spmd_comm_world,req_s1(i),ierror)
83
84 siz = indseglo(ninter+1)-indseglo(1)
85 IF(siz>0)THEN
86 msgtyp = msgoff2
88 c ibufseglo,siz,mpi_integer,it_spmd(i),msgtyp,
89 g spmd_comm_world,req_s2(i),ierror)
90 ENDIF
91 ENDIF
92 ENDDO
93
94 DO i = 1, nspmd
95 IF(i/=loc_proc) THEN
96 msgtyp = msgoff1
98 . rseglo,ninter+1,mpi_integer,it_spmd(i),msgtyp,
99 . spmd_comm_world,status,ierror)
100
101 siz = rseglo(ninter+1)-rseglo(1)
102 IF(siz>0)THEN
103 ALLOCATE(rbuf(siz))
104 msgtyp = msgoff2
106 . rbuf,siz,mpi_integer,it_spmd(i),msgtyp,
107 . spmd_comm_world,status,ierror)
108
109 DO ng=1,ninter
110 ind_seg=rseglo(ng+1)-rseglo(ng)
111 iad=rseglo(ng)
112 IF(ind_seg >0)THEN
113 IF(ipari(7,ng)==24)THEN
114 nrtm=ipari(4,ng)
116 . intbuf_tab(ng)%MSEGLO,intbuf_tab(ng)%MVOISIN,2)
117 ELSEIF(ipari(7,ng)==25)THEN
118 nrtm=ipari(4,ng)
120 . intbuf_tab(ng)%MSEGLO,intbuf_tab(ng)%MVOISIN,2)
121 END IF
122 ENDIF
123 ENDDO
124 DEALLOCATE(rbuf)
125 ENDIF
126 ENDIF
127 ENDDO
128
129
130
131 DO i = 1, nspmd
132 IF(i/=loc_proc) THEN
133 CALL mpi_wait(req_s1(i),status,ierror)
134 siz = indseglo(ninter+1)-indseglo(1)
135 IF(siz>0)THEN
136 CALL mpi_wait(req_s2(i),status,ierror)
137 ENDIF
138 ENDIF
139 ENDDO
140
141 RETURN
142#endif
subroutine i24_remove_global_segment(ind_seglo, nind_seglo, nin, nrtm, mseglo, mvoisin, flag)
subroutine i25_remove_global_segment(ind_seglo, nind_seglo, nin, nrtm, mseglo, mvoisin, flag)
subroutine mpi_recv(buf, cnt, datatype, source, tag, comm, status, ierr)
subroutine mpi_isend(buf, cnt, datatype, dest, tag, comm, ireq, ierr)
subroutine mpi_wait(ireq, status, ierr)