OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_exch_sms6.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_sms6 ../engine/source/mpi/ams/spmd_exch_sms6.F
25!||--- called by ------------------------------------------------------
26!|| sms_build_diag ../engine/source/ams/sms_build_diag.F
27!|| sms_mav_lt ../engine/source/ams/sms_pcg.F
28!||--- calls -----------------------------------------------------
29!||--- uses -----------------------------------------------------
30!|| spmd_mod ../engine/source/mpi/spmd_mod.F90
31!||====================================================================
32 SUBROUTINE spmd_exch_sms6(V,NODNX_SMS,IAD_ELEM,FR_ELEM,
33 . SIZE,LENR)
34 USE spmd_mod
35C-----------------------------------------------
36C I m p l i c i t T y p e s
37C-----------------------------------------------
38#include "implicit_f.inc"
39C-----------------------------------------------------------------
40C M e s s a g e P a s s i n g
41C-----------------------------------------------
42#include "spmd.inc"
43C-----------------------------------------------
44C C o m m o n B l o c k s
45C-----------------------------------------------
46#include "com01_c.inc"
47#include "task_c.inc"
48C-----------------------------------------------
49C D u m m y A r g u m e n t s
50C-----------------------------------------------
51 INTEGER NODNX_SMS(*), IAD_ELEM(2,*), FR_ELEM(*), SIZE, LENR
52 DOUBLE PRECISION
53 . v(6,SIZE,*)
54C-----------------------------------------------
55C L o c a l V a r i a b l e s
56C-----------------------------------------------
57#ifdef MPI
58 INTEGER MSGTYP,MSGOFF,I,NOD,LOC_PROC,IERROR,
59 . siz,j,l,nb_nod,k,m,
60 . status(mpi_status_size),
61 . iad_send(nspmd+1),iad_recv(nspmd+1),
62 . req_r(nspmd),req_s(nspmd)
63 DOUBLE PRECISION RBUF(6*SIZE*LENR), SBUF(6*SIZE*LENR)
64 DATA msgoff/214/
65C-----------------------------------------------
66C S o u r c e L i n e s
67C-----------------------------------------------
68 loc_proc = ispmd + 1
69 l = 1
70 iad_recv(1) = 1
71 DO i=1,nspmd
72
73 siz = 0
74 DO j=iad_elem(1,i),iad_elem(1,i+1)-1
75 nod = fr_elem(j)
76 IF(nodnx_sms(nod)/=0)THEN
77 siz = siz + 6*SIZE
78 END IF
79 END DO
80
81 IF(siz/=0)THEN
82 msgtyp = msgoff
83 CALL mpi_irecv(
84 s rbuf(l),siz,mpi_double_precision,it_spmd(i),msgtyp,
85 g spmd_comm_world,req_r(i),ierror)
86 l = l + siz
87 ENDIF
88 iad_recv(i+1) = l
89 END DO
90 l = 1
91 iad_send(1) = 1
92 DO i=1,nspmd
93#include "vectorize.inc"
94 DO j=iad_elem(1,i),iad_elem(1,i+1)-1
95 nod = fr_elem(j)
96 IF(nodnx_sms(nod)/=0)THEN
97 DO m=1,6
98 DO k=1,SIZE
99 sbuf(l+k-1) = v(m,k,nod)
100 END DO
101 l = l + SIZE
102 END DO
103 END IF
104 END DO
105 iad_send(i+1) = l
106 ENDDO
107C
108C echange messages
109C
110 DO i=1,nspmd
111C--------------------------------------------------------------------
112ccc IF(IAD_ELEM(1,I+1)-IAD_ELEM(1,I)>0)THEN
113 IF(iad_send(i+1)-iad_send(i)>0)THEN
114 msgtyp = msgoff
115 siz = iad_send(i+1)-iad_send(i)
116 l = iad_send(i)
117 CALL mpi_isend(
118 s sbuf(l),siz,mpi_double_precision,it_spmd(i),msgtyp,
119 g spmd_comm_world,req_s(i),ierror)
120 ENDIF
121C--------------------------------------------------------------------
122 ENDDO
123C
124 DO i = 1, nspmd
125ccc IF(IAD_ELEM(1,I+1)-IAD_ELEM(1,I)>0)THEN
126 IF(iad_recv(i+1)-iad_recv(i)>0)THEN
127 CALL mpi_wait(req_r(i),status,ierror)
128 l = iad_recv(i)
129#include "vectorize.inc"
130 DO j=iad_elem(1,i),iad_elem(1,i+1)-1
131 nod = fr_elem(j)
132 IF(nodnx_sms(nod)/=0) THEN
133 DO m=1,6
134 DO k=1,SIZE
135 v(m,k,nod) = v(m,k,nod)+rbuf(l+k-1)
136 END DO
137 l = l + SIZE
138 END DO
139 END IF
140 END DO
141 ENDIF
142 END DO
143C
144 DO i = 1, nspmd
145ccc IF(IAD_ELEM(1,I+1)-IAD_ELEM(1,I)>0)THEN
146 IF(iad_send(i+1)-iad_send(i)>0)THEN
147 CALL mpi_wait(req_s(i),status,ierror)
148 ENDIF
149 ENDDO
150C
151#endif
152 RETURN
153 END
subroutine mpi_isend(buf, cnt, datatype, dest, tag, comm, ireq, ierr)
Definition mpi.f:382
subroutine mpi_wait(ireq, status, ierr)
Definition mpi.f:525
subroutine mpi_irecv(buf, cnt, datatype, source, tag, comm, ireq, ierr)
Definition mpi.f:372
subroutine spmd_exch_sms6(v, nodnx_sms, iad_elem, fr_elem, size, lenr)