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, SIZ, NB, NOD
66 INTEGER IADS(NSPMD+1),IADR(NSPMD+1),LENRV
67 my_real ,
68 * DIMENSION(:), ALLOCATABLE :: bbufs,bbufr
69 DATA msgoff/155/
70C--------------------------------------------------------------------
71 lenrv = (iad_elem(1,nspmd+1)-iad_elem(1,1))*4
72 ALLOCATE (bbufs(lenrv),bbufr(lenrv))
73 loc_proc=ispmd+1
74C
75 bbufr=-1.
76C preparation of recv
77 iadr(1) = 1
78 l=1
79 DO p=1,nspmd
80 iadr(p) = l
81 siz = (iad_elem(1,p+1)-iad_elem(1,p))*4
82 IF(siz/=0)THEN
83 msgtyp = msgoff
84 CALL mpi_irecv(
85 s bbufr(l),siz,real,it_spmd(p),msgtyp,
86 g spmd_comm_world,req_ri(p),ierror)
87 l = l + siz
88 ENDIF
89 END DO
90 iadr(nspmd+1) = l
91
92
93 l=1
94 nnod=0
95 DO p=1,nspmd
96 iads(p)=l
97 DO j=iad_elem(1,p),iad_elem(1,p+1)-1
98 nod = fr_elem(j)
99 bbufs(l) = mtf(1,nod)
100 bbufs(l+1) = a(1,nod)
101 bbufs(l+2) = a(2,nod)
102 bbufs(l+3) = a(3,nod)
103 l = l + 4
104 ENDDO
105 ENDDO
106 iads(nspmd+1)=l
107
108 DO p=1,nspmd
109 IF(iad_elem(1,p+1)-iad_elem(1,p)>0)THEN
110 msgtyp = msgoff
111 siz=iads(p+1)-iads(p)
112 l=iads(p)
113 CALL mpi_isend(
114 s bbufs(l),siz,real,it_spmd(p),msgtyp,
115 g spmd_comm_world,req_si(p),ierror)
116 ENDIF
117 ENDDO
118C--------------------------------------------------------------------
119C Recv
120
121 DO p = 1, nspmd
122C test if msg requires to send to complete by test interface
123 nb = iad_elem(1,p+1)-iad_elem(1,p)
124 IF(nb>0)THEN
125 CALL mpi_wait(req_ri(p),status,ierror)
126 l=iadr(p)
127 DO j=iad_elem(1,p),iad_elem(1,p+1)-1
128 nod = fr_elem(j)
129 IF (bbufr(l) > zero)THEN
130 a(1,nod)=bbufr(l+1)
131 a(2,nod)=bbufr(l+2)
132 a(3,nod)=bbufr(l+3)
133 ENDIF
134 l=l+4
135 ENDDO
136 ENDIF
137 ENDDO
138
139C end of send
140 DO p = 1, nspmd
141 siz=iads(p+1)-iads(p)
142 IF(siz>0) THEN
143 CALL mpi_wait(req_si(p),status,ierror)
144 ENDIF
145 ENDDO
146#endif
147 RETURN
148 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)