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
69 INTEGER :: P
70 INTEGER :: ISIZ,RSIZ
71 INTEGER :: NSN,NMN,IGAP,INTTH,INTFRIC,ITYP,ITIED
72 INTEGER :: IFQ,INACTI
73 INTEGER :: LOC_PROC
74! --------------------------------------------------------------------
75
76 loc_proc = ispmd + 1
77 sort_comm(nin)%RSIZ = 0
78 sort_comm(nin)%ISIZ = 0
79
80 igap = ipari(21,nin)
81 intth = ipari(47,nin)
82 intfric = ipari(72,nin)
83 ityp = ipari(7,nin)
84 itied = ipari(85,nin)
85 nmn = ipari(6,nin)
86 nsn = ipari(5,nin)
87 inacti = ipari(22,nin)
88 ifq =ipari(31,nin)
89
90 IF(inacti==5.OR.inacti==6.OR.inacti==7.OR.ifq>0.OR.itied/=0) THEN
91 IF(.NOT.ALLOCATED(inter_struct(nin)%NSNFIOLD) ) THEN
92 ALLOCATE(inter_struct(nin)%NSNFIOLD(nspmd))
93 inter_struct(nin)%NSNFIOLD(1:nspmd) = 0
94 ENDIF
95 DO p = 1, nspmd
96 inter_struct(nin)%NSNFIOLD(p) = nsnfi(nin)%P(p)
97 END DO
98 END IF
99 sort_comm(nin)%NBSEND_NB = 0
100 sort_comm(nin)%NBRECV_NB = 0
101
102 IF(ircvfrom(nin,loc_proc)/=0.OR.isendto(nin,loc_proc)/=0) THEN
103
104 IF(.NOT.ALLOCATED(sort_comm(nin)%REQUEST_NB_R)) THEN
105 ALLOCATE(sort_comm(nin)%REQUEST_NB_R(nspmd) )
106 ENDIF
107 IF(.NOT.ALLOCATED(sort_comm(nin)%REQUEST_NB_S)) THEN
108 ALLOCATE(sort_comm(nin)%REQUEST_NB_S(nspmd) )
109 ENDIF
110 IF(.NOT.ALLOCATED(sort_comm(nin)%NB)) THEN
111 ALLOCATE(sort_comm(nin)%NB(nspmd) )
112 sort_comm(nin)%NB(1:nspmd) = 0
113 ENDIF
114 IF(.NOT.ALLOCATED(sort_comm(nin)%INDEX_RCV)) THEN
115 ALLOCATE( sort_comm(nin)%INDEX_RCV(sort_comm(nin)%PROC_NUMBER) )
116 ENDIF
117
118 rsiz = 8
119 isiz = 6
120
121c specific cases
122c IGAP=1 or IGAP=2
123 IF(igap==1 .OR. igap==2)THEN
124 rsiz = rsiz + 1
125c IGAP=3
126 ELSEIF(igap==3)THEN
127 rsiz = rsiz + 2
128 ENDIF
129
130C thermic
131 IF(intth > 0 ) THEN
132 rsiz = rsiz + 2
133 isiz = isiz + 1
134 ENDIF
135C Friction
136 IF(intfric > 0 ) THEN
137 isiz = isiz + 1
138 ENDIF
139
140C -- IDTMINS==2
141 IF(idtmins == 2)THEN
142 isiz = isiz + 2
143C -- IDTMINS_INT /= 0
144 ELSEIF(idtmins_int/=0)THEN
145 isiz = isiz + 1
146 END IF
147
148 sort_comm(nin)%RSIZ = rsiz
149 sort_comm(nin)%ISIZ = isiz
150
151 IF(isendto(nin,loc_proc)>0) THEN
152 IF(.NOT.ALLOCATED(sort_comm(nin)%SEND_NB)) ALLOCATE(sort_comm(nin)%SEND_NB(nspmd))
153 ENDIF
154 IF(ircvfrom(nin,loc_proc)>0) THEN
155 IF(.NOT.ALLOCATED(sort_comm(nin)%RECV_NB)) ALLOCATE(sort_comm(nin)%RECV_NB(nspmd))
156 ENDIF
157 ENDIF
158#endif
159 RETURN
160 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)