OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_i21crit.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_i21crit ../engine/source/mpi/interfaces/spmd_i21crit.F
26!||--- called by ------------------------------------------------------
27!|| i21_icrit ../engine/source/interfaces/intsort/i21_icrit.F
28!||--- calls -----------------------------------------------------
29!|| spmd_rbcast ../engine/source/mpi/generic/spmd_rbcast.F
30!||--- uses -----------------------------------------------------
31!|| spmd_comm_world_mod ../engine/source/mpi/spmd_comm_world.F90
32!||====================================================================
33 SUBROUTINE spmd_i21crit(GAPINF,VX,VY,VZ,DIST)
34C-----------------------------------------------
35C I m p l i c i t T y p e s
36C-----------------------------------------------
37 USE spmd_comm_world_mod, ONLY : spmd_comm_world
38#include "implicit_f.inc"
39C-----------------------------------------------------------------
40C M e s s a g e P a s s i n g
41C-----------------------------------------------
42#include "spmd.inc"
43C-----------------------------------------------
44C C o m m o n B l o c k s
45C-----------------------------------------------
46#include "com01_c.inc"
47#include "intstamp_c.inc"
48#include "task_c.inc"
49C-----------------------------------------------
50C D u m m y A r g u m e n t s
51C-----------------------------------------------
53 . gapinf(*),vx(*),vy(*),vz(*),dist(*)
54C-----------------------------------------------
55C L o c a l V a r i a b l e s
56C-----------------------------------------------
57#ifdef MPI
58 INTEGER I, N, MSGTYP, IERROR, LOC_PROC,
59 . SIZE
61 . rbuf(5,nintstamp,nspmd),rrbuf(5,nintstamp)
62C-----------------------------------------------
63C S o u r c e L i n e s
64C-----------------------------------------------
65C
66 loc_proc=ispmd+1
67 SIZE = 5*nintstamp
68C
69 DO n=1,nintstamp
70 rrbuf(1,n) = gapinf(n)
71 rrbuf(2,n) = vx(n)
72 rrbuf(3,n) = vy(n)
73 rrbuf(4,n) = vz(n)
74 rrbuf(5,n) = dist(n)
75 END DO
76C
77 CALL mpi_gather(
78 s rrbuf ,SIZE ,real,
79 r rbuf ,SIZE ,real,it_spmd(1),
80 g spmd_comm_world,ierror)
81 IF(ispmd==0) THEN
82 DO n=1,nintstamp
83 DO i = 2, nspmd
84 IF(rbuf(1,n,i)<rbuf(1,n,1))THEN
85 rbuf(1,n,1) = rbuf(1,n,i)
86 END IF
87 IF(rbuf(2,n,i)>rbuf(2,n,1))THEN
88 rbuf(2,n,1) = rbuf(2,n,i)
89 END IF
90 IF(rbuf(3,n,i)>rbuf(3,n,1))THEN
91 rbuf(3,n,1) = rbuf(3,n,i)
92 END IF
93 IF(rbuf(4,n,i)>rbuf(4,n,1))THEN
94 rbuf(4,n,1) = rbuf(4,n,i)
95 END IF
96 IF(rbuf(5,n,i)<rbuf(5,n,1))THEN
97 rbuf(5,n,1) = rbuf(5,n,i)
98 END IF
99 END DO
100 END DO
101 END IF
102 CALL spmd_rbcast(rbuf,rbuf,SIZE,1,0,2)
103C
104 DO n=1,nintstamp
105 gapinf(n)=rbuf(1,n,1)
106 vx(n) =rbuf(2,n,1)
107 vy(n) =rbuf(3,n,1)
108 vz(n) =rbuf(4,n,1)
109 dist(n) =rbuf(5,n,1)
110 END DO
111C
112#endif
113 RETURN
114 END
#define my_real
Definition cppsort.cpp:32
subroutine mpi_gather(sendbuf, cnt, datatype, recvbuf, reccnt, rectype, root, comm, ierr)
Definition mpi.f:56
subroutine spmd_i21crit(gapinf, vx, vy, vz, dist)
subroutine spmd_rbcast(tabi, tabr, n1, n2, from, add)
Definition spmd_rbcast.F:62