OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_i20curvsz.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_i20curvsz ../engine/source/mpi/interfaces/spmd_i20curvsz.F
26!||--- called by ------------------------------------------------------
27!|| i20mainf ../engine/source/interfaces/int20/i20mainf.F
28!||--- calls -----------------------------------------------------
29!||--- uses -----------------------------------------------------
30!|| spmd_comm_world_mod ../engine/source/mpi/spmd_comm_world.F90
31!||====================================================================
32 SUBROUTINE spmd_i20curvsz(NRTM ,IRECT ,NUMNOD,IAD_ELEM,FR_ELEM,
33 2 ISDSIZ,IRCSIZ,ITAG ,LENR ,LENT ,
34 3 MAXCC ,NLN ,NLG )
35C-----------------------------------------------
36C I m p l i c i t T y p e s
37C-----------------------------------------------
38 USE spmd_comm_world_mod, ONLY : spmd_comm_world
39#include "implicit_f.inc"
40C-----------------------------------------------
41C M e s s a g e P a s s i n g
42C-----------------------------------------------
43#include "spmd.inc"
44C-----------------------------------------------
45C C o m m o n B l o c k s
46C-----------------------------------------------
47#include "com01_c.inc"
48#include "task_c.inc"
49C-----------------------------------------------
50C D u m m y A r g u m e n t s
51C-----------------------------------------------
52 INTEGER NRTM,NUMNOD,LENR,LENT,MAXCC,NLN,NLG(NLN),
53 . IRECT(4,NRTM),ITAG(*),
54 . iad_elem(2,*), fr_elem(*), isdsiz(*), ircsiz(*)
55C-----------------------------------------------
56C L o c a l V a r i a b l e s
57C-----------------------------------------------
58#ifdef MPI
59 INTEGER I ,J ,N1, N2, N3, N4, IERROR, IAD, SIZ, NB,
60 . MSGTYP, LOC_PROC, MSGOFF,
61 . ibufs(lenr), ibufr(lenr),
62 . status(mpi_status_size),req_r(nspmd)
63 DATA msgoff/194/
64
65C-----------------------------------------------
66C
67 loc_proc = ispmd+1
68C
69 iad = 1
70 DO i=1,nspmd
71 ircsiz(i) = 0
72 siz = iad_elem(1,i+1)-iad_elem(1,i)
73 IF(siz>0)THEN
74 msgtyp = msgoff
75 CALL mpi_irecv(
76 s ibufr(iad),siz,mpi_integer,it_spmd(i),msgtyp,
77 g spmd_comm_world,req_r(i),ierror)
78 iad = iad + siz
79 ENDIF
80 END DO
81 DO n1=1,numnod
82 itag(n1) = 0
83 END DO
84
85 DO i=1,nrtm
86 n1 = irect(1,i)
87 n2 = irect(2,i)
88 n3 = irect(3,i)
89 n4 = irect(4,i)
90 n1 = nlg(n1)
91 n2 = nlg(n2)
92 n3 = nlg(n3)
93 n4 = nlg(n4)
94 itag(n1) = itag(n1) + 1
95 itag(n2) = itag(n2) + 1
96 itag(n3) = itag(n3) + 1
97 itag(n4) = itag(n4) + 1
98 END DO
99 DO i=1,nspmd
100 isdsiz(i) = 0
101 siz = iad_elem(1,i+1)-iad_elem(1,i)
102 IF(siz>0)THEN
103 iad = 1
104#include "vectorize.inc"
105 DO j=iad_elem(1,i),iad_elem(1,i+1)-1
106 n1 = fr_elem(j)
107 isdsiz(i) = isdsiz(i) + itag(n1)
108 ibufs(iad) = itag(n1)
109 iad = iad + 1
110 END DO
111 msgtyp = msgoff
112 CALL mpi_send(
113 s ibufs,siz,mpi_integer,it_spmd(i),msgtyp,
114 g spmd_comm_world,ierror)
115 END IF
116 END DO
117C
118 isdsiz(nspmd+1) = 0
119 ircsiz(nspmd+1) = 0
120 iad = 0
121 DO i = 1, nspmd
122 siz = iad_elem(1,i+1)-iad_elem(1,i)
123 IF(siz>0)THEN
124 CALL mpi_wait(req_r(i),status,ierror)
125 DO j=iad_elem(1,i),iad_elem(1,i+1)-1
126 n1 = fr_elem(j)
127 iad = iad + 1
128 nb = ibufr(iad)
129 ircsiz(i) = ircsiz(i) + nb
130 itag(n1) = itag(n1) + nb
131 END DO
132 isdsiz(nspmd+1) = isdsiz(nspmd+1) + isdsiz(i)
133 ircsiz(nspmd+1) = ircsiz(nspmd+1) + ircsiz(i)
134 END IF
135 END DO
136C
137 lent = 0
138 maxcc = 0
139 DO n1=1,numnod
140 lent = lent + itag(n1)
141 maxcc = max(maxcc,itag(n1))
142 END DO
143C
144#endif
145 RETURN
146 END
#define max(a, b)
Definition macros.h:21
subroutine mpi_wait(ireq, status, ierr)
Definition mpi.f:525
subroutine mpi_send(buf, cnt, datatype, dest, tag, comm, ierr)
Definition mpi.f:480
subroutine mpi_irecv(buf, cnt, datatype, source, tag, comm, ireq, ierr)
Definition mpi.f:372
subroutine spmd_i20curvsz(nrtm, irect, numnod, iad_elem, fr_elem, isdsiz, ircsiz, itag, lenr, lent, maxcc, nln, nlg)