50
51
52
53
54 USE spmd_comm_world_mod, ONLY : spmd_comm_world
55#include "implicit_f.inc"
56
57
58
59
60#include "spmd.inc"
61
62
63
64
65#include "com01_c.inc"
66#include "task_c.inc"
67
68
69
70 INTEGER NBF_L, NP(*),IADG(NSPMD,*),SIZE
71 INTEGER NBPART, IFLAG,SRBUF
72
73
74
75#ifdef MPI
76 INTEGER MSGOFF,MSGTYP,IDEB,K,N,NB_TMP,LEN,IADP(NSPMD)
77
78 INTEGER STATUS(MPI_STATUS_SIZE),IERROR
79 INTEGER, DIMENSION(:),ALLOCATABLE :: RBUF
80 DATA msgoff/7029/
81
82
83
84
85
86
87 ALLOCATE(rbuf(srbuf+1))
88 rbuf(1:srbuf) = -huge(ierror)
89
90 IF (ispmd/=0) THEN
91 msgtyp= msgoff
92
93 CALL mpi_send(np,nbf_l,mpi_integer,it_spmd(1),msgtyp,
94 . spmd_comm_world,ierror)
95
96 ELSE
97 DO k=1,nbf_l
98 rbuf(k) = np(k)
99 ENDDO
100 ideb = nbf_l + 1
101 iadp(1) = 1
102
103 DO k=2,nspmd
104 iadp(k) = ideb
105 msgtyp= msgoff
106
108 . spmd_comm_world,status,ierror)
110
111 CALL mpi_recv(rbuf(ideb),nb_tmp,mpi_integer,it_spmd(k),msgtyp,
112 . spmd_comm_world,status,ierror)
113
114 ideb = ideb + nb_tmp
115 END DO
116
117 DO n = 1, nbpart
118 DO k = 1, nspmd
119 IF (n>1) THEN
120 len = (iadg(k,n) - iadg(k,n-1))*SIZE
121 ELSE
122 len = iadg(k,n)*SIZE
123 ENDIF
124
125 IF (iflag==1) THEN
126 IF(len>0)
CALL write_i_c(rbuf(iadp(k)),len)
127 ELSEIF(iflag==2) THEN
128 IF(len>0)
CALL write_c_c(rbuf(iadp(k)),len)
129 ENDIF
130 iadp(k) = iadp(k) + len
131 ENDDO
132 ENDDO
133 ENDIF
134
135 DEALLOCATE(rbuf)
136#endif
137 RETURN
subroutine mpi_recv(buf, cnt, datatype, source, tag, comm, status, ierr)
subroutine mpi_get_count(status, datatype, cnt, ierr)
subroutine mpi_send(buf, cnt, datatype, dest, tag, comm, ierr)
subroutine mpi_probe(source, tag, comm, status, ierr)
void write_i_c(int *w, int *len)
void write_c_c(int *w, int *len)