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

Function/Subroutine Documentation

◆ spmd_iget_partn()

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

Definition at line 49 of file spmd_iget_partn.F.

50C gather sur p0 du tableau wa en fonction des parts (IADG)
51C-----------------------------------------------
52C I m p l i c i t T y p e s
53C-----------------------------------------------
54 USE spmd_comm_world_mod, ONLY : spmd_comm_world
55#include "implicit_f.inc"
56C-----------------------------------------------
57C M e s s a g e P a s s i n g
58C-----------------------------------------------
59
60#include "spmd.inc"
61
62C-----------------------------------------------
63C C o m m o n B l o c k s
64C-----------------------------------------------
65#include "com01_c.inc"
66#include "task_c.inc"
67C-----------------------------------------------
68C D u m m y A r g u m e n t s
69C-----------------------------------------------
70 INTEGER NBF_L, NP(*),IADG(NSPMD,*),SIZE
71 INTEGER NBPART, IFLAG,SRBUF
72C-----------------------------------------------
73C L o c a l V a r i a b l e s
74C-----------------------------------------------
75#ifdef MPI
76 INTEGER MSGOFF,MSGTYP,INFO,IDEB,K,N,NB_TMP,LEN,IADP(NSPMD),I
77
78 INTEGER STATUS(MPI_STATUS_SIZE),IERROR
79 INTEGER, DIMENSION(:),ALLOCATABLE :: RBUF,NPT
80 DATA msgoff/7029/
81C-----------------------------------------------
82C S o u r c e L i n e s
83C-----------------------------------------------
84 ALLOCATE(rbuf(srbuf+1))
85 ALLOCATE(npt(nbf_l))
86
87 IF (ispmd/=0) THEN
88 msgtyp= msgoff
89
90 CALL mpi_send(np,nbf_l,mpi_integer,it_spmd(1),msgtyp,
91 . spmd_comm_world,ierror)
92
93 ELSE
94 DO k=1,nbf_l
95 rbuf(k) = np(k)
96 ENDDO
97 ideb = nbf_l + 1
98 iadp(1) = 1
99C
100 DO k=2,nspmd
101 iadp(k) = ideb
102 msgtyp= msgoff
103
104 CALL mpi_probe(it_spmd(k),msgtyp,
105 . spmd_comm_world,status,ierror)
106 CALL mpi_get_count(status,mpi_integer,nb_tmp,ierror)
107
108 CALL mpi_recv(rbuf(ideb),nb_tmp,mpi_integer,it_spmd(k),msgtyp,
109 . spmd_comm_world,status,ierror)
110
111 ideb = ideb + nb_tmp
112 END DO
113C
114 DO n = 1, nbpart
115 DO k = 1, nspmd
116 IF (n>1) THEN
117 len = (iadg(k,n) - iadg(k,n-1))*SIZE
118 ELSE
119 len = iadg(k,n)*SIZE
120 ENDIF
121
122 IF (iflag==1) THEN
123 IF(len>0)CALL write_i_c(rbuf(iadp(k)),len)
124 ELSEIF(iflag==2) THEN
125 IF(len>0)CALL write_c_c(rbuf(iadp(k)),len)
126 ENDIF
127 iadp(k) = iadp(k) + len
128 ENDDO
129 ENDDO
130 ENDIF
131C
132 DEALLOCATE(rbuf)
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
void write_i_c(int *w, int *len)
void write_c_c(int *w, int *len)