OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_exch_nodareai.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_nodareai ../engine/source/mpi/anim/spmd_exch_nodareai.F
25!||--- called by ------------------------------------------------------
26!|| genani ../engine/source/output/anim/generate/genani.F
27!|| gpstra_solid ../engine/source/output/outmaxsubr.F
28!|| h3d_nodal_tensor ../engine/source/output/h3d/h3d_results/h3d_nodal_tensor.F
29!|| h3d_sol_skin_scalar ../engine/source/output/h3d/h3d_results/h3d_sol_skin_scalar.F
30!|| h3d_sol_skin_tensor ../engine/source/output/h3d/h3d_results/h3d_sol_skin_tensor.F
31!|| inter_sh_offset_ini ../engine/source/interfaces/shell_offset/inter_offset_ini.F90
32!||--- calls -----------------------------------------------------
33!||--- uses -----------------------------------------------------
34!|| spmd_comm_world_mod ../engine/source/mpi/spmd_comm_world.F90
35!||====================================================================
37 . NODAREAI,IAD_ELEM,FR_ELEM,LENR,WEIGHT)
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_ELEM(2,*),FR_ELEM(*), SIZE, LENR,WEIGHT(*)
56 INTEGER NODAREAI(*)
57C-----------------------------------------------
58C L o c a l V a r i a b l e s
59C-----------------------------------------------
60#ifdef MPI
61 INTEGER MSGTYP,I,NOD,LOC_PROC,IERROR,
62 . siz,j,k,l,nb_nod,
63 . status(mpi_status_size),
64 . iad_send(nspmd+1),iad_recv(nspmd+1),
65 . req_r(nspmd),req_s(nspmd),msgoff
66
67 INTEGER, DIMENSION(:),ALLOCATABLE :: SBUF,RBUF
68 DATA msgoff/7035/
69C-----------------------------------------------
70C S o u r c e L i n e s
71C-----------------------------------------------
72 ALLOCATE(sbuf(lenr))
73 ALLOCATE(rbuf(lenr))
74C-----------------------------------------------
75 loc_proc = ispmd+1
76 l = 1
77 iad_recv(1)=1
78
79C Mise en place des buffers de reception
80 DO i=1,nspmd
81 siz = iad_elem(1,i+1)-iad_elem(1,i)
82 IF(siz/=0) THEN
83 msgtyp = msgoff
84 CALL mpi_irecv(
85 s rbuf(l),siz,mpi_integer,it_spmd(i),msgtyp,
86 g spmd_comm_world,req_r(i),ierror)
87 l = l+siz
88 END IF
89 iad_recv(i+1) = l
90 END DO
91
92! Remplissage des buffers d'envoi et envoi des donnees
93
94 l=1
95 iad_send(1)=1
96 DO i=1,nspmd
97 DO j=iad_elem(1,i),iad_elem(1,i+1)-1
98 nod = fr_elem(j)
99 sbuf(l) = nodareai(nod)
100 l = l+1
101 END DO
102 iad_send(i+1) = l
103 END DO
104
105 DO i=1,nspmd
106
107 IF(iad_elem(1,i+1)-iad_elem(1,i)>0)THEN
108
109
110 msgtyp = msgoff
111 siz = iad_send(i+1)-iad_send(i)
112 l = iad_send(i)
113
114 CALL mpi_isend(
115 s sbuf(l),siz,mpi_integer,it_spmd(i),msgtyp,
116 g spmd_comm_world,req_s(i),ierror)
117 ENDIF
118 END DO
119! Reception et traitement
120 DO i = 1, nspmd
121C
122 nb_nod = iad_elem(1,i+1)-iad_elem(1,i)
123 IF(nb_nod>0)THEN
124 CALL mpi_wait(req_r(i),status,ierror)
125 l = iad_recv(i)
126
127 DO j=iad_elem(1,i),iad_elem(1,i+1)-1
128
129 nod = fr_elem(j)
130 nodareai(nod) = nodareai(nod) + rbuf(l)
131 l = l+1
132 ENDDO
133 ENDIF
134 ENDDO
135
136 DO i = 1, nspmd
137 IF(iad_elem(1,i+1)-iad_elem(1,i)>0)THEN
138 CALL mpi_wait(req_s(i),status,ierror)
139 ENDIF
140 ENDDO
141C-----------------------------------------------
142 DEALLOCATE(sbuf)
143 DEALLOCATE(rbuf)
144C-----------------------------------------------
145#endif
146 RETURN
147 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_nodareai(nodareai, iad_elem, fr_elem, lenr, weight)