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,INFO,IDEB,K,N,NB_TMP,LEN,IADP(NSPMD),I
77
78 INTEGER STATUS(MPI_STATUS_SIZE),IERROR
79 INTEGER, DIMENSION(:),ALLOCATABLE :: RBUF,
80 DATA msgoff/7029/
81
82
83
84 ALLOCATE(rbuf(srbuf+1))
85 ALLOCATE(npt(nbf_l))
86
87 IF (ispmd/=0) THEN
88 msgtyp= msgoff
89
90 CALL mpi_send(np,nbf_l,mpi_integer,it_spmd(1),msgtyp,
91 . spmd_comm_world,ierror)
92
93 ELSE
94 DO k=1,nbf_l
95 rbuf(k) = np(k)
96 ENDDO
97 ideb = nbf_l + 1
98 iadp(1) = 1
99
100 DO k=2,nspmd
101 iadp(k) = ideb
102 msgtyp= msgoff
103
105 . spmd_comm_world,status,ierror)
107
108 CALL mpi_recv(rbuf(ideb),nb_tmp,mpi_integer,it_spmd(k),msgtyp,
109 . spmd_comm_world,status,ierror)
110
111 ideb = ideb + nb_tmp
112 END DO
113
114 DO n = 1, nbpart
115 DO k = 1, nspmd
116 IF (n>1) THEN
117 len = (iadg(k,n) - iadg(k,n-1))*SIZE
118 ELSE
119 len = iadg(k,n)*SIZE
120 ENDIF
121
122 IF (iflag==1) THEN
123 IF(len>0)
CALL write_i_c(rbuf(iadp(k)),len)
124 ELSEIF(iflag==2) THEN
125 IF(len>0)
CALL write_c_c(rbuf(iadp(k)),len)
126 ENDIF
127 iadp(k) = iadp(k) + len
128 ENDDO
129 ENDDO
130 ENDIF
131
132 DEALLOCATE(rbuf)
133 DEALLOCATE(npt)
134#endif
135 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)