OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_i18kine_macc_com_poff.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!||====================================================================
25!|| spmd_i18kine_macc_com_poff ../engine/source/mpi/interfaces/spmd_i18kine_macc_com_poff.F
26!||--- called by ------------------------------------------------------
27!|| i18main_kine_1 ../engine/source/interfaces/int18/i18main_kine.F
28!||--- calls -----------------------------------------------------
29!||--- uses -----------------------------------------------------
30!|| spmd_comm_world_mod ../engine/source/mpi/spmd_comm_world.F90
31!|| tri7box ../engine/share/modules/tri7box.f
32!||====================================================================
34 * IAD_ELEM,FR_ELEM,ITAB)
35C-----------------------------------------------
36C M o d u l e s
37C-----------------------------------------------
38 USE tri7box
39C-----------------------------------------------
40C I m p l i c i t T y p e s
41C-----------------------------------------------
42 USE spmd_comm_world_mod, ONLY : spmd_comm_world
43#include "implicit_f.inc"
44C-----------------------------------------------
45C M e s s a g e P a s s i n g
46C-----------------------------------------------
47#include "spmd.inc"
48C-----------------------------------------------
49C C o m m o n B l o c k s
50C-----------------------------------------------
51#include "task_c.inc"
52#include "com01_c.inc"
53C-----------------------------------------------
54C D u m m y A r g u m e n t s
55C-----------------------------------------------
56 INTEGER IAD_ELEM(2,*), FR_ELEM(*),ITAB(*)
58 * mtf(14,*),a(3,*)
59C-----------------------------------------------
60C L o c a l V a r i a b l e s
61C-----------------------------------------------
62#ifdef MPI
63 INTEGER STATUS(MPI_STATUS_SIZE),
64 * req_si(nspmd),req_ri(nspmd),msgtyp,ierror,msgoff
65 INTEGER L,NNOD,P,J,LOC_PROC,PTR,SIZ,NB,NOD
66 INTEGER IADS(NSPMD+1),IADR(NSPMD+1),LENRV
68 * testval
69 my_real ,
70 * DIMENSION(:), ALLOCATABLE :: bbufs,bbufr
71 DATA msgoff/155/
72C--------------------------------------------------------------------
73 lenrv = (iad_elem(1,nspmd+1)-iad_elem(1,1))*4
74 ALLOCATE (bbufs(lenrv),bbufr(lenrv))
75 loc_proc=ispmd+1
76C
77 bbufr=-1.
78C Preparation du recv
79 iadr(1) = 1
80 l=1
81 DO p=1,nspmd
82 iadr(p) = l
83 siz = (iad_elem(1,p+1)-iad_elem(1,p))*4
84 IF(siz/=0)THEN
85 msgtyp = msgoff
86 CALL mpi_irecv(
87 s bbufr(l),siz,real,it_spmd(p),msgtyp,
88 g spmd_comm_world,req_ri(p),ierror)
89 l = l + siz
90 ENDIF
91 END DO
92 iadr(nspmd+1) = l
93
94
95 l=1
96 nnod=0
97 DO p=1,nspmd
98 iads(p)=l
99 DO j=iad_elem(1,p),iad_elem(1,p+1)-1
100 nod = fr_elem(j)
101 bbufs(l) = mtf(1,nod)
102 bbufs(l+1) = a(1,nod)
103 bbufs(l+2) = a(2,nod)
104 bbufs(l+3) = a(3,nod)
105 l = l + 4
106 ENDDO
107 ENDDO
108 iads(nspmd+1)=l
109
110 DO p=1,nspmd
111 IF(iad_elem(1,p+1)-iad_elem(1,p)>0)THEN
112 msgtyp = msgoff
113 siz=iads(p+1)-iads(p)
114 l=iads(p)
115 CALL mpi_isend(
116 s bbufs(l),siz,real,it_spmd(p),msgtyp,
117 g spmd_comm_world,req_si(p),ierror)
118 ENDIF
119 ENDDO
120C--------------------------------------------------------------------
121C Recv
122
123 DO p = 1, nspmd
124C test si msg necessaire a envoyer a completer par test interface
125 nb = iad_elem(1,p+1)-iad_elem(1,p)
126 IF(nb>0)THEN
127 CALL mpi_wait(req_ri(p),status,ierror)
128 l=iadr(p)
129 DO j=iad_elem(1,p),iad_elem(1,p+1)-1
130 nod = fr_elem(j)
131 IF (bbufr(l) > zero)THEN
132 a(1,nod)=bbufr(l+1)
133 a(2,nod)=bbufr(l+2)
134 a(3,nod)=bbufr(l+3)
135 ENDIF
136 l=l+4
137 ENDDO
138 ENDIF
139 ENDDO
140
141C Fin du send
142 DO p = 1, nspmd
143 siz=iads(p+1)-iads(p)
144 IF(siz>0) THEN
145 CALL mpi_wait(req_si(p),status,ierror)
146 ENDIF
147 ENDDO
148#endif
149 RETURN
150 END
#define my_real
Definition cppsort.cpp:32
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 mpi_irecv(buf, cnt, datatype, source, tag, comm, ireq, ierr)
Definition mpi.f:372
subroutine spmd_i18kine_macc_com_poff(mtf, a, iad_elem, fr_elem, itab)