OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_fvb_adim.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!||====================================================================
25!|| spmd_fvb_adim ../engine/source/mpi/anim/spmd_fvb_adim.F
26!||--- called by ------------------------------------------------------
27!|| genani ../engine/source/output/anim/generate/genani.F
28!||--- calls -----------------------------------------------------
29!||--- uses -----------------------------------------------------
30!|| fvbag_mod ../engine/share/modules/fvbag_mod.F
31!|| spmd_comm_world_mod ../engine/source/mpi/spmd_comm_world.F90
32!||====================================================================
33 SUBROUTINE spmd_fvb_adim(NFVTR, FVOFF , NFVNOD, NFVPART, NFVSUBS,
34 . IDMAX, ITAB , NODCUT, NNWL , NNSRG ,
35 . NNSMD, NNSPHG)
36C-----------------------------------------------
37C M o d u l e s
38C-----------------------------------------------
39 USE fvbag_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 "com01_c.inc"
53#include "com04_c.inc"
54#include "task_c.inc"
55#include "spmd_c.inc"
56C-----------------------------------------------
57C D u m m y A r g u m e n t s
58C-----------------------------------------------
59 INTEGER NFVTR, FVOFF(2,*), NFVNOD, NFVPART, NFVSUBS, IDMAX,
60 . ITAB(*), NODCUT, NNWL, NNSRG, NNSMD, NNSPHG
61C-----------------------------------------------
62C L o c a l V a r i a b l e s
63C-----------------------------------------------
64#ifdef MPI
65 INTEGER IDMAXL, I, MSGOFF, IDMAXP(NSPMD-1),
66 . REQ(NSPMD-1), IERR, STAT(MPI_STATUS_SIZE,NSPMD-1),
67 . pmain, tab(4),msgtyp
68 DATA msgoff/7037/
69C
70 idmaxl=0
71 DO i=1,numnod
72 idmaxl=max(idmaxl,itab(i))
73 ENDDO
74 IF (ispmd==0) THEN
75 DO i=1,nspmd-1
76 msgtyp=msgoff
77 CALL mpi_irecv(idmaxp(i), 1, mpi_integer, it_spmd(i+1),
78 . msgtyp, spmd_comm_world, req(i), ierr)
79 ENDDO
80 CALL mpi_waitall(nspmd-1, req, stat, ierr)
81C
82 idmax=idmaxl
83 DO i=1,nspmd-1
84 idmax=max(idmax,idmaxp(i))
85 ENDDO
86 ELSE
87 msgtyp=msgoff
88 CALL mpi_isend(idmaxl, 1, mpi_integer, it_spmd(1),
89 . msgtyp, spmd_comm_world, req, ierr)
90 CALL mpi_wait(req, stat, ierr)
91 ENDIF
92C
93 DO i=1,nfvbag
94 pmain=fvspmd(i)%PMAIN
95 IF (ispmd==0) THEN
96 IF (ispmd==pmain-1) THEN
97 nfvtr=nfvtr+fvdata(i)%NNTR
98 fvoff(1,i)=numnodg+nodcut+nsect+nrwall+nnwl
99 . +nnsrg+nnsmd+nnsphg+2*numels16g+nfvnod
100 fvoff(2,i)=idmax+nfvnod
101 nfvnod=nfvnod+fvdata(i)%NNS_ANIM
102 nfvpart=nfvpart+fvdata(i)%NPOLH_ANIM
103 nfvsubs=nfvsubs+1
104 ELSE
105 msgtyp=msgoff
106 CALL mpi_recv(tab, 3, mpi_integer, it_spmd(pmain),
107 . msgtyp, spmd_comm_world, stat, ierr)
108C
109 nfvtr=nfvtr+tab(1)
110 fvoff(1,i)=numnodg+nodcut+nsect+nrwall+nnwl
111 . +nnsrg+nnsmd+nnsphg+2*numels16g+nfvnod
112 fvoff(2,i)=idmax+nfvnod
113 nfvnod=nfvnod+tab(2)
114 nfvpart=nfvpart+tab(3)
115 nfvsubs=nfvsubs+1
116 ENDIF
117 ELSE
118 IF (ispmd==pmain-1) THEN
119 msgtyp=msgoff
120 tab(1)=fvdata(i)%NNTR
121 tab(2)=fvdata(i)%NNS_ANIM
122 tab(3)=fvdata(i)%NPOLH_ANIM
123 CALL mpi_send(tab, 3, mpi_integer, it_spmd(1),
124 . msgtyp, spmd_comm_world, ierr)
125 ENDIF
126 ENDIF
127 ENDDO
128C
129 IF (ispmd==0) THEN
130 tab(1)=nfvtr
131 tab(2)=nfvnod
132 tab(3)=nfvpart
133 tab(4)=nfvsubs
134 ENDIF
135 CALL mpi_bcast(tab, 4, mpi_integer, it_spmd(1),
136 . spmd_comm_world, ierr)
137 IF (ispmd/=0) THEN
138 nfvtr=tab(1)
139 nfvnod=tab(2)
140 nfvpart=tab(3)
141 nfvsubs=tab(4)
142 ENDIF
143C
144#endif
145 RETURN
146 END
#define max(a, b)
Definition macros.h:21
subroutine mpi_recv(buf, cnt, datatype, source, tag, comm, status, ierr)
Definition mpi.f:461
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_waitall(cnt, array_of_requests, status, ierr)
Definition mpi.f:536
subroutine mpi_send(buf, cnt, datatype, dest, tag, comm, ierr)
Definition mpi.f:480
subroutine mpi_bcast(buffer, cnt, datatype, root, comm, ierr)
Definition mpi.f:205
subroutine mpi_irecv(buf, cnt, datatype, source, tag, comm, ireq, ierr)
Definition mpi.f:372
type(fvbag_spmd), dimension(:), allocatable fvspmd
Definition fvbag_mod.F:129
type(fvbag_data), dimension(:), allocatable fvdata
Definition fvbag_mod.F:128
integer nfvbag
Definition fvbag_mod.F:127
subroutine spmd_fvb_adim(nfvtr, fvoff, nfvnod, nfvpart, nfvsubs, idmax, itab, nodcut, nnwl, nnsrg, nnsmd, nnsphg)