OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_velvec2.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_velvec2 ../engine/source/mpi/anim/spmd_velvec2.F
25!||--- called by ------------------------------------------------------
26!|| velvec2 ../engine/source/output/anim/generate/velvec.F
27!||--- calls -----------------------------------------------------
28!|| write_r_c ../common_source/tools/input_output/write_routtines.c
29!||--- uses -----------------------------------------------------
30!|| spmd_comm_world_mod ../engine/source/mpi/spmd_comm_world.F90
31!||====================================================================
32 SUBROUTINE spmd_velvec2(V,NODGLOB,RBUF,NUMPOG)
33C-----------------------------------------------
34C I m p l i c i t T y p e s
35C-----------------------------------------------
36 USE spmd_comm_world_mod, ONLY : spmd_comm_world
37#include "implicit_f.inc"
38#include "spmd.inc"
39C-----------------------------------------------
40C C o m m o n B l o c k s
41C-----------------------------------------------
42#include "com01_c.inc"
43#include "com04_c.inc"
44#include "task_c.inc"
45#include "spmd_c.inc"
46C-----------------------------------------------
47C D u m m y A r g u m e n t s
48C-----------------------------------------------
49 INTEGER NODGLOB(*),RBUF,NUMPOG
50
51 my_real
52 . v(3,*)
53
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,J,K,NG,NREC,MSGOFF2
61 . r1,r2,r3
62
63 INTEGER, DIMENSION(:), ALLOCATABLE :: NGLOBI
64 my_real,
65 * DIMENSION(:,:),ALLOCATABLE :: vrecv
66 REAL, DIMENSION(:,:),ALLOCATABLE :: VTOTAL
67
68
69 DATA msgoff/7024/
70 DATA msgoff2/7025/
71C-----------------------------------------------
72 ALLOCATE(nglobi(rbuf))
73 ALLOCATE(vrecv(3,rbuf))
74 ALLOCATE(vtotal(3,numpog))
75
76 IF (ispmd/=0) THEN
77C on envoie le nodglob
78 msgtyp = msgoff
79
80 CALL mpi_send(nodglob,numnod,mpi_integer,it_spmd(1),msgtyp,
81 . spmd_comm_world,ierror)
82
83 msgtyp = msgoff2
84 CALL mpi_send(v,3*numnod,real,it_spmd(1),msgtyp,
85 . spmd_comm_world,ierror)
86
87 ELSE
88 DO i=1,numnodg
89 vtotal(1,i) = zero
90 vtotal(2,i) = zero
91 vtotal(3,i) = zero
92 ENDDO
93
94 DO i=1,numnod
95 k = nodglob(i)
96 vtotal(1,k)= vtotal(1,k) + v(1,i)
97 vtotal(2,k)= vtotal(2,k) + v(2,i)
98 vtotal(3,k)= vtotal(3,k) + v(3,i)
99 ENDDO
100 DO i=2,nspmd
101
102C Reception du buffer entier des adresses NODGLOB
103 msgtyp = msgoff
104
105 CALL mpi_probe(it_spmd(i),msgtyp,
106 . spmd_comm_world,status,ierror)
107 CALL mpi_get_count(status,mpi_integer,siz,ierror)
108
109 CALL mpi_recv(nglobi,siz,mpi_integer,it_spmd(i),msgtyp,
110 . spmd_comm_world,status,ierror)
111
112 msgtyp = msgoff2
113 CALL mpi_recv(vrecv,3*siz,real,it_spmd(i),msgtyp,
114 . spmd_comm_world,status,ierror)
115
116 DO j = 1, siz
117 k = nglobi(j)
118 vtotal(1,k)= vtotal(1,k) + vrecv(1,j)
119 vtotal(2,k)= vtotal(2,k) + vrecv(2,j)
120 vtotal(3,k)= vtotal(3,k) + vrecv(3,j)
121 ENDDO
122 ENDDO
123 CALL write_r_c(vtotal,3*numnodg)
124
125 ENDIF
126
127 DEALLOCATE(nglobi)
128 DEALLOCATE(vrecv)
129
130#endif
131 RETURN
132 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_velvec2(v, nodglob, rbuf, numpog)
void write_r_c(float *w, int *len)