OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_exch_thknod.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_thknod ../engine/source/mpi/nodes/spmd_exch_thknod.F
26!||--- called by ------------------------------------------------------
27!|| resol ../engine/source/engine/resol.F
28!||--- calls -----------------------------------------------------
29!||--- uses -----------------------------------------------------
30!|| spmd_comm_world_mod ../engine/source/mpi/spmd_comm_world.F90
31!||====================================================================
32 SUBROUTINE spmd_exch_thknod(THKNOD,IAD_ELEM,FR_ELEM,SIZE,LENR)
33C-----------------------------------------------
34C I m p l i c i t T y p e s
35C-----------------------------------------------
36 USE spmd_comm_world_mod, ONLY : spmd_comm_world
37#include "implicit_f.inc"
38C-----------------------------------------------------------------
39C M e s s a g e P a s s i n g
40C-----------------------------------------------
41#include "spmd.inc"
42C-----------------------------------------------
43C C o m m o n B l o c k s
44C-----------------------------------------------
45#include "com01_c.inc"
46#include "task_c.inc"
47C-----------------------------------------------
48C D u m m y A r g u m e n t s
49C-----------------------------------------------
50 INTEGER IAD_ELEM(2,*), FR_ELEM(*), SIZE, LENR
52 . thknod(*)
53C-----------------------------------------------
54C L o c a l V a r i a b l e s
55C-----------------------------------------------
56#ifdef MPI
57 INTEGER MSGTYP,I,NOD,LOC_PROC,IERROR, MSGOFF,
58 . SIZ,J,L,NB_NOD,
59 . STATUS(MPI_STATUS_SIZE),
60 . IAD_SEND(NSPMD+1),IAD_RECV(NSPMD+1),
61 . REQ_R(NSPMD),REQ_S(NSPMD)
63 . rbuf(size*lenr), sbuf(size*lenr)
64 DATA msgoff/206/
65C-----------------------------------------------
66C S o u r c e L i n e s
67C-----------------------------------------------
68 loc_proc = ispmd + 1
69 l = 1
70 iad_recv(1) = 1
71 DO i=1,nspmd
72 siz = size*(iad_elem(1,i+1)-iad_elem(1,i))
73 IF(siz/=0)THEN
74 msgtyp = msgoff
75 CALL mpi_irecv(
76 s rbuf(l),siz,real,it_spmd(i),msgtyp,
77 g spmd_comm_world,req_r(i),ierror)
78 l = l + siz
79 ENDIF
80 iad_recv(i+1) = l
81 END DO
82 l = 1
83 iad_send(1) = 1
84 DO i=1,nspmd
85#include "vectorize.inc"
86 DO j=iad_elem(1,i),iad_elem(1,i+1)-1
87 nod = fr_elem(j)
88 sbuf(l ) = thknod(nod)
89 l = l + SIZE
90 END DO
91 iad_send(i+1) = l
92 ENDDO
93C
94C echange messages
95C
96 DO i=1,nspmd
97C--------------------------------------------------------------------
98 IF(iad_elem(1,i+1)-iad_elem(1,i)>0)THEN
99 msgtyp = msgoff
100 siz = iad_send(i+1)-iad_send(i)
101 l = iad_send(i)
102 CALL mpi_isend(
103 s sbuf(l),siz,real,it_spmd(i),msgtyp,
104 g spmd_comm_world,req_s(i),ierror)
105 ENDIF
106C--------------------------------------------------------------------
107 ENDDO
108C
109 DO i = 1, nspmd
110 nb_nod = iad_elem(1,i+1)-iad_elem(1,i)
111 IF(nb_nod>0)THEN
112 CALL mpi_wait(req_r(i),status,ierror)
113 l = iad_recv(i)
114#include "vectorize.inc"
115 DO j=iad_elem(1,i),iad_elem(1,i+1)-1
116 nod = fr_elem(j)
117 thknod(nod) = max(thknod(nod),rbuf(l))
118 l = l + SIZE
119 END DO
120 ENDIF
121 END DO
122C
123 DO i = 1, nspmd
124 IF(iad_elem(1,i+1)-iad_elem(1,i)>0)THEN
125 CALL mpi_wait(req_s(i),status,ierror)
126 ENDIF
127 ENDDO
128C
129#endif
130 RETURN
131 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_thknod(thknod, iad_elem, fr_elem, size, lenr)