OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_split_comm_inter.F File Reference
#include "implicit_f.inc"
#include "spmd.inc"
#include "com01_c.inc"
#include "com04_c.inc"
#include "task_c.inc"
#include "param_c.inc"
#include "impl1_c.inc"

Go to the source code of this file.

Functions/Subroutines

subroutine spmd_split_comm_inter (intbuf_tab, nbintc, intlist, ipari, isendto, ircvfrom, sort_comm, need_comm_int25_solid_erosion, comm_int25_solid_erosion)

Function/Subroutine Documentation

◆ spmd_split_comm_inter()

subroutine spmd_split_comm_inter ( type(intbuf_struct_), dimension(ninter) intbuf_tab,
integer, intent(in) nbintc,
integer, dimension(ninter), intent(in) intlist,
integer, dimension(npari,ninter), intent(in) ipari,
integer, dimension(ninter+1,nspmd+1), intent(in) isendto,
integer, dimension(ninter+1,nspmd+1), intent(in) ircvfrom,
type(sorting_comm_type), dimension(ninter), intent(inout) sort_comm,
logical, dimension(nspmd), intent(inout) need_comm_int25_solid_erosion,
integer, intent(inout) comm_int25_solid_erosion )
Parameters
[in,out]need_comm_int25_solid_erosionboolean, true if the proc needs to comm some values related to interface type 25 with solid erosion
[in,out]comm_int25_solid_erosioninteger, sub-communicator related to interface type 25 with solid erosion

Definition at line 35 of file spmd_split_comm_inter.F.

