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

Function/Subroutine Documentation

◆ spmd_gatheritab()

subroutine spmd_gatheritab ( integer, dimension(*) v,
integer, dimension(*) weight,
integer, dimension(*) nodglob,
integer num )

Definition at line 32 of file spmd_gatheritab.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
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 INTEGER, DIMENSION(:,:) , ALLOCATABLE :: BUFSR
60 INTEGER, DIMENSION(:) , ALLOCATABLE :: XGLOB
61C-----------------------------------------------
62 DATA msgoff/7018/
63 DATA msgoff2/7019/
64
65
66C-----------------------------------------------
67 ALLOCATE(bufsr(2,numnodm))
68 ALLOCATE(xglob(num))
69C-----------------------------------------------
70 IF (ispmd/=0) THEN
71
72 siz = 0
73 DO i=1,numnod
74 IF (weight(i)==1) THEN
75 siz = siz + 1
76 bufsr(1,siz) = nodglob(i)
77 bufsr(2,siz) = v(i)
78 END IF
79 END DO
80
81
82 msgtyp = msgoff
83 CALL mpi_send(bufsr,2*siz,mpi_integer,it_spmd(1),msgtyp,
84 . spmd_comm_world,ierror)
85
86 ELSE
87 DO i=1,numnod
88 IF (weight(i)==1) THEN
89 ng = nodglob(i)
90 xglob(ng) = v(i)
91 ENDIF
92 ENDDO
93
94 DO i=2,nspmd
95
96C Reception du buffer entier des adresses NODGLOB
97 msgtyp = msgoff
98
99 CALL mpi_probe(it_spmd(i),msgtyp,
100 . spmd_comm_world,status,ierror)
101 CALL mpi_get_count(status,mpi_integer,siz,ierror)
102
103 CALL mpi_recv(bufsr,siz,mpi_integer,it_spmd(i),msgtyp,
104 . spmd_comm_world,status,ierror)
105
106 nrec = siz/2
107
108 DO k = 1, nrec
109 ng = bufsr(1,k)
110 xglob(ng) = bufsr(2,k)
111 ENDDO
112 ENDDO
113 CALL write_i_c(xglob,numnodg)
114
115 ENDIF
116 DEALLOCATE(bufsr)
117 DEALLOCATE(xglob)
118
119#endif
120 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_i_c(int *w, int *len)