33
34
35
36
37 USE spmd_comm_world_mod, ONLY : spmd_comm_world
38#include "implicit_f.inc"
39
40
41
42#include "spmd.inc"
43
44
45
46#include "com01_c.inc"
47#include "task_c.inc"
48
49
50
51 INTEGER NSENSP(*)
53
54
55
56#ifdef MPI
57 INTEGER MSGTYP,MSGOFF,IERROR,LOC_PROC,NN,L,I,K,N,II,KK,
58 . ,SIZ,A_AR,NBIRECV,,
59 . IRINDEX(NSPMD),REQ_R(NSPMD),IAD_RECV(NSPMD),
60 . STATUS(MPI_STATUS_SIZE)
61 DATA msgoff/200/
62
63
64
65 loc_proc = ispmd + 1
66 IF (loc_proc==1) THEN
67 ideb = 1
68 nbirecv = 0
69 DO i = 2, nspmd
70 iad_recv(i) = ideb
71 IF(nsensp(i)>0)THEN
72 nbirecv = nbirecv + 1
73 irindex(nbirecv) = i
74 nn = nsensp(i)
75 siz = nn*5
76 msgtyp = msgoff
78 s rxbuf(1,ideb),siz,real,it_spmd(i),msgtyp,
79 g spmd_comm_world,req_r(nbirecv),ierror)
80 ideb = ideb + nn
81 END IF
82 END DO
83
84 DO ii = 1, nbirecv
86 i = irindex(index)
87 l = iad_recv(i)
88 nn = nsensp(i)
89 DO n = l, l+nn-1
90 k = nint(rxbuf(1,n))
91 kk = nint(rxbuf(2,n))
92 xsens(1+(kk-1)*3,k)= rxbuf(3,n)
93 xsens(2+(kk-1)*3,k)= rxbuf(4,n)
94 xsens(3+(kk-1)*3,k)= rxbuf(5,n)
95 END DO
96 END DO
97
98 ELSE
99 IF(nsensp(loc_proc)>0)THEN
100 siz = 5*nsensp(loc_proc)
101 msgtyp=msgoff
103 s rxbuf,siz,real,it_spmd(1),msgtyp
104 g spmd_comm_world,ierror)
105 END IF
106 END IF
107
108#endif
109 RETURN
subroutine mpi_send(buf, cnt, datatype, dest, tag, comm, ierr)
subroutine mpi_waitany(cnt, array_of_requests, index, status, ierr)
subroutine mpi_irecv(buf, cnt, datatype, source, tag, comm, ireq, ierr)