37!$COMMENT
38! SPMD_SPLIT_COMM_INTER :
39! SPMD_SPLIT_COMM_INTER creates new communicators
40! for interface TYPE07
41! spmd_split_comm_inter organization :
42! - loop over the interfaces in order to
43! tag all the processors of a interface
44! - then create a communicator for a given
45! interface
46!$ENDCOMMENT
47C-----------------------------------------------
48C M o d u l e s
49C-----------------------------------------------
51 USE intbufdef_mod
54C-----------------------------------------------
55C I m p l i c i t T y p e s
56C-----------------------------------------------
57 USE spmd_comm_world_mod, ONLY : spmd_comm_world
58#include "implicit_f.inc"
59C-----------------------------------------------
60C M e s s a g e P a s s i n g
61C-----------------------------------------------
62#include "spmd.inc"
63C-----------------------------------------------
64C C o m m o n B l o c k s
65C-----------------------------------------------
66#include "com01_c.inc"
67#include "com04_c.inc"
68#include "task_c.inc"
69#include "param_c.inc"
70#include "impl1_c.inc"
71C-----------------------------------------------
72C D u m m y A r g u m e n t s
73C-----------------------------------------------
74 TYPE(INTBUF_STRUCT_) INTBUF_TAB(NINTER)
75 integer, intent(in) :: NBINTC
76 integer, dimension(NINTER), intent(in) :: INTLIST
77 integer, dimension(NPARI,NINTER), intent(in) :: IPARI
78 integer,dimension(NINTER+1,NSPMD+1), intent(in) :: ISENDTO,IRCVFROM
79 TYPE(sorting_comm_type), DIMENSION(NINTER), INTENT(inout) :: SORT_COMM ! structure for interface sorting comm
80
81 LOGICAL, DIMENSION(NSPMD), INTENT(inout) :: NEED_COMM_INT25_SOLID_EROSION !< boolean, true if the proc needs to comm some values related to interface type 25 with solid erosion
82 INTEGER, INTENT(inout) :: COMM_INT25_SOLID_EROSION !< integer, sub-communicator related to interface type 25 with solid erosion
83
84C-----------------------------------------------
85C L o c a l V a r i a b l e s
86C-----------------------------------------------
87#ifdef MPI
88
89 INTEGER :: KEY,CODE,I,P
90 INTEGER :: NIN,KK,NTY
91 INTEGER :: COLOR_INACTI,COLOR_INT25_SOLID_EROSION
92 INTEGER :: INACTI,IFQ,ITIED
93 INTEGER :: IDEL,IDELKEEP,SOLID_EROSION
94 INTEGER :: COLOR_CRIT
95C-----------------------------------------------
96C S o u r c e L i n e s
97C-----------------------------------------------
98 ALLOCATE( comm_tri7vox(ninter) )
99 comm_tri7vox(1:ninter)%INIT=.true.
100
101 need_comm_inacti = .false.
103 ALLOCATE( list_inter_7_inacti(ninter) )
104 list_inter_7_inacti(1:ninter) = 0
105 need_comm_int25_solid_erosion(1:nspmd) = .false.
106 ! -----------------------------
107! loop over the interface
108 DO kk=1,nbintc
109 nin = intlist(kk)
110 nty =ipari(7,nin)
111 IF(ircvfrom(nin,ispmd+1)==0.or.isendto(nin,ispmd+1)==0) THEN
112 color_crit = mpi_undefined
113 intbuf_tab(nin)%belongs_to_comm_crit = .false.
114 key = 0
115 ELSE
116 color_crit = 1
117 intbuf_tab(nin)%belongs_to_comm_crit = .true.
118 key = ispmd
119 ENDIF
120 CALL mpi_comm_split(spmd_comm_world,color_crit,key,intbuf_tab(nin)%MPI_COMM_CRIT,code)
121! -----------------------------
122! only tag the TYPE07 interface
123 IF(nty==7) THEN
124 IF(comm_tri7vox(nin)%INIT) THEN
125 i=0
126 ALLOCATE(comm_tri7vox(nin)%PROC_LIST(nspmd))
127 ALLOCATE(sort_comm(nin)%PROC_LIST(nspmd))
128 comm_tri7vox(nin)%PROC_LIST(1:nspmd) = 0
129 comm_tri7vox(nin)%RANK = -1
130 ! list of processor for a given interface
131 DO p=1,nspmd
132 IF(ircvfrom(nin,p)/=0.or.isendto(nin,p)/=0) THEN
133 i=i+1
134 comm_tri7vox(nin)%PROC_LIST(i) = p
135 ENDIF
136 ENDDO
137 sort_comm(nin)%PROC_LIST(1:nspmd) = comm_tri7vox(nin)%PROC_LIST(1:nspmd)
138 comm_tri7vox(nin)%PROC_NUMBER = i
139 sort_comm(nin)%PROC_NUMBER = i
140 comm_tri7vox(nin)%PROC_MIN = -1
141 comm_tri7vox(nin)%RANK=-1
142 comm_tri7vox(nin)%COMM=-1
143 ! compute the main proc for a given interface
144 DO i = 1,comm_tri7vox(nin)%PROC_NUMBER
145 comm_tri7vox(nin)%PROC_MIN = min(comm_tri7vox(nin)%PROC_MIN,comm_tri7vox(nin)%PROC_LIST(i))
146 ENDDO
147 ! color the processor
148 IF(ircvfrom(nin,ispmd+1)==0.and.isendto(nin,ispmd+1)==0) THEN
149 comm_tri7vox(nin)%COLOR=0
150 key = 0
151 ELSE
152 comm_tri7vox(nin)%COLOR=1
153 key = 1
154 ENDIF
155 ! create the communicator
156 CALL mpi_comm_split(spmd_comm_world,comm_tri7vox(nin)%COLOR,key,comm_tri7vox(nin)%COMM,code)
157 CALL mpi_comm_split(spmd_comm_world,comm_tri7vox(nin)%COLOR,key,sort_comm(nin)%COMM,code)
158 IF(comm_tri7vox(nin)%COLOR==1) THEN
159 CALL mpi_comm_rank(comm_tri7vox(nin)%comm,comm_tri7vox(nin)%RANK,code)
160 ENDIF
161 comm_tri7vox(nin)%INIT = .false.
162 ENDIF
163 ! ------------------------------
164 inacti = ipari(22,nin)
165 ifq = ipari(31,nin)
166 itied = ipari(85,nin)
167 IF(impl_s==0.OR.neig==0) THEN
168 IF( inacti==5.OR.inacti==6.OR.ifq>0.OR.itied/=0)THEN
169 need_comm_inacti = .true.
172 ENDIF
173 ENDIF
174 ! ------------------------------
175 ENDIF
176
177 ! ------------------------------
178 ! communicator for interface type 25 with solid erosion
179 solid_erosion = ipari(100,nin)
180 idel = ipari(17,nin)! idel option
181 idelkeep = ipari(61,nin)
182 IF(nty==25.AND.ipari(100,nin)>0.AND.idelkeep/=1) THEN
183 ! ---------------
184 ! check if the proc has S or M node
185 DO p=1,nspmd
186 IF(isendto(nin,p)>0.OR.ircvfrom(nin,p)>0) THEN
187 need_comm_int25_solid_erosion(p) = .true.
188 ENDIF
189 ENDDO
190 ! ---------------
191 ENDIF
192 ENDDO
193 ! -----------------------------
194
195 ! -----------------------------
196 ! color the processor for inacti option
197 IF(.NOT.need_comm_inacti) THEN
198 color_inacti = 0
199 key = 0
200 ELSE
201 color_inacti = 1
202 key = 1
203 ENDIF
204 ! create the communicator for the spmd_get_inacti communication
205 CALL mpi_comm_split(spmd_comm_world,color_inacti,key,comm_inacti,code)
206 ! -----------------------------
207
208 ! -----------------------------
209 ! color the processor for interface type 25 + solid erosion option
210 IF(.NOT.need_comm_int25_solid_erosion(ispmd+1)) THEN
211 color_int25_solid_erosion = 0
212 key = 0
213 ELSE
214 color_int25_solid_erosion = 1
215 key = 1
216 ENDIF
217 ! create the communicator for the type25+solid erosion communication
218 CALL mpi_comm_split(spmd_comm_world,color_int25_solid_erosion,key,comm_int25_solid_erosion,code)
219 ! -----------------------------
220#endif
221 RETURN
end diagonal values have been computed in the(sparse) matrix id.SOL
#define min(a, b)
Definition macros.h:20
subroutine mpi_comm_split(comm, color, key, comm2, ierr)
Definition mpi.f:272
subroutine mpi_comm_rank(comm, rank, ierr)
Definition mpi.f:254
type(comm_tri7vox_type), dimension(:), allocatable comm_tri7vox
integer, dimension(:), allocatable list_inter_7_inacti
subroutine spmd_split_comm_inter(intbuf_tab, nbintc, intlist, ipari, isendto, ircvfrom, sort_comm, need_comm_int25_solid_erosion, comm_int25_solid_erosion)