OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_i7curvsz.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_i7curvsz ../engine/source/mpi/interfaces/spmd_i7curvsz.F
25!||--- called by ------------------------------------------------------
26!|| i7mainf ../engine/source/interfaces/int07/i7mainf.F
27!||--- calls -----------------------------------------------------
28!||--- uses -----------------------------------------------------
29!|| spmd_comm_world_mod ../engine/source/mpi/spmd_comm_world.F90
30!||====================================================================
31 SUBROUTINE spmd_i7curvsz(NRTM ,IRECT ,NUMNOD,IAD_ELEM,FR_ELEM,
32 2 ISDSIZ,IRCSIZ,ITAG ,LENR ,LENT ,
33 3 MAXCC )
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 NRTM,NUMNOD,LENR,LENT,MAXCC,
52 . IRECT(4,NRTM),ITAG(*),
53 . iad_elem(2,*), fr_elem(*), isdsiz(*), ircsiz(*)
54C REAL
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/193/
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 itag(n1) = itag(n1) + 1
91 itag(n2) = itag(n2) + 1
92 itag(n3) = itag(n3) + 1
93 itag(n4) = itag(n4) + 1
94 END DO
95 DO i=1,nspmd
96 isdsiz(i) = 0
97 siz = iad_elem(1,i+1)-iad_elem(1,i)
98 IF(siz>0)THEN
99 iad = 1
100#include "vectorize.inc"
101 DO j=iad_elem(1,i),iad_elem(1,i+1)-1
102 n1 = fr_elem(j)
103 isdsiz(i) = isdsiz(i) + itag(n1)
104 ibufs(iad) = itag(n1)
105 iad = iad + 1
106 END DO
107 msgtyp = msgoff
108 CALL mpi_send(
109 s ibufs,siz,mpi_integer,it_spmd(i),msgtyp,
110 g spmd_comm_world,ierror)
111 END IF
112 END DO
113C
114 isdsiz(nspmd+1) = 0
115 ircsiz(nspmd+1) = 0
116 iad = 0
117 DO i = 1, nspmd
118 siz = iad_elem(1,i+1)-iad_elem(1,i)
119 IF(siz>0)THEN
120 CALL mpi_wait(req_r(i),status,ierror)
121 DO j=iad_elem(1,i),iad_elem(1,i+1)-1
122 n1 = fr_elem(j)
123 iad = iad + 1
124 nb = ibufr(iad)
125 ircsiz(i) = ircsiz(i) + nb
126 itag(n1) = itag(n1) + nb
127 END DO
128 isdsiz(nspmd+1) = isdsiz(nspmd+1) + isdsiz(i)
129 ircsiz(nspmd+1) = ircsiz(nspmd+1) + ircsiz(i)
130 END IF
131 END DO
132C
133 lent = 0
134 maxcc = 0
135 DO n1=1,numnod
136 lent = lent + itag(n1)
137 maxcc = max(maxcc,itag(n1))
138 END DO
139C
140#endif
141 RETURN
142 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_i7curvsz(nrtm, irect, numnod, iad_elem, fr_elem, isdsiz, ircsiz, itag, lenr, lent, maxcc)