OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_wrt_xyznod.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!||====================================================================
25!|| spmd_wrt_xyznod ../engine/source/mpi/anim/spmd_wrt_xyznod.F
26!||--- called by ------------------------------------------------------
27!|| xyznod ../engine/source/output/anim/generate/xyznod.F
28!||--- calls -----------------------------------------------------
29!|| write_r_c ../common_source/tools/input_output/write_routtines.c
30!||--- uses -----------------------------------------------------
31!|| spmd_comm_world_mod ../engine/source/mpi/spmd_comm_world.F90
32!||====================================================================
33 SUBROUTINE spmd_wrt_xyznod(X,WEIGHT,NODGLOB,NUM)
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"
39#include "spmd.inc"
40C-----------------------------------------------
41C C o m m o n B l o c k s
42C-----------------------------------------------
43#include "com01_c.inc"
44#include "com04_c.inc"
45#include "task_c.inc"
46#include "spmd_c.inc"
47C-----------------------------------------------
48C D u m m y A r g u m e n t s
49C-----------------------------------------------
51 . x(3,*)
52 INTEGER WEIGHT(*),NODGLOB(*),NUM,SRECBUF
53C-----------------------------------------------
54C L O C A L V A R I A B L E S
55C-----------------------------------------------
56#ifdef MPI
57 INTEGER STATUS(MPI_STATUS_SIZE),IERROR,MSGOFF
58 INTEGER SIZ,MSGTYP,I,K,NG,NREC,MSGOFF2,SI,MSGTYP2
59
60 REAL, DIMENSION(:,:), ALLOCATABLE :: BUFSR,XGLOB
61 INTEGER, DIMENSION(:), ALLOCATABLE :: IBUF
62
63 DATA msgoff/7026/
64 DATA msgoff2/7027/
65
66C-----------------------------------------------
67
68 ALLOCATE(bufsr(3,numnodm))
69 ALLOCATE(xglob(3,num))
70 ALLOCATE(ibuf(numnodm))
71
72 IF (ispmd/=0) THEN
73
74 siz = 0
75 DO i=1,numnod
76 IF (weight(i)==1) THEN
77 siz = siz + 1
78 ibuf(siz) = nodglob(i)
79 bufsr(1,siz) = x(1,i)
80 bufsr(2,siz) = x(2,i)
81 bufsr(3,siz) = x(3,i)
82 END IF
83 END DO
84
85C a cause de la version simple precision, on ne peux pas metre l'entier
86C dans le buffer flottant car on n a que 2puiss 24 bits dispo ~ 16 Million
87C de noeuds au max
88
89 msgtyp = msgoff2
90 CALL mpi_send(ibuf,siz,mpi_integer,it_spmd(1),msgtyp,
91 . spmd_comm_world,ierror)
92
93C
94 msgtyp = msgoff
95 CALL mpi_send(bufsr,3*siz,mpi_real4,it_spmd(1),msgtyp,
96 . spmd_comm_world,ierror)
97
98
99 ELSE
100
101 DO i=1,numnod
102 IF (weight(i)==1) THEN
103 ng = nodglob(i)
104 xglob(1,ng) = x(1,i)
105 xglob(2,ng) = x(2,i)
106 xglob(3,ng) = x(3,i)
107 ENDIF
108 ENDDO
109
110
111 DO i=2,nspmd
112
113C Reception du buffer entier des adresses NODGLOB
114 msgtyp = msgoff2
115
116 CALL mpi_probe(it_spmd(i),msgtyp,
117 . spmd_comm_world,status,ierror)
118 CALL mpi_get_count(status,mpi_integer,siz,ierror)
119
120 CALL mpi_recv(ibuf,siz,mpi_integer,it_spmd(i),msgtyp,
121 . spmd_comm_world,status,ierror)
122
123C Reception du buffer flottant des adresses NODGLOB
124
125 msgtyp2 = msgoff
126
127 CALL mpi_recv(bufsr,siz*3,mpi_real4,it_spmd(i),msgtyp2,
128 . spmd_comm_world,status,ierror)
129
130 nrec = siz
131
132
133 DO k = 1, nrec
134 ng = ibuf(k)
135 xglob(1,ng) = bufsr(1,k)
136 xglob(2,ng) = bufsr(2,k)
137 xglob(3,ng) = bufsr(3,k)
138 ENDDO
139 ENDDO
140C
141C
142 DO i=1,numnodg
143 CALL write_r_c(xglob(1,i),1)
144 CALL write_r_c(xglob(2,i),1)
145 CALL write_r_c(xglob(3,i),1)
146 END DO
147 END IF
148
149
150 DEALLOCATE(bufsr)
151 DEALLOCATE(xglob)
152 DEALLOCATE(ibuf)
153
154#endif
155 RETURN
156 END
#define my_real
Definition cppsort.cpp:32
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
subroutine mpi_probe(source, tag, comm, status, ierr)
Definition mpi.f:449
subroutine spmd_wrt_xyznod(x, weight, nodglob, num)
void write_r_c(float *w, int *len)