OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_r4get_partn.F
Go to the documentation of this file.
1Copyright> OpenRadioss
2Copyright> Copyright (C) 1986-2025 Altair Engineering Inc.
3Copyright>
4Copyright> This program is free software: you can redistribute it and/or modify
5Copyright> it under the terms of the GNU Affero General Public License as published by
6Copyright> the Free Software Foundation, either version 3 of the License, or
7Copyright> (at your option) any later version.
8Copyright>
9Copyright> This program is distributed in the hope that it will be useful,
10Copyright> but WITHOUT ANY WARRANTY; without even the implied warranty of
11Copyright> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12Copyright> GNU Affero General Public License for more details.
13Copyright>
14Copyright> You should have received a copy of the GNU Affero General Public License
15Copyright> along with this program. If not, see <https://www.gnu.org/licenses/>.
16Copyright>
17Copyright>
18Copyright> Commercial Alternative: Altair Radioss Software
19Copyright>
20Copyright> As an alternative to this open-source version, Altair also offers Altair Radioss
21Copyright> software under a commercial license. Contact Altair to discuss further if the
22Copyright> commercial version may interest you: https://www.altair.com/radioss/.
23
24!||====================================================================
25!|| spmd_r4get_partn ../engine/source/mpi/anim/spmd_r4get_partn.F
26!||--- called by ------------------------------------------------------
27!|| animcale ../engine/source/output/anim/generate/monvol_anim.F90
28!|| dfunc0 ../engine/source/output/anim/generate/dfunc0.F
29!|| dfuncc ../engine/source/output/anim/generate/dfuncc.F
30!|| dfuncc_crk ../engine/source/output/anim/generate/dfuncc_crk.F
31!|| dfuncc_ply ../engine/source/output/anim/generate/dfuncc_ply.F
32!|| dfuncf ../engine/source/output/anim/generate/dfuncf.F
33!|| dfuncs ../engine/source/output/anim/generate/dfunc6.F
34!|| genani ../engine/source/output/anim/generate/genani.F
35!|| tensor0 ../engine/source/output/anim/generate/tensor0.F
36!|| tensorc ../engine/source/output/anim/generate/tensorc.F
37!|| tensorc_crk ../engine/source/output/anim/generate/tensorc_crk.F
38!|| tensorc_ply ../engine/source/output/anim/generate/tensorc_ply.F
39!|| tensors ../engine/source/output/anim/generate/tensor6.F
40!|| torseur ../engine/source/output/anim/generate/torseur.F
41!||--- calls -----------------------------------------------------
42!|| write_r_c ../common_source/tools/input_output/write_routtines.c
43!||--- uses -----------------------------------------------------
44!|| spmd_comm_world_mod ../engine/source/mpi/spmd_comm_world.F90
45!||====================================================================
46 SUBROUTINE spmd_r4get_partn(SIZE,NBF_L,NBPART,IADG,WAL,BUF)
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
124 END
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
subroutine spmd_r4get_partn(size, nbf_l, nbpart, iadg, wal, buf)
void write_r_c(float *w, int *len)