OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_exch_thknod.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_thknod (thknod, iad_elem, fr_elem, size, lenr)

Function/Subroutine Documentation

◆ spmd_exch_thknod()

subroutine spmd_exch_thknod ( thknod,
integer, dimension(2,*) iad_elem,
integer, dimension(*) fr_elem,
integer size,
integer lenr )

Definition at line 32 of file spmd_exch_thknod.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 "task_c.inc"
47C-----------------------------------------------
48C D u m m y A r g u m e n t s
49C-----------------------------------------------
50 INTEGER IAD_ELEM(2,*), FR_ELEM(*), SIZE, LENR
52 . thknod(*)
53C-----------------------------------------------
54C L o c a l V a r i a b l e s
55C-----------------------------------------------
56#ifdef MPI
57 INTEGER MSGTYP,I,NOD,LOC_PROC,IERROR, MSGOFF,
58 . SIZ,J,L,NB_NOD,
59 . STATUS(MPI_STATUS_SIZE),
60 . IAD_SEND(NSPMD+1),IAD_RECV(NSPMD+1),
61 . REQ_R(NSPMD),REQ_S(NSPMD)
63 . rbuf(size*lenr), sbuf(size*lenr)
64 DATA msgoff/206/
65C-----------------------------------------------
66C S o u r c e L i n e s
67C-----------------------------------------------
68 loc_proc = ispmd + 1
69 l = 1
70 iad_recv(1) = 1
71 DO i=1,nspmd
72 siz = size*(iad_elem(1,i+1)-iad_elem(1,i))
73 IF(siz/=0)THEN
74 msgtyp = msgoff
75 CALL mpi_irecv(
76 s rbuf(l),siz,real,it_spmd(i),msgtyp,
77 g spmd_comm_world,req_r(i),ierror)
78 l = l + siz
79 ENDIF
80 iad_recv(i+1) = l
81 END DO
82 l = 1
83 iad_send(1) = 1
84 DO i=1,nspmd
85#include "vectorize.inc"
86 DO j=iad_elem(1,i),iad_elem(1,i+1)-1
87 nod = fr_elem(j)
88 sbuf(l ) = thknod(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,real,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 thknod(nod) = max(thknod(nod),rbuf(l))
118 l = l + SIZE
119 END DO
120 ENDIF
121 END DO
122C
123 DO i = 1, nspmd
124 IF(iad_elem(1,i+1)-iad_elem(1,i)>0)THEN
125 CALL mpi_wait(req_s(i),status,ierror)
126 ENDIF
127 ENDDO
128C
129#endif
130 RETURN
#define my_real
Definition cppsort.cpp:32
#define max(a, b)
Definition macros.h:21
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