OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_exch_idel_seglo.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/.
23C
24!||====================================================================
25!|| spmd_exch_idel_seglo ../engine/source/mpi/interfaces/spmd_exch_idel_seglo.F
26!||--- calls -----------------------------------------------------
27!|| i24_remove_global_segment ../engine/source/interfaces/interf/chkstfn3.F
28!|| i25_remove_global_segment ../engine/source/interfaces/interf/chkstfn3.F
29!||--- uses -----------------------------------------------------
30!|| intbufdef_mod ../common_source/modules/interfaces/intbufdef_mod.F90
31!|| spmd_comm_world_mod ../engine/source/mpi/spmd_comm_world.F90
32!||====================================================================
33 SUBROUTINE spmd_exch_idel_seglo(IPARI,INTBUF_TAB,INDSEGLO,IBUFSEGLO)
34C-----------------------------------------------
35C M o d u l e s
36C-----------------------------------------------
37 USE intbufdef_mod
38C-----------------------------------------------
39C I m p l i c i t T y p e s
40C-----------------------------------------------
41 USE spmd_comm_world_mod, ONLY : spmd_comm_world
42#include "implicit_f.inc"
43C-----------------------------------------------------------------
44C M e s s a g e P a s s i n g
45C-----------------------------------------------
46#include "spmd.inc"
47C-----------------------------------------------
48C C o m m o n B l o c k s
49C-----------------------------------------------
50#include "task_c.inc"
51#include "com01_c.inc"
52#include "com04_c.inc"
53#include "param_c.inc"
54C-----------------------------------------------
55C D u m m y A r g u m e n t s
56C-----------------------------------------------
57 INTEGER IPARI(NPARI,*),INDSEGLO(*),IBUFSEGLO(*)
58
59 TYPE(intbuf_struct_) INTBUF_TAB(*)
60C-----------------------------------------------
61C L o c a l V a r i a b l e s
62C-----------------------------------------------
63#ifdef MPI
64 INTEGER MSGOFF1 ,MSGOFF2, MSGTYP, LOC_PROC,IERROR,REQ_S1(NSPMD),REQ_S2(NSPMD),
65 . STATUS(MPI_STATUS_SIZE)
66 INTEGER RSEGLO(NINTER+1)
67C
68 INTEGER NRTM,NG,IND_SEG
69 INTEGER I,SIZ,IAD
70 INTEGER, DIMENSION(:), ALLOCATABLE :: RBUF
71C-----------------------------------------------
72 DATA msgoff1/125/
73 DATA msgoff2/126/
74
75
76 loc_proc = ispmd+1
77 DO i = 1, nspmd
78 IF(i/=loc_proc) THEN
79 msgtyp = msgoff1
80 CALL mpi_isend(
81 c indseglo,ninter+1,mpi_integer,it_spmd(i),msgtyp,
82 g spmd_comm_world,req_s1(i),ierror)
83
84 siz = indseglo(ninter+1)-indseglo(1)
85 IF(siz>0)THEN
86 msgtyp = msgoff2
87 CALL mpi_isend(
88 c ibufseglo,siz,mpi_integer,it_spmd(i),msgtyp,
89 g spmd_comm_world,req_s2(i),ierror)
90 ENDIF
91 ENDIF
92 ENDDO
93
94 DO i = 1, nspmd
95 IF(i/=loc_proc) THEN
96 msgtyp = msgoff1
97 CALL mpi_recv(
98 . rseglo,ninter+1,mpi_integer,it_spmd(i),msgtyp,
99 . spmd_comm_world,status,ierror)
100
101 siz = rseglo(ninter+1)-rseglo(1)
102 IF(siz>0)THEN
103 ALLOCATE(rbuf(siz))
104 msgtyp = msgoff2
105 CALL mpi_recv(
106 . rbuf,siz,mpi_integer,it_spmd(i),msgtyp,
107 . spmd_comm_world,status,ierror)
108
109 DO ng=1,ninter
110 ind_seg=rseglo(ng+1)-rseglo(ng)
111 iad=rseglo(ng)
112 IF(ind_seg >0)THEN
113 IF(ipari(7,ng)==24)THEN
114 nrtm=ipari(4,ng)
115 CALL i24_remove_global_segment(rbuf(iad),ind_seg,ng,nrtm,
116 . intbuf_tab(ng)%MSEGLO,intbuf_tab(ng)%MVOISIN,2)
117 ELSEIF(ipari(7,ng)==25)THEN
118 nrtm=ipari(4,ng)
119 CALL i25_remove_global_segment(rbuf(iad),ind_seg,ng,nrtm,
120 . intbuf_tab(ng)%MSEGLO,intbuf_tab(ng)%MVOISIN,2)
121 END IF
122 ENDIF ! IF(IND_SEG >0)
123 ENDDO ! DO NG=1,NINTER
124 DEALLOCATE(rbuf)
125 ENDIF ! IF(SIZ>0)THEN
126 ENDIF ! IF(I/=LOC_PROC) THEN
127 ENDDO
128C
129C Test reception envoi BUFR
130C
131 DO i = 1, nspmd
132 IF(i/=loc_proc) THEN
133 CALL mpi_wait(req_s1(i),status,ierror)
134 siz = indseglo(ninter+1)-indseglo(1)
135 IF(siz>0)THEN
136 CALL mpi_wait(req_s2(i),status,ierror)
137 ENDIF
138 ENDIF
139 ENDDO
140C
141 RETURN
142#endif
143 END
subroutine i24_remove_global_segment(ind_seglo, nind_seglo, nin, nrtm, mseglo, mvoisin, flag)
Definition chkstfn3.F:3965
subroutine i25_remove_global_segment(ind_seglo, nind_seglo, nin, nrtm, mseglo, mvoisin, flag)
Definition chkstfn3.F:4006
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 spmd_exch_idel_seglo(ipari, intbuf_tab, indseglo, ibufseglo)