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 COMMON /timerg/timerg(2,500000),cputimeg(500000)
52 REAL TIMERG,CPUTIMEG
53
54
55
56 INTEGER DIM_TAB3
57 my_real,
DIMENSION(DIM_TAB3) :: tab3
58 my_real,
DIMENSION(NSPMD+1,DIM_TAB3) ::tab4
59
60
61
62#ifdef MPI
63 INTEGER I,J,,SENDER,RECIP,MSGTYP
64 INTEGER IERROR,MSGOFF
65 my_real,
DIMENSION(DIM_TAB3) :: rbuf
66 INTEGER, DIMENSION(MPI_STATUS_SIZE) :: STATUS
67 DATA msgoff/239/
68
69
70
71 dim=dim_tab3
72 IF(ispmd==0) THEN
73 DO j=1,dim_tab3
74 tab4(nspmd+1,j) = zero
75 tab4(1,j) = tab3(j)
76 ENDDO
77
78 DO i = 2, nspmd
79 msgtyp=msgoff
80 sender = i-1
81 CALL mpi_recv(rbuf,dim,real,sender,msgtyp,
82 . spmd_comm_world,status,ierror)
83 DO j=1,dim_tab3
84 tab4(i,j) = rbuf(j)
85 ENDDO
86 END DO
87 ELSE
88 recip = 0
89 msgtyp=msgoff
90 DO j=1,dim_tab3
91 rbuf(j) = tab3(j)
92 ENDDO
93 CALL mpi_send(rbuf,dim,real,recip,msgtyp,
94 . spmd_comm_world,ierror)
95 ENDIF
96
97#endif
98 RETURN
subroutine mpi_recv(buf, cnt, datatype, source, tag, comm, status, ierr)
subroutine mpi_send(buf, cnt, datatype, dest, tag, comm, ierr)