33
34
35
36 USE spmd_comm_world_mod, ONLY : spmd_comm_world
37#include "implicit_f.inc"
38
39
40
41#include "spmd.inc"
42
43
44
45#include "com01_c.inc"
46#include "com04_c.inc"
47#include "task_c.inc"
48#include "fxbcom.inc"
49
50
51
52 INTEGER FXBIPM(NBIPM,*)
54 . mfextp(*)
55
56
57
58#ifdef MPI
59 INTEGER NFX, NMOD, NME, LEN, AVAR, PMAIN, II, , ITAG, MSGOFF,
60 . REQ(NSPMD-1), STAT(MPI_STATUS_SIZE,NSPMD-1), IERR,
61 . J
63 . , DIMENSION(:,:), ALLOCATABLE :: ff
64
65 DATA msgoff /196/
66
67 DO nfx=1,nfxbody
68 nmod=fxbipm(4,nfx)
69 nme=fxbipm(17,nfx)
70 len=nme+nmod
71 avar=fxbipm(13,nfx)
72 pmain=fxbipm(39,nfx)
73 IF (ispmd==pmain) THEN
74 ALLOCATE(ff(len,nspmd-1))
75 ii=0
76 DO i=1,nspmd
77 IF (ispmd==i-1) cycle
78 ii=ii+1
79 itag=msgoff
80 CALL mpi_irecv(ff(1,ii), len, real, it_spmd(i), itag,
81 . spmd_comm_world, req(ii), ierr)
82 ENDDO
83
85 DO i=1,nspmd-1
86 DO j=1,len
87 mfextp(avar+j-1)=mfextp(avar+j-1)+ff(j,i)
88 ENDDO
89 ENDDO
90 DEALLOCATE(ff)
91 ELSE
92 itag=msgoff
93 CALL mpi_isend(mfextp(avar), len, real, it_spmd(pmain+1),
94 . itag, spmd_comm_world, req(1), ierr)
95
97 ENDIF
98 ENDDO
99
100#endif
101 RETURN
subroutine mpi_isend(buf, cnt, datatype, dest, tag, comm, ireq, ierr)
subroutine mpi_wait(ireq, status, ierr)
subroutine mpi_waitall(cnt, array_of_requests, status, ierr)
subroutine mpi_irecv(buf, cnt, datatype, source, tag, comm, ireq, ierr)