OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_collectm.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_collectm ../engine/source/mpi/output/spmd_collectm.F
26!||--- called by ------------------------------------------------------
27!|| resol ../engine/source/engine/resol.F
28!||--- calls -----------------------------------------------------
29!|| my_orders ../common_source/tools/sort/my_orders.c
30!||--- uses -----------------------------------------------------
31!|| inoutfile_mod ../common_source/modules/inoutfile_mod.F
32!|| spmd_comm_world_mod ../engine/source/mpi/spmd_comm_world.F90
33!||====================================================================
34 SUBROUTINE spmd_collectm(NODNX_SMS, ITAB, WEIGHT,NODGLOB,SIZP0)
36C-----------------------------------------------
37C I m p l i c i t T y p e s
38C-----------------------------------------------
39 USE spmd_comm_world_mod, ONLY : spmd_comm_world
40#include "implicit_f.inc"
41C-----------------------------------------------------------------
42C M e s s a g e P a s s i n g
43C-----------------------------------------------
44#include "spmd.inc"
45C-----------------------------------------------
46C C o m m o n B l o c k s
47C-----------------------------------------------
48#include "com01_c.inc"
49#include "com04_c.inc"
50#include "task_c.inc"
51#include "spmd_c.inc"
52#include "chara_c.inc"
53#include "units_c.inc"
54C-----------------------------------------------
55C D u m m y A r g u m e n t s
56C-----------------------------------------------
57 INTEGER ITAB(*),WEIGHT(*),NODGLOB(*),SIZP0,NODNX_SMS(*)
58C-----------------------------------------------
59C L o c a l V a r i a b l e s
60C-----------------------------------------------
61#ifdef MPI
62 INTEGER MSGOFF,MSGOFF0,MSGTYP,INFO,I,K,NG,N,M,NK,
63 . EMPL,SDNODG(NUMNODM),FILEN
64 INTEGER STATUS(MPI_STATUS_SIZE),IERROR
65 INTEGER IGLOB(2,NUMNODM),RECGLOB(2,SIZP0),RTRI(2,SIZP0),
66 . ITRI(NUMNODG),INDEX(2*NUMNODG),WORK(70000)
67
68 CHARACTER FILNAM*100,CYCLENUM*7
69
70 INTEGER :: LEN_TMP_NAME
71 CHARACTER(len=2148) :: TMP_NAME
72
73 DATA msgoff0/182/
74 DATA msgoff/183/
75C-----------------------------------------------
76C S o u r c e L i n e s
77C-----------------------------------------------
78 WRITE(cyclenum,'(I7.7)')ncycle
79 filnam=rootnam(1:rootlen)//'_'//chrun//'_'//cyclenum//'.mdb'
80
81 len_tmp_name = outfile_name_len + len_trim(filnam)
82 tmp_name=outfile_name(1:outfile_name_len)//filnam(1:len_trim(filnam))
83
84 OPEN(unit=67,file=tmp_name(1:len_tmp_name),access='SEQUENTIAL',
85 . form='FORMATTED',status='UNKNOWN')
86
87 filen = rootlen+17
88 IF (ispmd/=0) THEN
89 n = 0
90 DO i = 1, numnod
91 IF (weight(i)==1) THEN
92 n = n+1
93 sdnodg(n) = nodglob(i)
94 iglob(1,n) = itab(i)
95 iglob(2,n) = nodnx_sms(i)
96 END IF
97 END DO
98 msgtyp=msgoff0
99 CALL mpi_send(sdnodg,n,mpi_integer,
100 . it_spmd(1),msgtyp,
101 . spmd_comm_world,ierror)
102 msgtyp=msgoff
103 CALL mpi_send(iglob,2*n,mpi_integer,
104 . it_spmd(1),msgtyp,
105 . spmd_comm_world,ierror)
106 ELSE
107 DO i=1,numnod
108 IF (weight(i)==1) THEN
109 empl = nodglob(i)
110 rtri(1,empl) = itab(i)
111 rtri(2,empl) = nodnx_sms(i)
112 ENDIF
113 ENDDO
114
115 DO k=2,nspmd
116 msgtyp=msgoff0
117 CALL mpi_recv(sdnodg,numnodm,mpi_integer,
118 . it_spmd(k),msgtyp,
119 . spmd_comm_world,status,ierror)
120
121 CALL mpi_get_count(status,mpi_integer,n,ierror)
122
123 msgtyp=msgoff
124 CALL mpi_recv(iglob,2*n,mpi_integer,
125 . it_spmd(k),msgtyp,
126 . spmd_comm_world,status,ierror)
127
128 DO i=1,n
129 empl = sdnodg(i)
130 rtri(1,empl) = iglob(1,i)
131 rtri(2,empl) = iglob(2,i)
132 ENDDO
133
134 END DO
135C
136 WRITE(67,'(A)') ' NODE ID',' NO TERMS'
137 DO i = 1, numnodg
138 WRITE(67,'(I10,I10)' )
139 . rtri(1,i),rtri(2,i)
140 END DO
141
142 DO i = 1, numnodg
143 itri(i) =rtri(2,i)
144 index(i)=i
145 END DO
146 CALL my_orders(0,work,itri,index,numnodg,1)
147 DO i = 1, numnodg
148 recglob(1,i) = rtri(1,index(i))
149 recglob(2,i) = rtri(2,index(i))
150 END DO
151
152 WRITE(67,'(A)')'----- RESUME OF MATRIX STRUCTURE -----'
153 i =1
154 nk=1
155 n=recglob(2,i)
156 DO WHILE(i+1 < numnodg)
157 m=recglob(2,i+1)
158 IF(m==n)THEN
159 nk=nk+1
160 ELSE
161 WRITE(67,'(A,I10,A,I10)')
162 . 'NO of NODES WITH ',n,' TERMS =',nk
163 nk=1
164 n =m
165 END IF
166 i=i+1
167 END DO
168 WRITE(67,'(A,I10,A,I10)')
169 . 'NO of NODES WITH ',n,' TERMS =',nk
170
171 WRITE (iout,1300) filnam(1:filen)
172 WRITE (istdo,1300) filnam(1:filen)
173 CLOSE(unit=67)
174
175 END IF
176C
177 1300 FORMAT (4x,' DEBUG ANALYSIS FILE:',1x,a,' WRITTEN')
178#endif
179 RETURN
180 END
subroutine mpi_recv(buf, cnt, datatype, source, tag, comm, status, ierr)
Definition mpi.f:461
subroutine mpi_get_count(status, datatype, cnt, ierr)
Definition mpi.f:296
subroutine mpi_send(buf, cnt, datatype, dest, tag, comm, ierr)
Definition mpi.f:480
void my_orders(int *mode, int *iwork, int *data, int *index, int *n, int *irecl)
Definition my_orders.c:82
character(len=outfile_char_len) outfile_name
integer outfile_name_len
subroutine spmd_collectm(nodnx_sms, itab, weight, nodglob, sizp0)