39
40
41
42
43 USE spmd_comm_world_mod, ONLY : spmd_comm_world
44#include "implicit_f.inc"
45
46
47
48#include "spmd.inc"
49
50
51
52#include "com01_c.inc"
53#include "task_c.inc"
54
55
56
57 INTEGER IAD(*), NBPART, IADG(NSPMD,NBPART)
58 INTEGER SBUF
59
60
61
62#ifdef MPI
63 INTEGER MSGOFF,MSGTYP,INFO,K,N,NB_TMP
64 INTEGER, DIMENSION(:),ALLOCATABLE :: RECBUF
65 INTEGER STATUS(MPI_STATUS_SIZE),IERROR
66
67 DATA msgoff/7028/
68
69
70
71 ALLOCATE(recbuf(sbuf))
72
73 IF (ispmd/=0) THEN
74 msgtyp= msgoff
75 CALL mpi_send(iad,nbpart,mpi_integer,it_spmd(1),msgtyp,
76 . spmd_comm_world,ierror)
77
78 ELSE
79 DO n = 1, nbpart
80 iadg(1,n) = iad(n)
81 ENDDO
82
83 DO k=2,nspmd
84 msgtyp= msgoff
86 . spmd_comm_world,status,ierror)
88 CALL mpi_recv(recbuf,nb_tmp,mpi_integer,it_spmd(k),msgtyp,
89 . spmd_comm_world,status,ierror)
90
91 DO n = 1, nbpart
92 iadg(k,n) = recbuf(n)
93 ENDDO
94 END DO
95 ENDIF
96
97 DEALLOCATE(recbuf)
98
99#endif
100 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)