OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_exch_fr6.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/.
23C
24!||====================================================================
25!|| spmd_exch_fr6 ../engine/source/mpi/kinematic_conditions/spmd_exch_fr6.F
26!||--- called by ------------------------------------------------------
27!|| airbagb ../engine/source/airbag/airbag2.F
28!|| airbagb1 ../engine/source/airbag/airbagb1.F
29!|| damping_vref ../engine/source/assembly/damping_vref.F
30!|| get_volume_area ../engine/source/airbag/get_volume_area.F90
31!|| poro ../engine/source/ale/porous/poro.F
32!|| rbyact ../engine/source/constraints/general/rbody/rbyact.F
33!|| rbypid ../engine/source/constraints/general/rbody/rbypid.F
34!|| rgwal0 ../engine/source/constraints/general/rwall/rgwal0.F
35!|| rgwal0_imp ../engine/source/constraints/general/rwall/rgwal0.F
36!|| rgwal0_pen ../engine/source/constraints/general/rwall/rgwall_pen.F90
37!|| rgwath ../engine/source/interfaces/int09/rgwath.F
38!|| rlink0 ../engine/source/constraints/general/rlink/rlink0.F
39!|| rlink10 ../engine/source/constraints/general/rlink/rlink10.F
40!|| rlink11 ../engine/source/constraints/general/rlink/rlink10.F
41!|| sms_rgwal_0 ../engine/source/ams/sms_rgwal0.F
42!|| sms_rlink10 ../engine/source/ams/sms_rlink.F
43!|| sms_rlink11 ../engine/source/ams/sms_rlink.F
44!|| spgauge ../engine/source/elements/sph/spgauge.F
45!|| volpvgb ../engine/source/airbag/volpvg.F
46!|| volum0 ../engine/source/airbag/volum0.F
47!||--- calls -----------------------------------------------------
48!||--- uses -----------------------------------------------------
49!|| spmd_comm_world_mod ../engine/source/mpi/spmd_comm_world.F90
50!||====================================================================
51 SUBROUTINE spmd_exch_fr6(FR,FS6,LEN)
52C cumul force sur frontiere en parith/on
53C-----------------------------------------------
54C I m p l i c i t T y p e s
55C-----------------------------------------------
56 USE spmd_comm_world_mod, ONLY : spmd_comm_world
57#include "implicit_f.inc"
58C-----------------------------------------------------------------
59C M e s s a g e P a s s i n g
60C-----------------------------------------------
61#include "spmd.inc"
62C-----------------------------------------------
63C C o m m o n B l o c k s
64C-----------------------------------------------
65#include "com01_c.inc"
66#include "task_c.inc"
67C-----------------------------------------------
68C D u m m y A r g u m e n t s
69C-----------------------------------------------
70 INTEGER LEN, FR(*)
71 DOUBLE PRECISION FS6(LEN)
72C-----------------------------------------------
73C L o c a l V a r i a b l e s
74C-----------------------------------------------
75#ifdef MPI
76 INTEGER MSGOFF,MSGTYP,P,PMAIN, LOC_PROC, J, L,
77 . IDEB, NBINDEX, INDEX, REQ(NSPMD-1)
78 DATA msgoff/162/
79 INTEGER STATUS(MPI_STATUS_SIZE),IERROR
80 DOUBLE PRECISION FTMP(LEN*(NSPMD-1))
81C-----------------------------------------------
82C S o u r c e L i n e s
83C-----------------------------------------------
84 pmain = fr(nspmd+2)
85 loc_proc = ispmd+1
86 IF(loc_proc==pmain) THEN
87 ideb = 1
88 l = 0
89 DO p = 1, nspmd
90 IF(loc_proc/=p.AND.fr(p)/=0)THEN
91 l=l+1
92C INDEXI(L)=P
93 msgtyp = msgoff
94 CALL mpi_irecv(ftmp(ideb) ,len ,mpi_double_precision,it_spmd(p),
95 . msgtyp,spmd_comm_world,req(l),ierror )
96 ideb = ideb + len
97 END IF
98 END DO
99 nbindex = l
100C
101 DO l = 1, nbindex
102 CALL mpi_waitany(nbindex,req,index,status,ierror)
103C P = INDEXI(INDEX)
104 ideb = len*(index-1)
105 DO j = 1, len
106 fs6(j) = fs6(j) + ftmp(ideb+j)
107 END DO
108 ENDDO
109C
110 DO p = 1, nspmd
111 IF(loc_proc/=p.AND.fr(p)/=0)THEN
112 msgtyp = msgoff
113 CALL mpi_send(fs6 ,len ,mpi_double_precision,it_spmd(p),
114 . msgtyp,spmd_comm_world,ierror)
115 ENDIF
116 ENDDO
117C
118 ELSE
119 IF(fr(loc_proc)/=0) THEN
120 msgtyp = msgoff
121 CALL mpi_send(fs6 ,len ,mpi_double_precision,it_spmd(pmain),
122 . msgtyp,spmd_comm_world,ierror)
123 CALL mpi_recv(fs6 ,len ,mpi_double_precision,it_spmd(pmain),
124 . msgtyp,spmd_comm_world,status,ierror )
125 ENDIF
126 ENDIF
127C
128#endif
129 RETURN
130 END
subroutine mpi_recv(buf, cnt, datatype, source, tag, comm, status, ierr)
Definition mpi.f:461
subroutine mpi_send(buf, cnt, datatype, dest, tag, comm, ierr)
Definition mpi.f:480
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_fr6(fr, fs6, len)