OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_exch_rbe2_sms.F
Go to the documentation of this file.
1Copyright> OpenRadioss
2Copyright> Copyright (C) 1986-2025 Altair Engineering Inc.
3Copyright>
4Copyright> This program is free software: you can redistribute it and/or modify
5Copyright> it under the terms of the GNU Affero General Public License as published by
6Copyright> the Free Software Foundation, either version 3 of the License, or
7Copyright> (at your option) any later version.
8Copyright>
9Copyright> This program is distributed in the hope that it will be useful,
10Copyright> but WITHOUT ANY WARRANTY; without even the implied warranty of
11Copyright> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12Copyright> GNU Affero General Public License for more details.
13Copyright>
14Copyright> You should have received a copy of the GNU Affero General Public License
15Copyright> along with this program. If not, see <https://www.gnu.org/licenses/>.
16Copyright>
17Copyright>
18Copyright> Commercial Alternative: Altair Radioss Software
19Copyright>
20Copyright> As an alternative to this open-source version, Altair also offers Altair Radioss
21Copyright> software under a commercial license. Contact Altair to discuss further if the
22Copyright> commercial version may interest you: https://www.altair.com/radioss/.
23!||====================================================================
24!|| spmd_exch_rbe2_sms ../engine/source/mpi/kinematic_conditions/spmd_exch_rbe2_sms.F
25!||--- called by ------------------------------------------------------
26!|| sms_diag_rbe2 ../engine/source/ams/sms_rbe2.F
27!|| sms_rbe_cnds ../engine/source/ams/sms_rbe2.F
28!|| sms_rbe_prec ../engine/source/ams/sms_rbe2.f
29!||--- calls -----------------------------------------------------
30!||--- uses -----------------------------------------------------
31!|| spmd_comm_world_mod ../engine/source/mpi/spmd_comm_world.F90
32!||====================================================================
34 1 A ,IAD_M ,FR_M ,LCOMM ,ISIZE)
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(isize,6,*)
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,m,
61 . status(mpi_status_size),isize6,
62 . req_s(nspmd),req_r(nspmd),indexi(nspmd),irot
63 DATA msgoff/212/
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 DO m=1,isize
99 sbuf(ideb) = a(m,k,nod)
100 ideb = ideb + 1
101 END DO
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 DO m=1,isize
129 a(m,k,nod) = a(m,k,nod) + rbuf(ideb)
130 ideb = ideb + 1
131 ENDDO
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
142 END
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
subroutine sms_rbe_prec(irbe2, lrbe2, diag_sms, ms, diag_sms3, skew, weight, iad_rbe2, fr_rbe2m, nmrbe2)
Definition sms_rbe2.F:470
subroutine spmd_exch_rbe2_sms(a, iad_m, fr_m, lcomm, isize)