OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_velvec2.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"

Go to the source code of this file.

Functions/Subroutines

subroutine spmd_velvec2 (v, nodglob, rbuf, numpog)

Function/Subroutine Documentation

◆ spmd_velvec2()

subroutine spmd_velvec2 ( v,
integer, dimension(*) nodglob,
integer rbuf,
integer numpog )

Definition at line 32 of file spmd_velvec2.F.

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
#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
void write_r_c(float *w, int *len)