38
39
40
42
43
44
45
46 USE spmd_comm_world_mod, ONLY : spmd_comm_world
47#include "implicit_f.inc"
48
49
50
51
52#include "spmd.inc"
53
54
55
56
57#include "com01_c.inc"
58#include "task_c.inc"
59
60
61
62 INTEGER NBF_L, NP(*),IADG(NSPMD,*),SIZE
63 INTEGER NBPART, ,SRBUF,IDPLY
64
65
66
67#ifdef MPI
68 INTEGER MSGOFF,MSGTYP,INFO,IDEB,K,N,NB_TMP,LEN,IADP(NSPMD),
69 . I,EMPL,IPLY
70
71 INTEGER, DIMENSION(:),ALLOCATABLE :: RBUF,RBUF2,NPT
72 INTEGER STATUS(MPI_STATUS_SIZE),IERROR
73 INTEGER GET_PLY_NOD
75 DATA msgoff/7057/
76
77
78
79 ALLOCATE(rbuf(srbuf))
80 ALLOCATE(rbuf2(srbuf))
81 ALLOCATE(npt(nbf_l))
82
83 IF (ispmd/=0) THEN
84 msgtyp=msgoff
85
86 CALL mpi_send(np,nbf_l,mpi_integer,it_spmd(1),msgtyp,
87 . spmd_comm_world,ierror)
88
89 ELSE
90 DO k=1,nbf_l
91 rbuf(k) = np(k)
92 ENDDO
93 ideb = nbf_l + 1
94 iadp(1) = 1
95
96 DO k=2,nspmd
97 iadp(k) = ideb
98 msgtyp=msgoff
99
101 . spmd_comm_world,status,ierror)
103
104 CALL mpi_recv(rbuf(ideb),nb_tmp,mpi_integer,it_spmd(k),msgtyp,
105 . spmd_comm_world,status,ierror)
106
107 ideb = ideb + nb_tmp
108 END DO
109
110 DO n = 1, nbpart
112 DO k = 1, nspmd
113 IF (n>1) THEN
114 len = (iadg(k,n) - iadg(k,n-1))*SIZE
115 ELSE
116 len = iadg(k,n)*SIZE
117 ENDIF
118 IF (iflag==1) THEN
119 DO i=iadp(k), iadp(k)+len-1
120 rbuf(i) = rbuf(i)+idply
121 ENDDO
123 ELSEIF(iflag==2) THEN
125 ENDIF
126 iadp(k) = iadp(k) + len
127 ENDDO
128 ENDDO
129 ENDIF
130
131 DEALLOCATE(rbuf)
132 DEALLOCATE(rbuf2)
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)
integer, dimension(:), allocatable indx_ply
integer function get_ply_nod(iply, nodid)
void write_i_c(int *w, int *len)
void write_c_c(int *w, int *len)