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
49
50
51 INTEGER IDMAX,ITAB(*)
52
53
54
55#ifdef MPI
56 INTEGER IDMAXL, I, ITAG, MSGOFF, IDMAXP(NSPMD-1),
57 . REQ(NSPMD-1), IERR, STAT(MPI_STATUS_SIZE,NSPMD-1)
58
59 DATA msgoff/7063/
60
61 idmaxl=0
62 DO i=1,numnod
63 idmaxl=
max(idmaxl,itab(i))
64 ENDDO
65 IF (ispmd==0) THEN
66 DO i=1,nspmd-1
67 itag=msgoff
68 CALL mpi_irecv(idmaxp(i), 1, mpi_integer, it_spmd(i+1),
69 . itag, spmd_comm_world, req(i), ierr)
70 ENDDO
72
73 idmax=idmaxl
74 DO i=1,nspmd-1
75 idmax=
max(idmax,idmaxp(i))
76 ENDDO
77 ELSE
78 itag=msgoff
79 CALL mpi_isend(idmaxl, 1, mpi_integer, it_spmd(1),
80 . itag, spmd_comm_world, req, ierr)
82 ENDIF
83
84#endif
85 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)