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 on p0 of the wa table according to the 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, 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,IDEB,K,N,NB_TMP,LEN,IADP(NSPMD)
74 INTEGER STATUS(MPI_STATUS_SIZE),IERROR
75 DATA msgoff/7002/
76C-----------------------------------------------
77C S o u r c e L i n e s
78C-----------------------------------------------
79 ALLOCATE(war(buf+1))
80
81 IF (ispmd/=0) THEN
82 msgtyp=msgoff
83 CALL mpi_send(wal,nbf_l,mpi_real4,it_spmd(1),msgtyp,
84 . spmd_comm_world,ierror)
85
86 ELSE
87C
88 DO k=1,nbf_l
89 war(k) = wal(k)
90 END DO
91
92 ideb = nbf_l + 1
93 iadp(1) = 1
94C
95 DO k=2,nspmd
96 iadp(k) = ideb
97 msgtyp=msgoff
98
99 CALL mpi_probe(it_spmd(k),msgtyp,
100 . spmd_comm_world,status,ierror)
101 CALL mpi_get_count(status,mpi_real4,nb_tmp,ierror)
102 CALL mpi_recv(war(ideb),nb_tmp,mpi_real4,it_spmd(k),msgtyp,
103 . spmd_comm_world,status,ierror)
104
105 ideb = ideb + nb_tmp
106 END DO
107 DO n = 1, nbpart
108 DO k = 1, nspmd
109 IF (n>1) THEN
110 len = (iadg(k,n) - iadg(k,n-1))*SIZE
111 ELSE
112 len = iadg(k,n)*SIZE
113 ENDIF
114 IF(len>0)CALL write_r_c(war(iadp(k)),len)
115 iadp(k) = iadp(k) + len
116 ENDDO
117 ENDDO
118 ENDIF
119C
120 DEALLOCATE(war)
121#endif
122 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)