OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_exch_nodarea2.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
25
26!||====================================================================
27!|| spmd_exch_nodarea2 ../engine/source/mpi/anim/spmd_exch_nodarea2.F
28!||--- called by ------------------------------------------------------
29!|| genani ../engine/source/output/anim/generate/genani.F
30!|| h3d_nodal_tensor ../engine/source/output/h3d/h3d_results/h3d_nodal_tensor.F
31!|| h3d_sol_skin_scalar ../engine/source/output/h3d/h3d_results/h3d_sol_skin_scalar.F
32!|| h3d_sol_skin_tensor ../engine/source/output/h3d/h3d_results/h3d_sol_skin_tensor.F
33!||--- calls -----------------------------------------------------
34!||--- uses -----------------------------------------------------
35!|| spmd_comm_world_mod ../engine/source/mpi/spmd_comm_world.F90
36!||====================================================================
38 . NODAREA,IAD_ELEM,FR_ELEM,LENR,WEIGHT,JJ)
39C-----------------------------------------------
40C I m p l i c i t T y p e s
41C-----------------------------------------------
42 USE spmd_comm_world_mod, ONLY : spmd_comm_world
43#include "implicit_f.inc"
44C-----------------------------------------------------------------
45C M e s s a g e P a s s i n g
46C-----------------------------------------------
47#include "spmd.inc"
48C-----------------------------------------------
49C C o m m o n B l o c k s
50C-----------------------------------------------
51#include "com01_c.inc"
52#include "task_c.inc"
53C-----------------------------------------------
54C D u m m y A r g u m e n t s
55C-----------------------------------------------
56 INTEGER IAD_ELEM(2,*),FR_ELEM(*), SIZE, LENR,WEIGHT(*),JJ
57 my_real
58 . nodarea(3,*)
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,
64 . siz,j,k,l,nb_nod,
65 . status(mpi_status_size),
66 . iad_send(nspmd+1),iad_recv(nspmd+1),
67 . req_r(nspmd),req_s(nspmd),msgoff
68
69 my_real,
70 . DIMENSION(:),ALLOCATABLE :: sbuf,rbuf
71 DATA msgoff/7035/
72C-----------------------------------------------
73C S o u r c e L i n e s
74C-----------------------------------------------
75 ALLOCATE(sbuf(lenr))
76 ALLOCATE(rbuf(lenr))
77C-----------------------------------------------
78 loc_proc = ispmd+1
79 l = 1
80 iad_recv(1)=1
81
82C Mise en place des buffers de reception
83 DO i=1,nspmd
84 siz = iad_elem(1,i+1)-iad_elem(1,i)
85 IF(siz/=0) THEN
86 msgtyp = msgoff
87 CALL mpi_irecv(
88 s rbuf(l),siz,real,it_spmd(i),msgtyp,
89 g spmd_comm_world,req_r(i),ierror)
90 l = l+siz
91 END IF
92 iad_recv(i+1) = l
93 END DO
94
95! Remplissage des buffers d'envoi et envoi des donnees
96C
97 l=1
98 iad_send(1)=1
99 DO i=1,nspmd
100 DO j=iad_elem(1,i),iad_elem(1,i+1)-1
101 nod = fr_elem(j)
102 sbuf(l) = nodarea(jj,nod)
103 l = l+1
104 END DO
105 iad_send(i+1) = l
106 END DO
107
108 DO i=1,nspmd
109
110 IF(iad_elem(1,i+1)-iad_elem(1,i)>0)THEN
111
112
113 msgtyp = msgoff
114 siz = iad_send(i+1)-iad_send(i)
115 l = iad_send(i)
116
117 CALL mpi_isend(
118 s sbuf(l),siz,real,it_spmd(i),msgtyp,
119 g spmd_comm_world,req_s(i),ierror)
120 ENDIF
121 END DO
122! Reception et traitement
123 DO i = 1, nspmd
124C
125 nb_nod = iad_elem(1,i+1)-iad_elem(1,i)
126 IF(nb_nod>0)THEN
127 CALL mpi_wait(req_r(i),status,ierror)
128 l = iad_recv(i)
129
130 DO j=iad_elem(1,i),iad_elem(1,i+1)-1
131
132 nod = fr_elem(j)
133 nodarea(jj,nod) = nodarea(jj,nod) + rbuf(l)
134 l = l+1
135 ENDDO
136 ENDIF
137 ENDDO
138
139 DO i = 1, nspmd
140 IF(iad_elem(1,i+1)-iad_elem(1,i)>0)THEN
141 CALL mpi_wait(req_s(i),status,ierror)
142 ENDIF
143 ENDDO
144C-----------------------------------------------
145 DEALLOCATE(sbuf)
146 DEALLOCATE(rbuf)
147C-----------------------------------------------
148#endif
149 RETURN
150 END
#define my_real
Definition cppsort.cpp:32
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_nodarea2(nodarea, iad_elem, fr_elem, lenr, weight, jj)