OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_vgath.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_vgath (x, nodglob, weight, num)

Function/Subroutine Documentation

◆ spmd_vgath()

subroutine spmd_vgath ( x,
integer, dimension(*) nodglob,
integer, dimension(*) weight,
integer num )

Definition at line 34 of file spmd_vgath.F.

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