OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_exch_tag_scnd.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_tag_scnd (itagnd, fr_cnds, iad_cnds, lcomm)

Function/Subroutine Documentation

◆ spmd_exch_tag_scnd()

subroutine spmd_exch_tag_scnd ( integer, dimension(*) itagnd,
integer, dimension(*) fr_cnds,
integer, dimension(*) iad_cnds,
integer lcomm )

Definition at line 32 of file spmd_exch_tag_scnd.F.

34C-----------------------------------------------
35C I m p l i c i t T y p e s
36C-----------------------------------------------
37 USE spmd_comm_world_mod, ONLY : spmd_comm_world
38#include "implicit_f.inc"
39C-----------------------------------------------
40C M e s s a g e P a s s i n g
41C-----------------------------------------------
42#include "spmd.inc"
43C-----------------------------------------------
44C C o m m o n B l o c k s
45C-----------------------------------------------
46#include "com01_c.inc"
47#include "com04_c.inc"
48#include "task_c.inc"
49C-----------------------------------------------
50C D u m m y A r g u m e n t s
51C-----------------------------------------------
52 INTEGER LCOMM, ITAGND(*), FR_CNDS(*), IAD_CNDS(*)
53C-----------------------------------------------
54C L o c a l V a r i a b l e s
55C-----------------------------------------------
56#ifdef MPI
57 INTEGER MSGTYP,LOC_PROC,NOD,I,J,L,IDEB,IAD,LEN,
58 . NBINDEX,INDEX,MSGOFF,SIZ,IERROR,
59 . STATUS(MPI_STATUS_SIZE),
60 . REQ_S(NSPMD),REQ_R(NSPMD),INDEXI(NSPMD)
61 DATA msgoff/1179/
62 integer
63 . sbuf(lcomm),rbuf(lcomm)
64C-----------------------------------------------
65C S o u r c e L i n e s
66C-----------------------------------------------
67 loc_proc = ispmd + 1
68 DO i=1,nspmd
69 siz = iad_cnds(i+1)-iad_cnds(i)
70 IF(siz>0)THEN
71 l = iad_cnds(i)
72 msgtyp = msgoff
73 CALL mpi_irecv(
74 s rbuf(l),siz ,mpi_integer,it_spmd(i),msgtyp,
75 g spmd_comm_world,req_r(i),ierror)
76 ENDIF
77 END DO
78C
79C preparation envoi a proc I
80C--------------------------------------------------------------------
81 DO i=1,nspmd
82 DO j=iad_cnds(i),iad_cnds(i+1)-1
83 nod = fr_cnds(j)
84 IF (iabs(itagnd(nod))>ns10e) THEN
85 sbuf(j) = 1
86 ELSE
87 sbuf(j) = 0
88 END IF
89 ENDDO
90 ENDDO
91C
92C echange messages
93C--------------------------------------------------------------------
94 DO i=1,nspmd
95 siz = iad_cnds(i+1)-iad_cnds(i)
96 IF(siz>0)THEN
97 l = iad_cnds(i)
98 msgtyp = msgoff
99 CALL mpi_isend(
100 + sbuf(l),siz,mpi_integer,it_spmd(i),msgtyp,
101 + spmd_comm_world,req_s(i),ierror)
102 ENDIF
103 ENDDO
104C
105C assemblage
106C--------------------------------------------------------------------
107 DO i=1,nspmd
108 siz = iad_cnds(i+1)-iad_cnds(i)
109 IF(siz>0)THEN
110 CALL mpi_wait(req_r(i),status,ierror)
111 DO j=iad_cnds(i),iad_cnds(i+1)-1
112 nod = fr_cnds(j)
113 IF (itagnd(nod)>0) THEN
114 IF (itagnd(nod)<=ns10e.AND.rbuf(j)==1)
115 + itagnd(nod) = itagnd(nod) + ns10e
116 ELSEIF(itagnd(nod)<0) THEN
117 IF (itagnd(nod)>=-ns10e.AND.rbuf(j)==1)
118 + itagnd(nod) = itagnd(nod) - ns10e
119 END IF
120 ENDDO
121 ENDIF
122 ENDDO
123C
124C--------------------------------------------------------------------
125 DO i = 1, nspmd
126 IF((iad_cnds(i+1)-iad_cnds(i))>0)THEN
127 CALL mpi_wait(req_s(i),status,ierror)
128 ENDIF
129 ENDDO
130C
131#endif
132 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