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

Go to the source code of this file.

Functions/Subroutines

subroutine spmd_exch_idel (itag, iad_elem, fr_elem, size, lenr)

Function/Subroutine Documentation

◆ spmd_exch_idel()

subroutine spmd_exch_idel ( integer, dimension(*) itag,
integer, dimension(2,*) iad_elem,
integer, dimension(*) fr_elem,
integer size,
integer lenr )

Definition at line 32 of file spmd_exch_idel.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"
38C-----------------------------------------------------------------
39C M e s s a g e P a s s i n g
40C-----------------------------------------------
41#include "spmd.inc"
42C-----------------------------------------------
43C C o m m o n B l o c k s
44C-----------------------------------------------
45#include "com01_c.inc"
46#include "com04_c.inc"
47#include "task_c.inc"
48C-----------------------------------------------
49C D u m m y A r g u m e n t s
50C-----------------------------------------------
51 INTEGER ITAG(*), IAD_ELEM(2,*), FR_ELEM(*), SIZE, LENR
52C-----------------------------------------------
53C L o c a l V a r i a b l e s
54C-----------------------------------------------
55#ifdef MPI
56 INTEGER MSGTYP,I,NOD,LOC_PROC,IERROR, MSGOFF,
57 . SIZ,J,L,NB_NOD,
58 . STATUS(MPI_STATUS_SIZE),
59 . IAD_SEND(NSPMD+1),IAD_RECV(NSPMD+1),
60 . REQ_R(NSPMD),REQ_S(NSPMD),
61 . RBUF(SIZE*LENR), SBUF(SIZE*LENR)
62 DATA msgoff/124/
63
64C-----------------------------------------------
65C S o u r c e L i n e s
66C-----------------------------------------------
67 loc_proc = ispmd + 1
68 l = 1
69 iad_recv(1) = 1
70 DO i=1,nspmd
71 siz = size*(iad_elem(1,i+1)-iad_elem(1,i))
72 IF(siz/=0)THEN
73 msgtyp = msgoff
74 CALL mpi_irecv(
75 s rbuf(l),siz,mpi_integer,it_spmd(i),msgtyp,
76 g spmd_comm_world,req_r(i),ierror)
77 l = l + siz
78 ENDIF
79 iad_recv(i+1) = l
80 END DO
81 l = 1
82 iad_send(1) = 1
83 DO i=1,nspmd
84#include "vectorize.inc"
85 DO j=iad_elem(1,i),iad_elem(1,i+1)-1
86 nod = fr_elem(j)
87 sbuf(l ) = itag(nod)
88 sbuf(l+1) = itag(numnod+nod)
89 l = l + SIZE
90 END DO
91 iad_send(i+1) = l
92 ENDDO
93C
94C echange messages
95C
96 DO i=1,nspmd
97C--------------------------------------------------------------------
98 IF(iad_elem(1,i+1)-iad_elem(1,i)>0)THEN
99 msgtyp = msgoff
100 siz = iad_send(i+1)-iad_send(i)
101 l = iad_send(i)
102 CALL mpi_isend(
103 s sbuf(l),siz,mpi_integer,it_spmd(i),msgtyp,
104 g spmd_comm_world,req_s(i),ierror)
105 ENDIF
106C--------------------------------------------------------------------
107 ENDDO
108C
109 DO i = 1, nspmd
110 nb_nod = iad_elem(1,i+1)-iad_elem(1,i)
111 IF(nb_nod>0)THEN
112 CALL mpi_wait(req_r(i),status,ierror)
113 l = iad_recv(i)
114#include "vectorize.inc"
115 DO j=iad_elem(1,i),iad_elem(1,i+1)-1
116 nod = fr_elem(j)
117 itag(nod) = itag(nod)+rbuf(l)
118 itag(numnod+nod) = itag(numnod+nod)+rbuf(l+1)
119 l = l + SIZE
120 END DO
121 ENDIF
122 END DO
123C
124 DO i = 1, nspmd
125 IF(iad_elem(1,i+1)-iad_elem(1,i)>0)THEN
126 CALL mpi_wait(req_s(i),status,ierror)
127 ENDIF
128 ENDDO
129C
130#endif
131 RETURN
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