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