OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_exch_fvstats.F File Reference
#include "implicit_f.inc"
#include "spmd.inc"
#include "task_c.inc"
#include "com01_c.inc"
#include "com04_c.inc"
#include "param_c.inc"

Go to the source code of this file.

Functions/Subroutines

subroutine spmd_exch_fvstats (monvol)

Function/Subroutine Documentation

◆ spmd_exch_fvstats()

subroutine spmd_exch_fvstats ( integer, dimension(*) monvol)

Definition at line 32 of file spmd_exch_fvstats.F.

33C-----------------------------------------------
34C M o d u l e s
35C-----------------------------------------------
36 USE fvbag_mod
37 USE spmd_mod
38C-----------------------------------------------
39C I m p l i c i t T y p e s
40C-----------------------------------------------
41#include "implicit_f.inc"
42C-----------------------------------------------
43C M e s s a g e P a s s i n g
44C-----------------------------------------------
45#include "spmd.inc"
46C-----------------------------------------------
47C C o m m o n B l o c k s
48C-----------------------------------------------
49#include "task_c.inc"
50#include "com01_c.inc"
51#include "com04_c.inc"
52#include "param_c.inc"
53C-----------------------------------------------
54C D u m m y A r g u m e n t s
55C-----------------------------------------------
56 INTEGER MONVOL(*)
57#ifdef MPI
58C-----------------------------------------------
59C L o c a l V a r i a b l e s
60C-----------------------------------------------
61 INTEGER K1, N, ITYP, ID, IFV, LEN
62 INTEGER BUFS(6,NVOLU), BUFR(6,NVOLU)
63 INTEGER IERROR
64
65C
66 k1 = 1
67 ifv = 0
68 DO n=1,nvolu
69 ityp=monvol(k1-1+2)
70 IF (ityp==6 .OR. ityp==8) THEN
71 ifv = ifv + 1
72 id=monvol(k1-1+1)
73 IF((fvspmd(ifv)%PMAIN-1 == ispmd) .OR. (nspmd == 1)) THEN
74 bufs(1,ifv)=id
75 bufs(2,ifv)=monvol(k1-1+49)
76 bufs(3,ifv)=monvol(k1-1+70)
77 bufs(4,ifv)=monvol(k1-1+71)
78 bufs(5,ifv)=monvol(k1-1+72)
79 bufs(6,ifv)=monvol(k1-1+73)
80 ELSE
81 !Each processor fills the buffer with 0 if not PMAIN of the
82 !FVMBAG
83 bufs(1,ifv) = 0
84 bufs(2,ifv) = 0
85 bufs(3,ifv) = 0
86 bufs(4,ifv) = 0
87 bufs(5,ifv) = 0
88 bufs(6,ifv) = 0
89 ENDIF
90 ENDIF
91 k1=k1+nimv
92 ENDDO
93
94
95 !Exchange
96 ! ALLREDUCE is OK there (soon after another global
97 ! synchronization)
98 IF(ifv > 0 ) THEN
99 len = ifv*6
100 CALL mpi_allreduce(bufs,bufr,len,
101 . mpi_integer,mpi_sum,
102 . spmd_comm_world,ierror)
103 ENDIF
104
105
106
107
108 ! Proc 0 updates its monvol
109 IF ( ispmd == 0 ) THEN
110 k1 = 1
111 ifv = 0
112 DO n=1,nvolu
113 ityp=monvol(k1-1+2)
114 IF (ityp==6 .OR. ityp==8) THEN
115 ifv = ifv + 1
116 monvol(k1-1+1) = bufr(1,ifv)
117 monvol(k1-1+49) = bufr(2,ifv)
118 monvol(k1-1+70) = bufr(3,ifv)
119 monvol(k1-1+71) = bufr(4,ifv)
120 monvol(k1-1+72) = bufr(5,ifv)
121 monvol(k1-1+73) = bufr(6,ifv)
122 ENDIF
123 k1=k1+nimv
124 ENDDO
125 ENDIF
126
127
128
129#endif
130 RETURN
subroutine mpi_allreduce(sendbuf, recvbuf, cnt, datatype, operation, comm, ierr)
Definition mpi.f:103
initmumps id
type(fvbag_spmd), dimension(:), allocatable fvspmd
Definition fvbag_mod.F:129