OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_collectm.F File Reference
#include "implicit_f.inc"
#include "spmd.inc"
#include "com01_c.inc"
#include "com04_c.inc"
#include "task_c.inc"
#include "spmd_c.inc"
#include "chara_c.inc"
#include "units_c.inc"

Go to the source code of this file.

Functions/Subroutines

subroutine spmd_collectm (nodnx_sms, itab, weight, nodglob, sizp0)

Function/Subroutine Documentation

◆ spmd_collectm()

subroutine spmd_collectm ( integer, dimension(*) nodnx_sms,
integer, dimension(*) itab,
integer, dimension(*) weight,
integer, dimension(*) nodglob,
integer sizp0 )

Definition at line 34 of file spmd_collectm.F.

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
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