OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_gatherf.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_gatherf (v, weight, nodglob, num)

Function/Subroutine Documentation

◆ spmd_gatherf()

subroutine spmd_gatherf ( real, dimension(*) v,
integer, dimension(*) weight,
integer, dimension(*) nodglob,
integer num )

Definition at line 32 of file spmd_gatherf.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 real
50 . v(*)
51 INTEGER WEIGHT(*),NODGLOB(*),NUM,SRECBUF
52C-----------------------------------------------
53C L O C A L V A R I A B L E S
54C-----------------------------------------------
55#ifdef MPI
56 INTEGER STATUS(MPI_STATUS_SIZE),IERROR,MSGOFF
57 INTEGER SIZ,MSGTYP,I,K,NG,NREC,MSGOFF2
58
59 DATA msgoff/7014/
60 DATA msgoff2/7015/
61 REAL, DIMENSION(:) , ALLOCATABLE :: BUFSR
62 INTEGER, DIMENSION(:) , ALLOCATABLE :: IBUF
63C Tableau utilise par proc 0
64 REAL, DIMENSION(:) , ALLOCATABLE :: XGLOB
65C=======================================================================
66 ALLOCATE(bufsr(numnodm), ibuf(numnodm))
67 ALLOCATE(xglob(num))
68
69 xglob = 1000000
70 bufsr = 100000
71
72 IF (ispmd/=0) THEN
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(siz) = v(i)
79 END IF
80 END DO
81
82C a cause de la version simple precision, on ne peux pas metre l'entier
83C dans le buffer flottant car on n a que 2puiss 24 bits dispo ~ 16 Million
84C de noeuds au max
85
86 msgtyp = msgoff2
87 CALL mpi_send(ibuf,siz,mpi_integer,it_spmd(1),msgtyp,
88 . spmd_comm_world,ierror)
89
90 msgtyp = msgoff
91 CALL mpi_send(bufsr,siz,mpi_real,it_spmd(1),msgtyp,
92 . spmd_comm_world,ierror)
93
94 ELSE
95 siz = 0
96 DO i=1,numnod
97 IF (weight(i)==1) THEN
98 siz = siz +1
99 ng = nodglob(i)
100 xglob(ng) = v(i)
101 ENDIF
102 ENDDO
103
104 DO i=2,nspmd
105
106C Reception du buffer entier des adresses NODGLOB
107 msgtyp = msgoff2
108
109 CALL mpi_probe(it_spmd(i),msgtyp,
110 . spmd_comm_world,status,ierror)
111 CALL mpi_get_count(status,mpi_integer,siz,ierror)
112
113 CALL mpi_recv(ibuf,siz,mpi_integer,it_spmd(i),msgtyp,
114 . spmd_comm_world,status,ierror)
115
116C Reception du buffer flottant des adresses NODGLOB
117
118 msgtyp = msgoff
119 CALL mpi_recv(bufsr,siz,mpi_real,it_spmd(i),msgtyp,
120 . spmd_comm_world,status,ierror)
121
122 nrec = siz
123
124 DO k = 1, nrec
125 ng = ibuf(k)
126 xglob(ng) = bufsr(k)
127 ENDDO
128 ENDDO
129 CALL write_r_c(xglob,numnodg)
130
131 ENDIF
132 DEALLOCATE(bufsr,ibuf,xglob)
133
134#endif
135 RETURN
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)