OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_exch_adm.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_adm ../engine/source/mpi/anim/spmd_exch_adm.F
25!||--- called by ------------------------------------------------------
26!|| sortie_main ../engine/source/output/sortie_main.F
27!||--- calls -----------------------------------------------------
28!||--- uses -----------------------------------------------------
29!|| spmd_comm_world_mod ../engine/source/mpi/spmd_comm_world.F90
30!||====================================================================
31 SUBROUTINE spmd_exch_adm(ADM,IAD_ELEM,FR_ELEM,LENR,WEIGHT_MD)
32C realise la sommation des ajouts de masses au noeuds frontieres
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 "com04_c.inc"
47#include "task_c.inc"
48C-----------------------------------------------
49C D u m m y A r g u m e n t s
50C-----------------------------------------------
51 INTEGER IAD_ELEM(2,*),FR_ELEM(*), SIZE, LENR,WEIGHT_MD(*)
52 my_real adm(*)
53C-----------------------------------------------
54C L o c a l V a r i a b l e s
55C-----------------------------------------------
56#ifdef MPI
57 INTEGER MSGTYP,I,NOD,LOC_PROC,IERROR,
58 . SIZ,J,K,L,NB_NOD,
59 . STATUS(MPI_STATUS_SIZE),
60 . IAD_SEND(NSPMD+1),IAD_RECV(NSPMD+1),
61 . REQ_R(NSPMD),REQ_S(NSPMD),MSGOFF
62
63 my_real, DIMENSION(:), ALLOCATABLE :: sbuf,rbuf
64 DATA msgoff/7001/
65C-----------------------------------------------
66C S o u r c e L i n e s
67C-----------------------------------------------
68 ALLOCATE(sbuf(lenr+1))
69 ALLOCATE(rbuf(lenr+1))
70C-----------------------------------------------
71 loc_proc = ispmd+1
72 l = 1
73 iad_recv(1)=1
74
75C Mise en place des buffers de reception
76 DO i=1,nspmd
77 siz = iad_elem(1,i+1)-iad_elem(1,i)
78 IF(siz/=0) THEN
79 msgtyp = msgoff
80 CALL mpi_irecv(
81 s rbuf(l),siz,real,it_spmd(i),msgtyp,
82 g spmd_comm_world,req_r(i),ierror)
83 l = l+siz
84 END IF
85 iad_recv(i+1) = l
86 END DO
87
88C Remplissage des buffers d'envoi et envoi des donnees
89C
90 l=1
91 iad_send(1)=1
92 DO i=1,nspmd
93 DO j=iad_elem(1,i),iad_elem(1,i+1)-1
94 nod = fr_elem(j)
95 sbuf(l) = adm(nod)
96 l = l+1
97 END DO
98 iad_send(i+1) = l
99 END DO
100
101 DO i=1,nspmd
102
103 IF(iad_elem(1,i+1)-iad_elem(1,i)>0)THEN
104
105
106 msgtyp = msgoff
107 siz = iad_send(i+1)-iad_send(i)
108 l = iad_send(i)
109
110 CALL mpi_isend(
111 s sbuf(l),siz,real,it_spmd(i),msgtyp,
112 g spmd_comm_world,req_s(i),ierror)
113 ENDIF
114 END DO
115C Reception et traitement
116 DO i = 1, nspmd
117C
118 nb_nod = iad_elem(1,i+1)-iad_elem(1,i)
119 IF(nb_nod>0)THEN
120 CALL mpi_wait(req_r(i),status,ierror)
121 l = iad_recv(i)
122
123 DO j=iad_elem(1,i),iad_elem(1,i+1)-1
124
125 nod = fr_elem(j)
126 adm(nod) = adm(nod) + rbuf(l)
127 l = l+1
128 ENDDO
129 ENDIF
130 ENDDO
131
132 DO i = 1, nspmd
133 IF(iad_elem(1,i+1)-iad_elem(1,i)>0)THEN
134 CALL mpi_wait(req_s(i),status,ierror)
135 ENDIF
136 ENDDO
137C
138C Mise a 0 de adm sur noeud non main
139C
140 DO i = 1, numnod
141 IF(weight_md(i)==0) adm(i) = zero
142 ENDDO
143C
144 DEALLOCATE(sbuf)
145 DEALLOCATE(rbuf)
146C-----------------------------------------------
147#endif
148 RETURN
149 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_adm(adm, iad_elem, fr_elem, lenr, weight_md)