OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_glob_minv.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==========================================================================
24C==========================================================================
25!||====================================================================
26!|| spmd_glob_minv ../engine/source/mpi/generic/spmd_glob_minv.F
27!||--- called by ------------------------------------------------------
28!|| resol ../engine/source/engine/resol.F
29!||--- calls -----------------------------------------------------
30!||--- uses -----------------------------------------------------
31!|| monvol_struct_mod ../engine/share/modules/monvol_struct_mod.F
32!|| spmd_comm_world_mod ../engine/source/mpi/spmd_comm_world.F90
33!||====================================================================
34 SUBROUTINE spmd_glob_minv(T_MONVOL, DT2,ITYPTS,NELTS,VOLMON, FR_MV)
35C-----------------------------------------------
36C I m p l i c i t T y p e s
37C-----------------------------------------------
38 USE spmd_comm_world_mod, ONLY : spmd_comm_world
40#include "implicit_f.inc"
41C-----------------------------------------------------------------
42C M e s s a g e P a s s i n g
43C-----------------------------------------------
44#include "spmd.inc"
45C-----------------------------------------------
46C C o m m o n B l o c k s
47C-----------------------------------------------
48#include "com01_c.inc"
49#include "com04_c.inc"
50#include "task_c.inc"
51#include "param_c.inc"
52C-----------------------------------------------
53C D u m m y A r g u m e n t s
54C-----------------------------------------------
55 TYPE(monvol_struct_) :: T_MONVOL(NVOLU)
56 INTEGER ITYPTS, NELTS, FR_MV(NSPMD+2,NVOLU)
58 . dt2, volmon(*)
59C-----------------------------------------------
60C L o c a l V a r i a b l e s
61C-----------------------------------------------
62#ifdef MPI
63 INTEGER I, J, N, MSGTYP, IERROR, LOC_PROC,
64 . INDEX, MSTOP1, MSTOP2, K1, KK1,
65 . LEN, myop,
66 . STATUS(MPI_STATUS_SIZE)
68 . rbuf(3+nvolu*7), rrbuf(3+nvolu*7)
69 INTEGER :: MY_TYPE
70 INTEGER GLOB_MINV
71 EXTERNAL glob_minv
72C-----------------------------------------------
73C S o u r c e L i n e s
74C-----------------------------------------------
75C
76 loc_proc=ispmd+1
77C
78 rrbuf(1) = dt2
79 rrbuf(2) = itypts
80 rrbuf(3) = nelts
81 DO i = 1, nvolu*7
82 rrbuf(3+i) = zero
83 END DO
84 k1 = 1
85 kk1 = 0
86 DO i=1,nvolu
87 IF(fr_mv(nspmd+2,i)==ispmd+1) THEN
88 rrbuf(3+(i-1)*7+1)=volmon(kk1+1)
89 rrbuf(3+(i-1)*7+2)=volmon(kk1+2)
90 rrbuf(3+(i-1)*7+3)=volmon(kk1+5)
91 rrbuf(3+(i-1)*7+4)=volmon(kk1+12)
92 rrbuf(3+(i-1)*7+5)=volmon(kk1+16)
93 rrbuf(3+(i-1)*7+6)=volmon(kk1+18)
94 rrbuf(3+(i-1)*7+7)=volmon(kk1+21)
95 END IF
96 k1 = k1 + nimv
97 kk1 = kk1 + nrvolu
98 END DO
99
100 len = 3+nvolu*7
101
102 CALL mpi_type_contiguous(len,real,my_type,ierror)
103 CALL mpi_type_commit(my_type,ierror)
104 CALL mpi_op_create(glob_minv, .true., myop, ierror)
105
106 CALL mpi_allreduce(rrbuf, rbuf, 1, my_type, myop,
107 & spmd_comm_world, ierror)
108
109 CALL mpi_op_free(myop, ierror)
110 CALL mpi_type_free(my_type,ierror)
111
112 dt2 = rbuf(1)
113 itypts = rbuf(2)
114 nelts = rbuf(3)
115 k1 = 1
116 kk1 = 0
117 DO i=1,nvolu
118 volmon(kk1+1) =rbuf(3+(i-1)*7+1)
119 volmon(kk1+2) =rbuf(3+(i-1)*7+2)
120 volmon(kk1+5) =rbuf(3+(i-1)*7+3)
121 volmon(kk1+12)=rbuf(3+(i-1)*7+4) ! pressure
122 volmon(kk1+16)=rbuf(3+(i-1)*7+5) !Volume ?
123 volmon(kk1+18)=rbuf(3+(i-1)*7+6) ! area
124 volmon(kk1+21)=rbuf(3+(i-1)*7+7)
125 t_monvol(i)%pressure = volmon(kk1+12)
126 t_monvol(i)%temperature = volmon(kk1+13)
127 t_monvol(i)%area = volmon(kk1+18)
128! write(6,*) "Pressure ", I, " is ", T_MONVOL(I)%pressure
129! write(6,*) "Temperature ", I, " is ", T_MONVOL(I)%temperature
130! write(6,*) "Area ", I, " is ", T_MONVOL(I)%area
131! write(6,*) "Volume ", I, " is ", VOLMON(KK1+16),T_MONVOL(I)%volume
132 k1 = k1 + nimv
133 kk1 = kk1 + nrvolu
134 END DO
135C
136#endif
137 RETURN
138 END
#define my_real
Definition cppsort.cpp:32
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_minv(t_monvol, dt2, itypts, nelts, volmon, fr_mv)