OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_exch_rbe3_a_pon.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_rbe3_a_pon (a, fr_m, iad_m, lcomm, isize)

Function/Subroutine Documentation

◆ spmd_exch_rbe3_a_pon()

subroutine spmd_exch_rbe3_a_pon ( double precision, dimension(6,3,*) a,
integer, dimension(*) fr_m,
integer, dimension(*) iad_m,
integer lcomm,
integer isize )

Definition at line 33 of file spmd_exch_rbe3_a_pon.F.

35C-----------------------------------------------
36C I m p l i c i t T y p e s
37C-----------------------------------------------
38 USE spmd_comm_world_mod, ONLY : spmd_comm_world
39#include "implicit_f.inc"
40C-----------------------------------------------
41C M e s s a g e P a s s i n g
42C-----------------------------------------------
43#include "spmd.inc"
44C-----------------------------------------------
45C C o m m o n B l o c k s
46C-----------------------------------------------
47#include "com01_c.inc"
48#include "task_c.inc"
49C-----------------------------------------------
50C D u m m y A r g u m e n t s
51C-----------------------------------------------
52 INTEGER LCOMM, ISIZE, FR_M(*), IAD_M(*)
53 double precision
54 . a(6,3,*)
55C-----------------------------------------------
56C L o c a l V a r i a b l e s
57C-----------------------------------------------
58#ifdef MPI
59 INTEGER MSGTYP,LOC_PROC,NOD,I,J,L,IDEB,IAD,LEN,
60 . NBINDEX,INDEX,MSGOFF,SIZ,IERROR,K,
61 . STATUS(MPI_STATUS_SIZE),ISIZE6,
62 . REQ_S(NSPMD),REQ_R(NSPMD),INDEXI(NSPMD)
63 DATA msgoff/209/
64 double precision
65 . sbuf(lcomm*isize*6), rbuf(lcomm*isize*6)
66C-----------------------------------------------
67C S o u r c e L i n e s
68C-----------------------------------------------
69 loc_proc = ispmd + 1
70 isize6=isize*6
71C
72 ideb = 1
73 l = 0
74 DO i = 1, nspmd
75 len = iad_m(i+1)-iad_m(i)
76 IF(len>0) THEN
77 siz = len*isize6
78 l=l+1
79 indexi(l)=i
80 msgtyp = msgoff
81 CALL mpi_irecv(
82 s rbuf(ideb),siz,mpi_double_precision,it_spmd(i),msgtyp,
83 g spmd_comm_world,req_r(l),ierror)
84 ideb = ideb + siz
85 ENDIF
86 ENDDO
87 nbindex = l
88C
89 ideb = 1
90 DO l = 1, nbindex
91 i = indexi(l)
92 len = iad_m(i+1) - iad_m(i)
93 iad = iad_m(i)-1
94#include "vectorize.inc"
95 DO j = 1, len
96 nod = fr_m(iad+j)
97 DO k = 1, 6
98 sbuf(ideb) = a(k,1,nod)
99 sbuf(ideb+1) = a(k,2,nod)
100 sbuf(ideb+2) = a(k,3,nod)
101 ideb = ideb + isize
102 ENDDO
103 ENDDO
104 ENDDO
105C
106 ideb = 1
107 DO l=1,nbindex
108 i = indexi(l)
109 len = iad_m(i+1)-iad_m(i)
110 siz = len*isize6
111 msgtyp = msgoff
112 CALL mpi_isend(
113 s sbuf(ideb),siz,mpi_double_precision,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_m(i)-1)*isize6
122 len = iad_m(i+1)-iad_m(i)
123 iad = iad_m(i)-1
124#include "vectorize.inc"
125 DO j = 1, len
126 nod = fr_m(iad+j)
127 DO k = 1, 6
128 a(k,1,nod) = a(k,1,nod) + rbuf(ideb)
129 a(k,2,nod) = a(k,2,nod) + rbuf(ideb+1)
130 a(k,3,nod) = a(k,3,nod) + rbuf(ideb+2)
131 ideb = ideb + isize
132 ENDDO
133 ENDDO
134 ENDDO
135C
136 DO l=1,nbindex
137 CALL mpi_waitany(nbindex,req_s,index,status,ierror)
138 ENDDO
139C
140#endif
141 RETURN
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