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

Function/Subroutine Documentation

◆ spmd_wrt_xyznod()

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

Definition at line 33 of file spmd_wrt_xyznod.F.

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