OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_cell_size_post_rcv.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_post_rcv ../engine/source/mpi/interfaces/spmd_cell_size_post_rcv.F
25!||--- called by ------------------------------------------------------
26!|| spmd_cell_list_exchange ../engine/source/mpi/interfaces/spmd_cell_list_exchange.F
27!||--- calls -----------------------------------------------------
28!||--- uses -----------------------------------------------------
29!|| inter_sorting_mod ../engine/share/modules/inter_sorting_mod.F
30!|| spmd_comm_world_mod ../engine/source/mpi/spmd_comm_world.F90
31!|| tri7box ../engine/share/modules/tri7box.F
32!||====================================================================
33 SUBROUTINE spmd_cell_size_post_rcv(IRCVFROM,ISENDTO,NIN,SORT_COMM,ITIED,component)
34!$COMMENT
35! SPMD_CELL_SIZE_POST_RCV description :
36! prepare the reception of number of remote secondary nodes
37! SPMD_CELL_SIZE_POST_RCV organization :
38! the recv comm is limited to : proc with main nodes + remote proc with secondary nodes
39!$ENDCOMMENT
40C-----------------------------------------------
41C M o d u l e s
42C-----------------------------------------------
44 USE tri7box
45C-----------------------------------------------
46C I m p l i c i t T y p e s
47C-----------------------------------------------
48 USE spmd_comm_world_mod, ONLY : spmd_comm_world
49#include "implicit_f.inc"
50C-----------------------------------------------
51C M e s s a g e P a s s i n g
52C-----------------------------------------------
53#include "spmd.inc"
54C-----------------------------------------------
55C C o m m o n B l o c k s
56C-----------------------------------------------
57#include "com01_c.inc"
58#include "com04_c.inc"
59#include "task_c.inc"
60C-----------------------------------------------
61C D u m m y A r g u m e n t s
62C-----------------------------------------------
63 INTEGER, INTENT(in) :: NIN
64 INTEGER, INTENT(in) :: ITIED
65 INTEGER, DIMENSION(NINTER+1,NSPMD+1), INTENT(in) :: ISENDTO,IRCVFROM
66 TYPE(sorting_comm_type), DIMENSION(NINTER), INTENT(inout) :: SORT_COMM ! structure for interface sorting comm
67 type(component_), dimension(ninter), intent(inout) :: component
68C-----------------------------------------------
69C L o c a l V a r i a b l e s
70C-----------------------------------------------
71#ifdef MPI
72 INTEGER :: I,J,KK,IJK,KJI
73 INTEGER :: P,P_LOC
74 INTEGER IERROR1,STATUS(MPI_STATUS_SIZE),IERROR
75 INTEGER :: LOC_PROC
76 INTEGER :: MSGOFF, MSGOFF2, MSGOFF3, MSGOFF4, MSGOFF5
77 INTEGER :: MSGTYP,INFO
78 LOGICAL :: NEED_TO_RCV
79! --------------------------------------------------------------------
80 DATA msgoff/6021/
81 DATA msgoff2/6022/
82 DATA msgoff3/6023/
83 DATA msgoff4/6024/
84 DATA msgoff5/6025/
85
86 ! --------------------------------
87 loc_proc = ispmd + 1
88 IF(ircvfrom(nin,loc_proc)/=0) THEN ! local nmn>0
89 ! -----------------------
90 ! loop over the proc of the interface
91 DO p_loc = 1,sort_comm(nin)%PROC_NUMBER
92 p = sort_comm(nin)%PROC_LIST(p_loc)
93 nsnfi(nin)%P(p) = 0
94 ! -----------------------
95 ! prepare the reception : only for proc with main node & remote proc with secondary nodes
96 IF(isendto(nin,p)/=0) THEN ! remote nsn>0
97 IF(loc_proc/=p) THEN
98 need_to_rcv = .true.
99 if(.not.component(nin)%proc_comp(p)%need_comm_s) need_to_rcv = .false.
100 IF(itied/=0) need_to_rcv = .true. ! itied option : force the exchange
101 IF(need_to_rcv) THEN
102 msgtyp = msgoff3
103 sort_comm(nin)%NBRECV_NB=sort_comm(nin)%NBRECV_NB+1
104 sort_comm(nin)%RECV_NB(sort_comm(nin)%NBRECV_NB)=p ! proc with nmn>0
105 CALL mpi_irecv(nsnfi(nin)%P(p),1,mpi_integer,it_spmd(p),
106 . msgtyp,spmd_comm_world,sort_comm(nin)%REQUEST_NB_R(sort_comm(nin)%NBRECV_NB),ierror)
107 ENDIF
108 ENDIF
109 ENDIF
110 ! -----------------------
111 ENDDO
112 ! -----------------------
113 ENDIF
114 ! --------------------------------
115
116#endif
117 RETURN
118 END SUBROUTINE spmd_cell_size_post_rcv
subroutine mpi_irecv(buf, cnt, datatype, source, tag, comm, ireq, ierr)
Definition mpi.f:372
type(int_pointer), dimension(:), allocatable nsnfi
Definition tri7box.F:440
subroutine spmd_cell_size_post_rcv(ircvfrom, isendto, nin, sort_comm, itied, component)