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