OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_r4get_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_r4get_partn (size, nbf_l, nbpart, iadg, wal, buf)

Function/Subroutine Documentation

◆ spmd_r4get_partn()

subroutine spmd_r4get_partn ( integer size,
integer nbf_l,
integer nbpart,
integer, dimension(nspmd,*) iadg,
real, dimension(*) wal,
integer buf )

Definition at line 46 of file spmd_r4get_partn.F.

47C gather sur p0 du tableau wa en fonction des parts (IADG)
48C-----------------------------------------------
49C I m p l i c i t T y p e s
50C-----------------------------------------------
51 USE spmd_comm_world_mod, ONLY : spmd_comm_world
52#include "implicit_f.inc"
53C-----------------------------------------------
54C M e s s a g e P a s s i n g
55C-----------------------------------------------
56#include "spmd.inc"
57
58C-----------------------------------------------
59C C o m m o n B l o c k s
60C-----------------------------------------------
61#include "com01_c.inc"
62#include "task_c.inc"
63C-----------------------------------------------
64C D u m m y A r g u m e n t s
65C-----------------------------------------------
66 INTEGER NBF_L, NBPART, SIZE, IFLAG, IADG(NSPMD,*),BUF
67 REAL WAL(*)
68 REAL, DIMENSION(:), ALLOCATABLE :: WAR
69C-----------------------------------------------
70C L o c a l V a r i a b l e s
71C-----------------------------------------------
72#ifdef MPI
73 INTEGER MSGOFF,MSGTYP,INFO,IDEB,K,N,NB_TMP,LEN,IADP(NSPMD)
74 REAL AUX
75 INTEGER STATUS(MPI_STATUS_SIZE),IERROR
76 DATA msgoff/7002/
77C-----------------------------------------------
78C S o u r c e L i n e s
79C-----------------------------------------------
80 ALLOCATE(war(buf+1))
81
82 IF (ispmd/=0) THEN
83 msgtyp=msgoff
84 CALL mpi_send(wal,nbf_l,mpi_real4,it_spmd(1),msgtyp,
85 . spmd_comm_world,ierror)
86
87 ELSE
88C
89 DO k=1,nbf_l
90 war(k) = wal(k)
91 END DO
92
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_real4,nb_tmp,ierror)
103 CALL mpi_recv(war(ideb),nb_tmp,mpi_real4,it_spmd(k),msgtyp,
104 . spmd_comm_world,status,ierror)
105
106 ideb = ideb + nb_tmp
107 END DO
108 DO n = 1, nbpart
109 DO k = 1, nspmd
110 IF (n>1) THEN
111 len = (iadg(k,n) - iadg(k,n-1))*SIZE
112 ELSE
113 len = iadg(k,n)*SIZE
114 ENDIF
115 IF(len>0)CALL write_r_c(war(iadp(k)),len)
116 iadp(k) = iadp(k) + len
117 ENDDO
118 ENDDO
119 ENDIF
120C
121 DEALLOCATE(war)
122#endif
123 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_r_c(float *w, int *len)