OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_exch_a_scnd.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_a_scnd ../engine/source/mpi/elements/spmd_exch_a_scnd.F
25!||--- called by ------------------------------------------------------
26!|| s10cndamp ../engine/source/elements/solid/solide10/s10cndf.F
27!|| s10cndf1 ../engine/source/elements/solid/solide10/s10cndf.F
28!|| s10cndf2 ../engine/source/elements/solid/solide10/s10cndf.F
29!|| s10cnidamp ../engine/source/elements/solid/solide10/s10cndf.f
30!|| s10cnistat ../engine/source/elements/solid/solide10/s10cndf.F
31!||--- calls -----------------------------------------------------
32!||--- uses -----------------------------------------------------
33!|| spmd_comm_world_mod ../engine/source/mpi/spmd_comm_world.f90
34!||====================================================================
35 SUBROUTINE spmd_exch_a_scnd(
36 1 A ,STIFN ,FR_CDNM,IAD_CDNM, LCOMM,ISIZE)
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
140 END SUBROUTINE
141
#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
subroutine s10cnidamp(icnds10, ms, a, v, vd, iadcnd, addcncnd, fskycnd, skew, dampr, damp, igrnod, dim, weight, iad_cndm, fr_cndm, fr_nbcccnd, procncnd)
Definition s10cndf.F:1227
subroutine spmd_exch_a_scnd(a, stifn, fr_cdnm, iad_cdnm, lcomm, isize)