OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_glob_min5.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_glob_min5 ../engine/source/mpi/generic/spmd_glob_min5.F
26!||--- called by ------------------------------------------------------
27!|| resol ../engine/source/engine/resol.F
28!||--- calls -----------------------------------------------------
29!||--- uses -----------------------------------------------------
30!|| intbufdef_mod ../common_source/modules/interfaces/intbufdef_mod.F90
31!|| spmd_comm_world_mod ../engine/source/mpi/spmd_comm_world.F90
32!||====================================================================
33 SUBROUTINE spmd_glob_min5(DT2 ,ITYPTS,NELTS,ICODT,IMSCH,
34 . TSTOP,IWIOUT,MSTOP,ISMSCH,
35 . INT24USE,NBINTC,INTLIST,IPARI,INTBUF_TAB)
36C-----------------------------------------------
37C M o d u l e s
38C-----------------------------------------------
39 USE intbufdef_mod
40C-----------------------------------------------
41C I m p l i c i t T y p e s
42C-----------------------------------------------
43 USE spmd_comm_world_mod, ONLY : spmd_comm_world
44#include "implicit_f.inc"
45C-----------------------------------------------------------------
46C M e s s a g e P a s s i n g
47C-----------------------------------------------
48#include "spmd.inc"
49C-----------------------------------------------
50C C o m m o n B l o c k s
51C-----------------------------------------------
52#include "task_c.inc"
53#include "param_c.inc"
54C-----------------------------------------------
55C D u m m y A r g u m e n t s
56C-----------------------------------------------
57 INTEGER ITYPTS, NELTS, ICODT ,IMSCH, IWIOUT,MSTOP,
58 . ISMSCH
59C Interface type 24 communication addon
60 INTEGER INT24USE,NBINTC,INTLIST(*),IPARI(NPARI,*)
61 my_real
62 . dt2, tstop
63 TYPE(intbuf_struct_) INTBUF_TAB(*)
64C-----------------------------------------------
65C L o c a l V a r i a b l e s
66C-----------------------------------------------
67#ifdef MPI
68 INTEGER IERROR, LOC_PROC, MSTOP1, MSTOP2, LEN, myop,
69 . STATUS(MPI_STATUS_SIZE)
70 my_real,
71 . DIMENSION(:),ALLOCATABLE :: rbuf, sbuf
72C interface type 24 comm Addon
73 INTEGER NIN,NI,NTY
74 INTEGER :: MY_TYPE
75 INTEGER GLOB_MIN
76 EXTERNAL glob_min
77C-----------------------------------------------
78C S o u r c e L i n e s
79C-----------------------------------------------
80 IF(int24use==1)THEN
81 len = 10 + nbintc
82 ELSE
83 len = 10
84 ENDIF
85 ALLOCATE(rbuf(len))
86 ALLOCATE(sbuf(len))
87 rbuf(1:len)=zero
88
89 mstop1=0
90 mstop2=0
91 IF(mstop==1)mstop1=1
92 IF(mstop==2)mstop2=1
93C
94 loc_proc=ispmd+1
95C
96 sbuf(1) = dt2
97 sbuf(2) = itypts
98 sbuf(3) = nelts
99 sbuf(4) = iexicodt
100 sbuf(5) = imsch
101 sbuf(6) = tstop
102 sbuf(7) = iwiout
103 sbuf(8) = mstop1
104 sbuf(9) = mstop2
105 sbuf(10)= ismsch
106
107 IF (int24use==1)THEN
108 DO ni=1,nbintc
109 nin = intlist(ni)
110 nty = ipari( 7,nin)
111 IF(nty==24.OR.nty==25) THEN
112 sbuf(10+ni) = intbuf_tab(nin)%VARIABLES(23)
113 ELSE
114 sbuf(10+ni) = zero
115 ENDIF
116 ENDDO
117 ENDIF
118
119 CALL mpi_type_contiguous(10,real,my_type,ierror)
120 CALL mpi_type_commit(my_type,ierror)
121C
122 CALL mpi_op_create(glob_min, .true., myop, ierror)
123
124 CALL mpi_allreduce(sbuf, rbuf, 1, my_type, myop,
125 & spmd_comm_world, ierror)
126
127 IF (int24use==1)THEN
128 CALL mpi_allreduce(sbuf(11), rbuf(11), nbintc, real , mpi_max,
129 & spmd_comm_world, ierror)
130 ENDIF
131
132 CALL mpi_op_free(myop, ierror)
133 CALL mpi_type_free(my_type,ierror)
134
135C
136 dt2 = rbuf(1)
137 itypts = nint(rbuf(2))
138 nelts = nint(rbuf(3))
139 iexicodt = nint(rbuf(4))
140 imsch = nint(rbuf(5))
141 tstop = rbuf(6)
142 iwiout = nint(rbuf(7))
143 mstop1 = nint(rbuf(8))
144 mstop2 = nint(rbuf(9))
145 IF(mstop1/=0)mstop=1
146 IF(mstop2/=0)mstop=2
147 ismsch = rbuf(10)
148C
149 IF (int24use==1)THEN
150 DO ni=1,nbintc
151 nin = intlist(ni)
152 nty = ipari( 7,nin)
153 IF(nty==24.OR.nty==25) THEN
154 intbuf_tab(nin)%VARIABLES(23) = rbuf(10+ni)
155 ENDIF
156 ENDDO
157 ENDIF
158C
159 DEALLOCATE(rbuf)
160 DEALLOCATE(sbuf)
161C
162#endif
163 RETURN
164 END
subroutine mpi_type_free(newtyp, ierr_mpi)
Definition mpi.f:399
subroutine mpi_type_contiguous(length, datatype, newtype, ierr_mpi)
Definition mpi.f:406
subroutine mpi_allreduce(sendbuf, recvbuf, cnt, datatype, operation, comm, ierr)
Definition mpi.f:103
subroutine mpi_type_commit(newtyp, ierr_mpi)
Definition mpi.f:393
subroutine mpi_op_create(func, commute, op, ierr)
Definition mpi.f:412
subroutine mpi_op_free(op, ierr)
Definition mpi.f:421
subroutine spmd_glob_min5(dt2, itypts, nelts, icodt, imsch, tstop, iwiout, mstop, ismsch, int24use, nbintc, intlist, ipari, intbuf_tab)