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

Go to the source code of this file.

Functions/Subroutines

subroutine spmd_i18kine_macc_com_poff (mtf, a, iad_elem, fr_elem, itab)

Function/Subroutine Documentation

◆ spmd_i18kine_macc_com_poff()

subroutine spmd_i18kine_macc_com_poff ( mtf,
a,
integer, dimension(2,*) iad_elem,
integer, dimension(*) fr_elem,
integer, dimension(*) itab )

Definition at line 33 of file spmd_i18kine_macc_com_poff.F.

35C-----------------------------------------------
36C M o d u l e s
37C-----------------------------------------------
38 USE tri7box
39C-----------------------------------------------
40C I m p l i c i t T y p e s
41C-----------------------------------------------
42 USE spmd_comm_world_mod, ONLY : spmd_comm_world
43#include "implicit_f.inc"
44C-----------------------------------------------
45C M e s s a g e P a s s i n g
46C-----------------------------------------------
47#include "spmd.inc"
48C-----------------------------------------------
49C C o m m o n B l o c k s
50C-----------------------------------------------
51#include "task_c.inc"
52#include "com01_c.inc"
53C-----------------------------------------------
54C D u m m y A r g u m e n t s
55C-----------------------------------------------
56 INTEGER IAD_ELEM(2,*), FR_ELEM(*),ITAB(*)
58 * mtf(14,*),a(3,*)
59C-----------------------------------------------
60C L o c a l V a r i a b l e s
61C-----------------------------------------------
62#ifdef MPI
63 INTEGER STATUS(MPI_STATUS_SIZE),
64 * REQ_SI(NSPMD),REQ_RI(NSPMD),MSGTYP,IERROR,MSGOFF
65 INTEGER L, NNOD, P, J, LOC_PROC, SIZ, NB, NOD
66 INTEGER IADS(NSPMD+1),IADR(NSPMD+1),LENRV
67 my_real ,
68 * DIMENSION(:), ALLOCATABLE :: bbufs,bbufr
69 DATA msgoff/155/
70C--------------------------------------------------------------------
71 lenrv = (iad_elem(1,nspmd+1)-iad_elem(1,1))*4
72 ALLOCATE (bbufs(lenrv),bbufr(lenrv))
73 loc_proc=ispmd+1
74C
75 bbufr=-1.
76C preparation of recv
77 iadr(1) = 1
78 l=1
79 DO p=1,nspmd
80 iadr(p) = l
81 siz = (iad_elem(1,p+1)-iad_elem(1,p))*4
82 IF(siz/=0)THEN
83 msgtyp = msgoff
84 CALL mpi_irecv(
85 s bbufr(l),siz,real,it_spmd(p),msgtyp,
86 g spmd_comm_world,req_ri(p),ierror)
87 l = l + siz
88 ENDIF
89 END DO
90 iadr(nspmd+1) = l
91
92
93 l=1
94 nnod=0
95 DO p=1,nspmd
96 iads(p)=l
97 DO j=iad_elem(1,p),iad_elem(1,p+1)-1
98 nod = fr_elem(j)
99 bbufs(l) = mtf(1,nod)
100 bbufs(l+1) = a(1,nod)
101 bbufs(l+2) = a(2,nod)
102 bbufs(l+3) = a(3,nod)
103 l = l + 4
104 ENDDO
105 ENDDO
106 iads(nspmd+1)=l
107
108 DO p=1,nspmd
109 IF(iad_elem(1,p+1)-iad_elem(1,p)>0)THEN
110 msgtyp = msgoff
111 siz=iads(p+1)-iads(p)
112 l=iads(p)
113 CALL mpi_isend(
114 s bbufs(l),siz,real,it_spmd(p),msgtyp,
115 g spmd_comm_world,req_si(p),ierror)
116 ENDIF
117 ENDDO
118C--------------------------------------------------------------------
119C Recv
120
121 DO p = 1, nspmd
122C test if msg requires to send to complete by test interface
123 nb = iad_elem(1,p+1)-iad_elem(1,p)
124 IF(nb>0)THEN
125 CALL mpi_wait(req_ri(p),status,ierror)
126 l=iadr(p)
127 DO j=iad_elem(1,p),iad_elem(1,p+1)-1
128 nod = fr_elem(j)
129 IF (bbufr(l) > zero)THEN
130 a(1,nod)=bbufr(l+1)
131 a(2,nod)=bbufr(l+2)
132 a(3,nod)=bbufr(l+3)
133 ENDIF
134 l=l+4
135 ENDDO
136 ENDIF
137 ENDDO
138
139C end of send
140 DO p = 1, nspmd
141 siz=iads(p+1)-iads(p)
142 IF(siz>0) THEN
143 CALL mpi_wait(req_si(p),status,ierror)
144 ENDIF
145 ENDDO
146#endif
147 RETURN
#define my_real
Definition cppsort.cpp:32
subroutine mpi_isend(buf, cnt, datatype, dest, tag, comm, ireq, ierr)
Definition mpi.f:382
subroutine mpi_wait(ireq, status, ierr)
Definition mpi.f:525
subroutine mpi_irecv(buf, cnt, datatype, source, tag, comm, ireq, ierr)
Definition mpi.f:372