OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_exch_stif_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_stif_scnd ../engine/source/mpi/elements/spmd_exch_stif_scnd.F
25!||--- called by ------------------------------------------------------
26!|| s10stfe_poff ../engine/source/elements/solid/solide10/s10cndf.F
27!||--- calls -----------------------------------------------------
28!||--- uses -----------------------------------------------------
29!|| spmd_comm_world_mod ../engine/source/mpi/spmd_comm_world.f90
30!||====================================================================
32 1 STIFND,FR_CDNS,IAD_CDNS, LCOMM)
33C-----------------------------------------------
34C I m p l i c i t T y p e s
35C-----------------------------------------------
36 USE spmd_comm_world_mod, ONLY : spmd_comm_world
37#include "implicit_f.inc"
38C-----------------------------------------------
39C M e s s a g e P a s s i n g
40C-----------------------------------------------
41#include "spmd.inc"
42C-----------------------------------------------
43C C o m m o n B l o c k s
44C-----------------------------------------------
45#include "com01_c.inc"
46#include "task_c.inc"
47C-----------------------------------------------
48C D u m m y A r g u m e n t s
49C-----------------------------------------------
50 INTEGER LCOMM, FR_CDNS(*), IAD_CDNS(*)
52 . stifnd(*)
53C-----------------------------------------------
54C L o c a l V a r i a b l e s
55C-----------------------------------------------
56#ifdef MPI
57 INTEGER MSGTYP,LOC_PROC,NOD,I,J,L,IDEB,IAD,LEN,
58 . nbindex,index,msgoff,siz,ierror,
59 . status(mpi_status_size),
60 . req_s(nspmd),req_r(nspmd),indexi(nspmd)
61 DATA msgoff/1179/
63 . sbuf(lcomm),rbuf(lcomm)
64C-----------------------------------------------
65C S o u r c e L i n e s
66C-----------------------------------------------
67 loc_proc = ispmd + 1
68C
69 ideb = 1
70 l = 0
71c ISIZE = 1
72 DO i = 1, nspmd
73 len = iad_cdns(i+1)-iad_cdns(i)
74 IF(len>0) THEN
75 siz = len
76 l=l+1
77 indexi(l)=i
78 msgtyp = msgoff
79 CALL mpi_irecv(
80 s rbuf(ideb),siz,real,it_spmd(i),msgtyp,
81 g spmd_comm_world,req_r(l),ierror)
82 ideb = ideb + siz
83 ENDIF
84 ENDDO
85 nbindex = l
86C
87 ideb = 1
88 DO l = 1, nbindex
89 i = indexi(l)
90 len = iad_cdns(i+1) - iad_cdns(i)
91 iad = iad_cdns(i)-1
92 DO j = 1, len
93 nod = fr_cdns(iad+j)
94 sbuf(ideb) = stifnd(nod)
95 ideb = ideb + 1
96 ENDDO
97 ENDDO
98C
99 ideb = 1
100 DO l=1,nbindex
101 i = indexi(l)
102 len = iad_cdns(i+1)-iad_cdns(i)
103 siz = len
104 msgtyp = msgoff
105 CALL mpi_isend(
106 s sbuf(ideb),siz,real,it_spmd(i),msgtyp,
107 g spmd_comm_world,req_s(l),ierror)
108 ideb = ideb + siz
109 ENDDO
110C
111 DO l=1,nbindex
112 CALL mpi_waitany(nbindex,req_r,index,status,ierror)
113 i = indexi(index)
114 ideb = iad_cdns(i)
115 len = iad_cdns(i+1)-iad_cdns(i)
116 iad = iad_cdns(i)-1
117 DO j = 1, len
118 nod = fr_cdns(iad+j)
119 stifnd(nod) = stifnd(nod) + rbuf(ideb)
120 ideb = ideb + 1
121 ENDDO
122 ENDDO
123C
124 DO l=1,nbindex
125 CALL mpi_waitany(nbindex,req_s,index,status,ierror)
126 ENDDO
127C
128#endif
129 RETURN
130 END SUBROUTINE
131C
132
#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_stif_scnd(stifnd, fr_cdns, iad_cdns, lcomm)