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

Go to the source code of this file.

Functions/Subroutines

subroutine spmd_exch_nodarea2 (nodarea, iad_elem, fr_elem, lenr, weight, jj)

Function/Subroutine Documentation

◆ spmd_exch_nodarea2()

subroutine spmd_exch_nodarea2 ( nodarea,
integer, dimension(2,*) iad_elem,
integer, dimension(*) fr_elem,
integer lenr,
integer, dimension(*) weight,
integer jj )

Definition at line 37 of file spmd_exch_nodarea2.F.

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 "com01_c.inc"
52#include "task_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(*), SIZE, LENR,WEIGHT(*),JJ
57 my_real
58 . nodarea(3,*)
59C-----------------------------------------------
60C L o c a l V a r i a b l e s
61C-----------------------------------------------
62#ifdef MPI
63 INTEGER MSGTYP,I,NOD,LOC_PROC,IERROR,
64 . SIZ,J,K,L,NB_NOD,
65 . STATUS(MPI_STATUS_SIZE),
66 . IAD_SEND(NSPMD+1),IAD_RECV(NSPMD+1),
67 . REQ_R(NSPMD),REQ_S(NSPMD),MSGOFF
68
69 my_real,
70 . DIMENSION(:),ALLOCATABLE :: sbuf,rbuf
71 DATA msgoff/7035/
72C-----------------------------------------------
73C S o u r c e L i n e s
74C-----------------------------------------------
75 ALLOCATE(sbuf(lenr))
76 ALLOCATE(rbuf(lenr))
77C-----------------------------------------------
78 loc_proc = ispmd+1
79 l = 1
80 iad_recv(1)=1
81
82C Mise en place des buffers de reception
83 DO i=1,nspmd
84 siz = iad_elem(1,i+1)-iad_elem(1,i)
85 IF(siz/=0) THEN
86 msgtyp = msgoff
87 CALL mpi_irecv(
88 s rbuf(l),siz,real,it_spmd(i),msgtyp,
89 g spmd_comm_world,req_r(i),ierror)
90 l = l+siz
91 END IF
92 iad_recv(i+1) = l
93 END DO
94
95! Remplissage des buffers d'envoi et envoi des donnees
96C
97 l=1
98 iad_send(1)=1
99 DO i=1,nspmd
100 DO j=iad_elem(1,i),iad_elem(1,i+1)-1
101 nod = fr_elem(j)
102 sbuf(l) = nodarea(jj,nod)
103 l = l+1
104 END DO
105 iad_send(i+1) = l
106 END DO
107
108 DO i=1,nspmd
109
110 IF(iad_elem(1,i+1)-iad_elem(1,i)>0)THEN
111
112
113 msgtyp = msgoff
114 siz = iad_send(i+1)-iad_send(i)
115 l = iad_send(i)
116
117 CALL mpi_isend(
118 s sbuf(l),siz,real,it_spmd(i),msgtyp,
119 g spmd_comm_world,req_s(i),ierror)
120 ENDIF
121 END DO
122! Reception et traitement
123 DO i = 1, nspmd
124C
125 nb_nod = iad_elem(1,i+1)-iad_elem(1,i)
126 IF(nb_nod>0)THEN
127 CALL mpi_wait(req_r(i),status,ierror)
128 l = iad_recv(i)
129
130 DO j=iad_elem(1,i),iad_elem(1,i+1)-1
131
132 nod = fr_elem(j)
133 nodarea(jj,nod) = nodarea(jj,nod) + rbuf(l)
134 l = l+1
135 ENDDO
136 ENDIF
137 ENDDO
138
139 DO i = 1, nspmd
140 IF(iad_elem(1,i+1)-iad_elem(1,i)>0)THEN
141 CALL mpi_wait(req_s(i),status,ierror)
142 ENDIF
143 ENDDO
144C-----------------------------------------------
145 DEALLOCATE(sbuf)
146 DEALLOCATE(rbuf)
147C-----------------------------------------------
148#endif
149 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