OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_iget_partn_ply.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_iget_partn_ply (size, nbf_l, np, nbpart, iadg, srbuf, iflag, idply)

Function/Subroutine Documentation

◆ spmd_iget_partn_ply()

subroutine spmd_iget_partn_ply ( integer size,
integer nbf_l,
integer, dimension(*) np,
integer nbpart,
integer, dimension(nspmd,*) iadg,
integer srbuf,
integer iflag,
integer idply )

Definition at line 36 of file spmd_iget_partn_ply.F.

38C-----------------------------------------------
39C M o d u l e s
40C-----------------------------------------------
41 USE plyxfem_mod
42C gather sur p0 du tableau wa en fonction des parts (IADG)
43C-----------------------------------------------
44C I m p l i c i t T y p e s
45C-----------------------------------------------
46 USE spmd_comm_world_mod, ONLY : spmd_comm_world
47#include "implicit_f.inc"
48C-----------------------------------------------
49C M e s s a g e P a s s i n g
50C-----------------------------------------------
51
52#include "spmd.inc"
53
54C-----------------------------------------------
55C C o m m o n B l o c k s
56C-----------------------------------------------
57#include "com01_c.inc"
58#include "task_c.inc"
59C-----------------------------------------------
60C D u m m y A r g u m e n t s
61C-----------------------------------------------
62 INTEGER NBF_L, NP(*),IADG(NSPMD,*),SIZE
63 INTEGER NBPART, IFLAG,SRBUF,IDPLY
64C-----------------------------------------------
65C L o c a l V a r i a b l e s
66C-----------------------------------------------
67#ifdef MPI
68 INTEGER MSGOFF,MSGTYP,INFO,IDEB,K,N,NB_TMP,LEN,IADP(NSPMD),
69 . I,EMPL,IPLY
70
71 INTEGER, DIMENSION(:),ALLOCATABLE :: RBUF,RBUF2,NPT
72 INTEGER STATUS(MPI_STATUS_SIZE),IERROR
73 INTEGER GET_PLY_NOD
74 EXTERNAL get_ply_nod
75 DATA msgoff/7057/
76C-----------------------------------------------
77C S o u r c e L i n e s
78C-----------------------------------------------
79 ALLOCATE(rbuf(srbuf))
80 ALLOCATE(rbuf2(srbuf))
81 ALLOCATE(npt(nbf_l))
82
83 IF (ispmd/=0) THEN
84 msgtyp=msgoff
85
86 CALL mpi_send(np,nbf_l,mpi_integer,it_spmd(1),msgtyp,
87 . spmd_comm_world,ierror)
88
89 ELSE
90 DO k=1,nbf_l
91 rbuf(k) = np(k)
92 ENDDO
93 ideb = nbf_l + 1
94 iadp(1) = 1
95C
96 DO k=2,nspmd
97 iadp(k) = ideb
98 msgtyp=msgoff
99
100 CALL mpi_probe(it_spmd(k),msgtyp,
101 . spmd_comm_world,status,ierror)
102 CALL mpi_get_count(status,mpi_integer,nb_tmp,ierror)
103
104 CALL mpi_recv(rbuf(ideb),nb_tmp,mpi_integer,it_spmd(k),msgtyp,
105 . spmd_comm_world,status,ierror)
106
107 ideb = ideb + nb_tmp
108 END DO
109C
110 DO n = 1, nbpart
111 iply=indx_ply(n)
112 DO k = 1, nspmd
113 IF (n>1) THEN
114 len = (iadg(k,n) - iadg(k,n-1))*SIZE
115 ELSE
116 len = iadg(k,n)*SIZE
117 ENDIF
118 IF (iflag==1) THEN
119 DO i=iadp(k), iadp(k)+len-1
120 rbuf(i) = rbuf(i)+idply
121 ENDDO
122 CALL write_i_c(rbuf(iadp(k)),len)
123 ELSEIF(iflag==2) THEN
124 CALL write_c_c(rbuf(iadp(k)),len)
125 ENDIF
126 iadp(k) = iadp(k) + len
127 ENDDO
128 ENDDO
129 ENDIF
130C
131 DEALLOCATE(rbuf)
132 DEALLOCATE(rbuf2)
133 DEALLOCATE(npt)
134#endif
135 RETURN
subroutine mpi_recv(buf, cnt, datatype, source, tag, comm, status, ierr)
Definition mpi.f:461
subroutine mpi_get_count(status, datatype, cnt, ierr)
Definition mpi.f:296
subroutine mpi_send(buf, cnt, datatype, dest, tag, comm, ierr)
Definition mpi.f:480
subroutine mpi_probe(source, tag, comm, status, ierr)
Definition mpi.f:449
integer, dimension(:), allocatable indx_ply
Definition plyxfem_mod.F:60
integer function get_ply_nod(iply, nodid)
void write_i_c(int *w, int *len)
void write_c_c(int *w, int *len)