OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_exch_a_scnd.F File Reference
#include "implicit_f.inc"
#include "spmd.inc"
#include "com01_c.inc"
#include "task_c.inc"

Go to the source code of this file.

Functions/Subroutines

subroutine spmd_exch_a_scnd (a, stifn, fr_cdnm, iad_cdnm, lcomm, isize)

Function/Subroutine Documentation

◆ spmd_exch_a_scnd()

subroutine spmd_exch_a_scnd ( a,
stifn,
integer, dimension(*) fr_cdnm,
integer, dimension(*) iad_cdnm,
integer lcomm,
integer isize )

Definition at line 35 of file spmd_exch_a_scnd.F.

37C-----------------------------------------------
38C I m p l i c i t T y p e s
39C-----------------------------------------------
40 USE spmd_comm_world_mod, ONLY : spmd_comm_world
41#include "implicit_f.inc"
42C-----------------------------------------------
43C M e s s a g e P a s s i n g
44C-----------------------------------------------
45#include "spmd.inc"
46C-----------------------------------------------
47C C o m m o n B l o c k s
48C-----------------------------------------------
49#include "com01_c.inc"
50#include "task_c.inc"
51C-----------------------------------------------
52C D u m m y A r g u m e n t s
53C-----------------------------------------------
54 INTEGER LCOMM, ISIZE, FR_CDNM(*), IAD_CDNM(*)
56 . a(3,*),stifn(*)
57C-----------------------------------------------
58C L o c a l V a r i a b l e s
59C-----------------------------------------------
60#ifdef MPI
61 INTEGER MSGTYP,LOC_PROC,NOD,I,J,L,IDEB,IAD,LEN,
62 . NBINDEX,INDEX,MSGOFF,SIZ,IERROR,
63 . STATUS(MPI_STATUS_SIZE),
64 . REQ_S(NSPMD),REQ_R(NSPMD),INDEXI(NSPMD)
65 DATA msgoff/1178/
67 . sbuf(lcomm*isize),rbuf(lcomm*isize)
68C-----------------------------------------------
69C S o u r c e L i n e s
70C-----------------------------------------------
71 loc_proc = ispmd + 1
72C
73 ideb = 1
74 l = 0
75c ISIZE = 3
76 DO i = 1, nspmd
77 len = iad_cdnm(i+1)-iad_cdnm(i)
78 IF(len>0) THEN
79 siz = len*isize
80 l=l+1
81 indexi(l)=i
82 msgtyp = msgoff
83 CALL mpi_irecv(
84 s rbuf(ideb),siz,real,it_spmd(i),msgtyp,
85 g spmd_comm_world,req_r(l),ierror)
86 ideb = ideb + siz
87 ENDIF
88 ENDDO
89 nbindex = l
90C
91 ideb = 1
92 DO l = 1, nbindex
93 i = indexi(l)
94 len = iad_cdnm(i+1) - iad_cdnm(i)
95 iad = iad_cdnm(i)-1
96 DO j = 1, len
97 nod = fr_cdnm(iad+j)
98 sbuf(ideb) = a(1,nod)
99 sbuf(ideb+1) = a(2,nod)
100 sbuf(ideb+2) = a(3,nod)
101 sbuf(ideb+3) = stifn(nod)
102 ideb = ideb + isize
103 ENDDO
104 ENDDO
105C
106 ideb = 1
107 DO l=1,nbindex
108 i = indexi(l)
109 len = iad_cdnm(i+1)-iad_cdnm(i)
110 siz = len*isize
111 msgtyp = msgoff
112 CALL mpi_isend(
113 s sbuf(ideb),siz,real,it_spmd(i),msgtyp,
114 g spmd_comm_world,req_s(l),ierror)
115 ideb = ideb + siz
116 ENDDO
117C
118 DO l=1,nbindex
119 CALL mpi_waitany(nbindex,req_r,index,status,ierror)
120 i = indexi(index)
121 ideb = 1+(iad_cdnm(i)-1)*isize
122 len = iad_cdnm(i+1)-iad_cdnm(i)
123 iad = iad_cdnm(i)-1
124 DO j = 1, len
125 nod = fr_cdnm(iad+j)
126 a(1,nod) = a(1,nod) + rbuf(ideb)
127 a(2,nod) = a(2,nod) + rbuf(ideb+1)
128 a(3,nod) = a(3,nod) + rbuf(ideb+2)
129 stifn(nod) = stifn(nod) + rbuf(ideb+3)
130 ideb = ideb + isize
131 ENDDO
132 ENDDO
133C
134 DO l=1,nbindex
135 CALL mpi_waitany(nbindex,req_s,index,status,ierror)
136 ENDDO
137C
138#endif
139 RETURN
#define my_real
Definition cppsort.cpp:32
subroutine mpi_isend(buf, cnt, datatype, dest, tag, comm, ireq, ierr)
Definition mpi.f:382
subroutine mpi_waitany(cnt, array_of_requests, index, status, ierr)
Definition mpi.f:549
subroutine mpi_irecv(buf, cnt, datatype, source, tag, comm, ireq, ierr)
Definition mpi.f:372