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

Go to the source code of this file.

Functions/Subroutines

subroutine spmd_sd_acc (accelm, iaccp, naccp)

Function/Subroutine Documentation

◆ spmd_sd_acc()

subroutine spmd_sd_acc ( accelm,
integer, dimension(*) iaccp,
integer, dimension(*) naccp )

Definition at line 33 of file spmd_sd_acc.F.

34C envoi vers p0 du tableau ACCELM calcule sur chaque proc
35C-----------------------------------------------
36C I m p l i c i t T y p e s
37C-----------------------------------------------
38 USE spmd_comm_world_mod, ONLY : spmd_comm_world
39#include "implicit_f.inc"
40C-----------------------------------------------------------------
41C M e s s a g e P a s s i n g
42C-----------------------------------------------
43#include "spmd.inc"
44C-----------------------------------------------
45C C o m m o n B l o c k s
46C-----------------------------------------------
47#include "com01_c.inc"
48#include "com04_c.inc"
49#include "task_c.inc"
50#include "param_c.inc"
51C-----------------------------------------------
52C D u m m y A r g u m e n t s
53C-----------------------------------------------
54 INTEGER IACCP(*), NACCP(*)
56 . accelm(llaccelm,*)
57C-----------------------------------------------
58C L o c a l V a r i a b l e s
59C-----------------------------------------------
60#ifdef MPI
61 INTEGER MSGTYP,MSGOFF,IERROR,LOC_PROC,NN,L,I,K,N,II,J,
62 . IDEB,SIZ,A_AR,NBIRECV,INDEX,
63 . IRINDEX(NSPMD),REQ_R(NSPMD),IAD_RECV(NSPMD),
64 . STATUS(MPI_STATUS_SIZE)
66 . buf(llaccelm+1,naccelm)
67 DATA msgoff/201/
68C-----------------------------------------------
69C S o u r c e L i n e s
70C-----------------------------------------------
71 loc_proc = ispmd + 1
72 IF (loc_proc==1) THEN
73 ideb = 1
74 nbirecv = 0
75 DO i = 2, nspmd
76 iad_recv(i) = ideb
77 IF(naccp(i)>0)THEN
78 nbirecv = nbirecv + 1
79 irindex(nbirecv) = i
80 nn = naccp(i)
81 siz = (llaccelm+1)*nn
82 msgtyp = msgoff
83 CALL mpi_irecv(
84 s buf(1,ideb),siz,real,it_spmd(i),msgtyp,
85 g spmd_comm_world,req_r(nbirecv),ierror)
86 ideb = ideb + nn
87 END IF
88 END DO
89C
90 DO ii = 1, nbirecv
91 CALL mpi_waitany(nbirecv,req_r,index,status,ierror)
92 i = irindex(index)
93 l = iad_recv(i)
94 nn = naccp(i)
95 DO n = l, l+nn-1
96 k = nint(buf(1,n))
97 DO j = 1, llaccelm
98 accelm(j,k) = buf(j+1,n)
99 END DO
100 END DO
101 END DO
102C
103 ELSE
104 k = 0
105 DO n = 1, naccelm
106 IF(iaccp(n)==loc_proc)THEN
107 k = k + 1
108 buf(1,k) = n
109 DO j = 1, llaccelm
110 buf(j+1,k) = accelm(j,n)
111 END DO
112 END IF
113 END DO
114 IF(k>0)THEN
115 siz = (llaccelm+1)*k
116 msgtyp=msgoff
117 CALL mpi_send(
118 s buf,siz,real,it_spmd(1),msgtyp,
119 g spmd_comm_world,ierror)
120 END IF
121 END IF
122C
123#endif
124 RETURN
#define my_real
Definition cppsort.cpp:32
subroutine mpi_send(buf, cnt, datatype, dest, tag, comm, ierr)
Definition mpi.f:480
subroutine mpi_waitany(cnt, array_of_requests, index, status, ierr)
Definition mpi.f:549
subroutine mpi_irecv(buf, cnt, datatype, source, tag, comm, ireq, ierr)
Definition mpi.f:372