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 SRBUF(*), LEN, LRECV
52
53
54
55#ifdef MPI
56 INTEGER MSGOFF,MSGOFF2,MSGTYP,INFO,I,K,ATID,ATAG,ALEN,RLEN,S1
57 INTEGER STATUS(MPI_STATUS_SIZE),IERROR
58 DATA msgoff/7013/
59 DATA msgoff2/7068/
60
61
62
63 s1 = 1
64 IF (ispmd/=0) THEN
65 msgtyp=msgoff2
66
68 . it_spmd(1),msgtyp,
69 . spmd_comm_world,ierror)
70
71 msgtyp=msgoff
72 IF(len > 0 ) THEN
74 . it_spmd(1),msgtyp,
75 . spmd_comm_world,ierror)
76 ENDIF
77
78 ELSE
79
80 lrecv = len
81
82 DO i=2,nspmd
83 msgtyp=msgoff2
85 . it_spmd(i),msgtyp,
86 . spmd_comm_world,status,ierror)
87 msgtyp=msgoff
88
89 IF(rlen > 0 ) THEN
90
91
92 CALL mpi_recv(srbuf(lrecv+1),rlen,mpi_integer,
93 . it_spmd(i),msgtyp,
94 . spmd_comm_world,status,ierror)
95
96 ENDIF
97 lrecv = lrecv + rlen
98
99 END DO
100
101 ENDIF
102
103#endif
104 RETURN
subroutine mpi_recv(buf, cnt, datatype, source, tag, comm, status, ierr)
subroutine mpi_send(buf, cnt, datatype, dest, tag, comm, ierr)