OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_i18kine_msf_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_msf_com_poff (mtf, iad_elem, fr_elem, itab)

Function/Subroutine Documentation

◆ spmd_i18kine_msf_com_poff()

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

Definition at line 32 of file spmd_i18kine_msf_com_poff.F.

33C-----------------------------------------------
34C M o d u l e s
35C-----------------------------------------------
36 USE tri7box
37C-----------------------------------------------
38C I m p l i c i t T y p e s
39C-----------------------------------------------
40 USE spmd_comm_world_mod, ONLY : spmd_comm_world
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"
51C-----------------------------------------------
52C D u m m y A r g u m e n t s
53C-----------------------------------------------
54 INTEGER IAD_ELEM(2,*),FR_ELEM(*),ITAB(*)
56 * mtf(14,*)
57C-----------------------------------------------
58C L o c a l V a r i a b l e s
59C-----------------------------------------------
60#ifdef MPI
61 INTEGER STATUS(MPI_STATUS_SIZE),
62 * REQ_SI(NSPMD),REQ_RI(NSPMD)
63 INTEGER P, LENRV, IADS(NSPMD+1), IADR(NSPMD+1), IERROR,
64 * SIZ,LOC_PROC,MSGTYP,J,L,NOD,NB,MSGOFF
65 my_real ,
66 * DIMENSION(:), ALLOCATABLE :: bbufs,bbufr
67 DATA msgoff/154/
68C--------------------------------------------------------------------
69 lenrv = (iad_elem(1,nspmd+1)-iad_elem(1,1))*9
70 ALLOCATE (bbufs(lenrv),bbufr(lenrv))
71 loc_proc=ispmd+1
72C Preparation of recv
73 iadr(1) = 1
74 l=1
75 DO p=1,nspmd
76 iadr(p) = l
77 siz = (iad_elem(1,p+1)-iad_elem(1,p))*9
78 IF(siz/=0)THEN
79 msgtyp = msgoff
80 CALL mpi_irecv(
81 s bbufr(l),siz,real,it_spmd(p),msgtyp,
82 g spmd_comm_world,req_ri(p),ierror)
83 l = l + siz
84 ENDIF
85 END DO
86 iadr(nspmd+1) = l
87
88C echange messages
89C
90 l=1
91 DO p=1,nspmd
92 iads(p)=l
93 DO j=iad_elem(1,p),iad_elem(1,p+1)-1
94 nod = fr_elem(j)
95 bbufs(l ) = mtf(1,nod)
96 bbufs(l+1) = mtf(2,nod)
97 bbufs(l+2) = mtf(3,nod)
98 bbufs(l+3) = mtf(4,nod)
99 bbufs(l+4) = mtf(5,nod)
100 bbufs(l+5) = mtf(6,nod)
101 bbufs(l+6) = mtf(7,nod)
102 bbufs(l+7) = mtf(8,nod)
103 bbufs(l+8) = mtf(9,nod)
104 l = l + 9
105 ENDDO
106 ENDDO
107 iads(nspmd+1)=l
108
109 DO p=1,nspmd
110 IF(iad_elem(1,p+1)-iad_elem(1,p)>0)THEN
111 msgtyp = msgoff
112 siz = iads(1+p)-iads(p)
113 l = iads(p)
114 CALL mpi_isend(
115 s bbufs(l),siz,real,it_spmd(p),msgtyp,
116 g spmd_comm_world,req_si(p),ierror)
117 ENDIF
118 ENDDO
119
120C--------------------------------------------------------------------
121C Recv
122
123 DO p = 1, nspmd
124C test if msg requires to send to complete by test interface
125 nb = iad_elem(1,p+1)-iad_elem(1,p)
126 IF(nb>0)THEN
127 CALL mpi_wait(req_ri(p),status,ierror)
128 l=iadr(p)
129 DO j=iad_elem(1,p),iad_elem(1,p+1)-1
130 nod = fr_elem(j)
131 mtf(1,nod)=mtf(1,nod)+bbufr(l)
132 mtf(2,nod)=mtf(2,nod)+bbufr(l+1)
133 mtf(3,nod)=mtf(3,nod)+bbufr(l+2)
134 mtf(4,nod)=mtf(4,nod)+bbufr(l+3)
135 mtf(5,nod)=mtf(5,nod)+bbufr(l+4)
136 mtf(6,nod)=mtf(6,nod)+bbufr(l+5)
137 mtf(7,nod)=mtf(7,nod)+bbufr(l+6)
138 mtf(8,nod)=mtf(8,nod)+bbufr(l+7)
139 mtf(9,nod)=mtf(9,nod)+bbufr(l+8)
140 l=l+9
141 ENDDO
142 ENDIF
143 ENDDO
144C End of send
145 DO p = 1, nspmd
146 siz=iads(p+1)-iads(p)
147 IF(siz>0) THEN
148 CALL mpi_wait(req_si(p),status,ierror)
149 ENDIF
150 ENDDO
151
152#endif
153 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