73
74
75
77
78
79
80 USE spmd_comm_world_mod, ONLY : spmd_comm_world
81#include "implicit_f.inc"
82#include "r4r8_p.inc"
83
84
85
86#include "spmd.inc"
87
88
89
90#include "com01_c.inc"
91#include "com04_c.inc"
92#include "scr02_c.inc"
93#include "scr18_c.inc"
94#include "task_c.inc"
95#include "units_c.inc"
96#include "warn_c.inc"
97#include "timeri_c.inc"
98
99
100
102 INTEGER, INTENT(IN) :: STAB
103 INTEGER, INTENT(IN) :: TAB(STAB)
104 TYPE(MPI_MIN_REAL_STRUCT), INTENT(INOUT) :: MY_STRUCT
105
106
107
108 INTEGER P,IERROR
109 INTEGER MSGTYP
110#ifdef MPI
111 INTEGER STATUS (MPI_STATUS_SIZE)
112
113
114
115
116
117 ALLOCATE(my_struct%TAB(stab),stat=ierror)
118 ALLOCATE(my_struct%BUFFER_TAB(stab,nspmd),stat=ierror)
119 ALLOCATE(my_struct%BUFFER_VAL(nspmd) ,stat=ierror)
120 ALLOCATE(my_struct%RQ_SEND_VAL(nspmd),stat=ierror)
121 ALLOCATE(my_struct%RQ_RECV_VAL(nspmd),stat=ierror)
122 ALLOCATE(my_struct%RQ_SEND_TAB(nspmd),stat=ierror)
123 ALLOCATE(my_struct%RQ_RECV_TAB(nspmd),stat=ierror)
124
125 my_struct%LENGTH_TAB = stab
126 my_struct%VAL = val
127 my_struct%TAB(1:stab) = tab(1:stab)
128 my_struct%BUFFER_VAL(ispmd+1) = val
129 my_struct%BUFFER_TAB(1:stab,ispmd+1) = tab(1:stab)
130
131
132 DO p = 1, nspmd
133 IF( p /= ispmd +1 ) THEN
134 msgtyp = 17000
136 1 my_struct%BUFFER_VAL(p) ,1,real,it_spmd(p),msgtyp,
137 2 spmd_comm_world,my_struct%RQ_RECV_VAL(p),ierror)
138
139 msgtyp = 17001
141 1 my_struct%BUFFER_TAB(1,p),my_struct%LENGTH_TAB,mpi_integer,it_spmd(p),msgtyp,
142 2 spmd_comm_world,my_struct%RQ_RECV_TAB(p),ierror)
143 ENDIF
144 ENDDO
145 DO p = 1, nspmd
146 IF( p /= ispmd +1 ) THEN
147 msgtyp = 17000
149 1 my_struct%VAL ,1,real,it_spmd(p),msgtyp,
150 2 spmd_comm_world,my_struct%RQ_SEND_VAL(p),ierror)
151
152 msgtyp = 17001
154 1 my_struct%TAB,my_struct%LENGTH_TAB,mpi_integer,it_spmd(p),msgtyp,
155 2 spmd_comm_world,my_struct%RQ_SEND_TAB(p),ierror)
156 ENDIF
157 ENDDO
158
159#endif
160 RETURN
subroutine mpi_isend(buf, cnt, datatype, dest, tag, comm, ireq, ierr)
subroutine mpi_irecv(buf, cnt, datatype, source, tag, comm, ireq, ierr)