OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_cell_size_exchange_init.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!|| spmd_cell_size_exchange_init ../engine/source/mpi/interfaces/spmd_cell_size_exchange_init.F
25!||--- called by ------------------------------------------------------
26!|| spmd_cell_list_exchange ../engine/source/mpi/interfaces/spmd_cell_list_exchange.F
27!||--- uses -----------------------------------------------------
28!|| inter_sorting_mod ../engine/share/modules/inter_sorting_mod.F
29!|| inter_struct_mod ../engine/share/modules/inter_struct_mod.F
30!|| tri7box ../engine/share/modules/tri7box.F
31!||====================================================================
32 SUBROUTINE spmd_cell_size_exchange_init(IRCVFROM,ISENDTO,IPARI,NIN,INTER_STRUCT,SORT_COMM)
33!$COMMENT
34! SPMD_CELL_SIZE_EXCHANGE_INIT description :
35! initialization of buffer size + allocation
36! SPMD_CELL_SIZE_EXCHANGE_INIT organization :
37!$ENDCOMMENT
38C-----------------------------------------------
39C M o d u l e s
40C-----------------------------------------------
43 USE tri7box
44C-----------------------------------------------
45C I m p l i c i t T y p e s
46C-----------------------------------------------
47#include "implicit_f.inc"
48C-----------------------------------------------
49C C o m m o n B l o c k s
50C-----------------------------------------------
51#include "com01_c.inc"
52#include "com04_c.inc"
53#include "task_c.inc"
54#include "sms_c.inc"
55#include "param_c.inc"
56C-----------------------------------------------
57C D u m m y A r g u m e n t s
58C-----------------------------------------------
59 INTEGER, INTENT(in) :: NIN
60 INTEGER, DIMENSION(NPARI,NINTER), INTENT(in) :: IPARI
61 INTEGER, DIMENSION(NINTER+1,NSPMD+1), INTENT(in) :: ISENDTO,IRCVFROM
62 TYPE(inter_struct_type), DIMENSION(NINTER), INTENT(inout) :: INTER_STRUCT ! structure for interface
63 TYPE(sorting_comm_type), DIMENSION(NINTER), INTENT(inout) :: SORT_COMM ! structure for interface sorting comm
64C-----------------------------------------------
65C L o c a l V a r i a b l e s
66C-----------------------------------------------
67#ifdef MPI
68 INTEGER :: I,J,NOD,L,L2,KK,IJK,KJI
69 INTEGER :: P,P_LOC
70 INTEGER :: ADRESS,SHIFT_
71 INTEGER :: ISIZ,RSIZ,IDEB,JDEB
72 INTEGER :: NSN,NMN,IGAP,INTTH,INTFRIC,ITYP,ITIED
73 INTEGER :: IFQ,INACTI
74 INTEGER :: LOC_PROC
75! --------------------------------------------------------------------
76
77 loc_proc = ispmd + 1
78 sort_comm(nin)%RSIZ = 0
79 sort_comm(nin)%ISIZ = 0
80
81 igap = ipari(21,nin)
82 intth = ipari(47,nin)
83 intfric = ipari(72,nin)
84 ityp = ipari(7,nin)
85 itied = ipari(85,nin)
86 nmn = ipari(6,nin)
87 nsn = ipari(5,nin)
88 inacti = ipari(22,nin)
89 ifq =ipari(31,nin)
90
91 IF(inacti==5.OR.inacti==6.OR.inacti==7.OR.ifq>0.OR.itied/=0) THEN
92 IF(.NOT.ALLOCATED(inter_struct(nin)%NSNFIOLD) ) THEN
93 ALLOCATE(inter_struct(nin)%NSNFIOLD(nspmd))
94 inter_struct(nin)%NSNFIOLD(1:nspmd) = 0
95 ENDIF
96 DO p = 1, nspmd
97 inter_struct(nin)%NSNFIOLD(p) = nsnfi(nin)%P(p)
98 END DO
99 END IF
100 sort_comm(nin)%NBSEND_NB = 0
101 sort_comm(nin)%NBRECV_NB = 0
102
103 IF(ircvfrom(nin,loc_proc)/=0.OR.isendto(nin,loc_proc)/=0) THEN
104
105 IF(.NOT.ALLOCATED(sort_comm(nin)%REQUEST_NB_R)) THEN
106 ALLOCATE(sort_comm(nin)%REQUEST_NB_R(nspmd) )
107 ENDIF
108 IF(.NOT.ALLOCATED(sort_comm(nin)%REQUEST_NB_S)) THEN
109 ALLOCATE(sort_comm(nin)%REQUEST_NB_S(nspmd) )
110 ENDIF
111 IF(.NOT.ALLOCATED(sort_comm(nin)%NB)) THEN
112 ALLOCATE(sort_comm(nin)%NB(nspmd) )
113 sort_comm(nin)%NB(1:nspmd) = 0
114 ENDIF
115 IF(.NOT.ALLOCATED(sort_comm(nin)%INDEX_RCV)) THEN
116 ALLOCATE( sort_comm(nin)%INDEX_RCV(sort_comm(nin)%PROC_NUMBER) )
117 ENDIF
118
119 rsiz = 8
120 isiz = 6
121
122c specific cases
123c IGAP=1 or IGAP=2
124 IF(igap==1 .OR. igap==2)THEN
125 rsiz = rsiz + 1
126c IGAP=3
127 ELSEIF(igap==3)THEN
128 rsiz = rsiz + 2
129 ENDIF
130
131C thermic
132 IF(intth > 0 ) THEN
133 rsiz = rsiz + 2
134 isiz = isiz + 1
135 ENDIF
136C Friction
137 IF(intfric > 0 ) THEN
138 isiz = isiz + 1
139 ENDIF
140
141C -- IDTMINS==2
142 IF(idtmins == 2)THEN
143 isiz = isiz + 2
144C -- IDTMINS_INT /= 0
145 ELSEIF(idtmins_int/=0)THEN
146 isiz = isiz + 1
147 END IF
148
149 sort_comm(nin)%RSIZ = rsiz
150 sort_comm(nin)%ISIZ = isiz
151
152 IF(isendto(nin,loc_proc)>0) THEN
153 IF(.NOT.ALLOCATED(sort_comm(nin)%SEND_NB)) ALLOCATE(sort_comm(nin)%SEND_NB(nspmd))
154 ENDIF
155 IF(ircvfrom(nin,loc_proc)>0) THEN
156 IF(.NOT.ALLOCATED(sort_comm(nin)%RECV_NB)) ALLOCATE(sort_comm(nin)%RECV_NB(nspmd))
157 ENDIF
158 ENDIF
159#endif
160 RETURN
161 END SUBROUTINE spmd_cell_size_exchange_init
type(int_pointer), dimension(:), allocatable nsnfi
Definition tri7box.F:440
subroutine spmd_cell_size_exchange_init(ircvfrom, isendto, ipari, nin, inter_struct, sort_comm)