OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_exch_a_scnd_pon.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_pon ../engine/source/mpi/elements/spmd_exch_a_scnd_pon.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!||====================================================================
36 1 FR_CDNM,IAD_CDNM,ADDCNCDN,PROCNCDN,FR_NBCCCDN,
37 2 ISIZE,LENR ,LENS ,FSKYCDN)
38C-----------------------------------------------
39C I m p l i c i t T y p e s
40C-----------------------------------------------
41 USE spmd_comm_world_mod, ONLY : spmd_comm_world
42#include "implicit_f.inc"
43C-----------------------------------------------------------------
44C M e s s a g e P a s s i n g
45C-----------------------------------------------
46#include "spmd.inc"
47C-----------------------------------------------
48C C o m m o n B l o c k s
49C-----------------------------------------------
50#include "com01_c.inc"
51#include "task_c.inc"
52C-----------------------------------------------
53C D u m m y A r g u m e n t s
54C-----------------------------------------------
55 INTEGER IAD_CDNM(*),FR_CDNM(*),FR_NBCCCDN(2,*),
56 . ADDCNCDN(*), PROCNCDN(*),ISIZE ,LENR ,LENS
58 . fskycdn(isize,*)
59C-----------------------------------------------
60C L o c a l V a r i a b l e s
61C-----------------------------------------------
62#ifdef MPI
63 INTEGER MSGTYP,I,NOD,LOC_PROC,IERROR, INDEXI, NISKYF, N, IDEB,
64 . SIZ, J, L, CC, NBIRECV, NBISEND, II, MSGOFF,
65 . iad_recv(nspmd+1), indexr(nspmd),indexs(nspmd),
66 . req_r(nspmd),req_s(nspmd),
67 . status(mpi_status_size),k
69 . rbuf(lenr*isize),sbuf(lens*isize)
70 DATA msgoff/1718/
71C-----------------------------------------------
72C S o u r c e L i n e s
73C-----------------------------------------------
74 loc_proc = ispmd + 1
75C
76 nbirecv = 0
77 nbisend = 0
78 l = 1
79 iad_recv(1) = 1
80 DO i = 1, nspmd
81 IF(fr_nbcccdn(2,i)>0) THEN
82 siz = isize*fr_nbcccdn(2,i)
83 msgtyp = msgoff
84 nbirecv = nbirecv + 1
85 indexr(nbirecv) = i
86 CALL mpi_irecv(
87 s rbuf(l),siz,real,it_spmd(i),msgtyp,
88 g spmd_comm_world,req_r(nbirecv),ierror)
89 l = l + siz
90 ENDIF
91 iad_recv(i+1) = l
92 IF(fr_nbcccdn(1,i)>0) THEN
93 nbisend = nbisend + 1
94 indexs(nbisend) = i
95 ENDIF
96 ENDDO
97C
98C preparation envoi
99C
100 l = 1
101 DO ii=1, nbisend
102 i = indexs(ii)
103 DO j=iad_cdnm(i),iad_cdnm(i+1)-1
104 nod = fr_cdnm(j)
105 DO cc = addcncdn(nod),addcncdn(nod+1)-1
106 IF(procncdn(cc)==loc_proc) THEN
107 DO k = 1, isize
108 sbuf(l+k-1) = fskycdn(k,cc)
109 END DO
110 l = l + isize
111 ENDIF
112 ENDDO
113 END DO
114 ENDDO
115C
116C echange messages
117C
118 l = 1
119 DO ii=1,nbisend
120 i = indexs(ii)
121 siz = isize*fr_nbcccdn(1,i)
122 msgtyp = msgoff
123 CALL mpi_isend(
124 s sbuf(l),siz,real,it_spmd(i),msgtyp,
125 g spmd_comm_world,req_s(ii),ierror)
126 l = l + siz
127 ENDDO
128C
129C decompactage
130C
131 DO ii=1,nbirecv
132 CALL mpi_waitany(nbirecv,req_r,indexi,status,ierror)
133 i = indexr(indexi)
134 l = iad_recv(i)
135 DO j=iad_cdnm(i),iad_cdnm(i+1)-1
136 nod = fr_cdnm(j)
137 DO cc = addcncdn(nod), addcncdn(nod+1)-1
138 IF(procncdn(cc)==i) THEN
139 DO k = 1, isize
140 fskycdn(k,cc) = rbuf(l+k-1)
141 END DO
142 l = l + isize
143 ENDIF
144 ENDDO
145 END DO
146 END DO
147C
148C wait terminaison isend
149C
150 DO l=1,nbisend
151 CALL mpi_waitany(nbisend,req_s,indexi,status,ierror)
152 ENDDO
153C
154#endif
155 RETURN
156 END SUBROUTINE
157
158
#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 spmd_exch_a_scnd_pon(fr_cdnm, iad_cdnm, addcncdn, procncdn, fr_nbcccdn, isize, lenr, lens, fskycdn)