OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_exch_i24_gap.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_i24_gap ../engine/source/mpi/interfaces/spmd_exch_i24_gap.F
26!||--- called by ------------------------------------------------------
27!|| i24pxfem ../engine/source/interfaces/int24/i24pxfem.F
28!||--- calls -----------------------------------------------------
29!||--- uses -----------------------------------------------------
30!|| spmd_comm_world_mod ../engine/source/mpi/spmd_comm_world.F90
31!||====================================================================
33 1 WA,IAD_ELEM ,FR_ELEM,SIZE ,LENR )
34C-----------------------------------------------
35C I m p l i c i t T y p e s
36C-----------------------------------------------
37 USE spmd_comm_world_mod, ONLY : spmd_comm_world
38#include "implicit_f.inc"
39C-----------------------------------------------------------------
40C M e s s a g e P a s s i n g
41C-----------------------------------------------
42#include "spmd.inc"
43C-----------------------------------------------
44C C o m m o n B l o c k s
45C-----------------------------------------------
46#include "com01_c.inc"
47#include "task_c.inc"
48C-----------------------------------------------
49C D u m m y A r g u m e n t s
50C-----------------------------------------------
51 INTEGER IAD_ELEM(2,*),FR_ELEM(*), SIZE, LENR
53 . wa(2,*)
54C-----------------------------------------------
55C L o c a l V a r i a b l e s
56C-----------------------------------------------
57#ifdef MPI
58 INTEGER MSGTYP,I,NOD,LOC_PROC,IERROR, MSGOFF,
59 . siz,j,k,l,nb_nod,
60 . status(mpi_status_size),
61 . iad_send(nspmd+1),iad_recv(nspmd+1),
62 . req_r(nspmd),req_s(nspmd)
63 DATA msgoff/232/
64
66 . rbuf(size*lenr ),
67 . sbuf(size*lenr )
68C-----------------------------------------------
69C S o u r c e L i n e s
70C-----------------------------------------------
71 loc_proc = ispmd + 1
72 l = 1
73 iad_recv(1) = 1
74 DO i=1,nspmd
75 siz = size*(iad_elem(1,i+1)-iad_elem(1,i))
76 IF(siz/=0)THEN
77 msgtyp = msgoff
78 CALL mpi_irecv(
79 s rbuf(l),siz,real,it_spmd(i),msgtyp,
80 g spmd_comm_world,req_r(i),ierror)
81 l = l + siz
82 ENDIF
83 iad_recv(i+1) = l
84 END DO
85 l = 1
86 iad_send(1) = 1
87C
88 DO i=1,nspmd
89C preparation envoi partie fixe (elem) a proc I
90#include "vectorize.inc"
91 DO j=iad_elem(1,i),iad_elem(1,i+1)-1
92 nod = fr_elem(j)
93 sbuf(l ) = wa(1,nod)
94 sbuf(l + 1 ) = wa(2,nod)
95 l = l + SIZE
96 END DO
97C
98 iad_send(i+1) = l
99 ENDDO
100C
101C echange messages
102C
103 DO i=1,nspmd
104C--------------------------------------------------------------------
105C envoi a N+I mod P
106C test si msg necessaire a envoyer a completer par test interface
107 IF(iad_elem(1,i+1)-iad_elem(1,i)>0)THEN
108 msgtyp = msgoff
109 siz = iad_send(i+1)-iad_send(i)
110 l = iad_send(i)
111 CALL mpi_isend(
112 . sbuf(l),siz,real,it_spmd(i),msgtyp,
113 . spmd_comm_world,req_s(i),ierror)
114 ENDIF
115C--------------------------------------------------------------------
116 ENDDO
117C
118C decompactage
119C
120 DO i = 1, nspmd
121C test si msg necessaire a envoyer a completer par test interface
122 nb_nod = iad_elem(1,i+1)-iad_elem(1,i)
123 IF(nb_nod>0)THEN
124 CALL mpi_wait(req_r(i),status,ierror)
125 l = iad_recv(i)
126C
127#include "vectorize.inc"
128 DO j=iad_elem(1,i),iad_elem(1,i+1)-1
129 nod = fr_elem(j)
130 wa(1,nod) = max(wa(1,nod),rbuf(l))
131 wa(2,nod) = max(wa(2,nod),rbuf(l+1))
132 l = l + SIZE
133 END DO
134C ---
135 ENDIF
136 ENDDO
137C
138C wait terminaison isend
139C
140 DO i = 1, nspmd
141 IF(iad_elem(1,i+1)-iad_elem(1,i)>0)THEN
142 CALL mpi_wait(req_s(i),status,ierror)
143 ENDIF
144 ENDDO
145C
146#endif
147 RETURN
148 END
#define my_real
Definition cppsort.cpp:32
#define max(a, b)
Definition macros.h:21
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_exch_i24_gap(wa, iad_elem, fr_elem, size, lenr)