OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_iget_partn_ply.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!|| spmd_iget_partn_ply ../engine/source/mpi/anim/spmd_iget_partn_ply.F
25!||--- called by ------------------------------------------------------
26!|| delnumbc_ply ../engine/source/output/anim/generate/delnumbc_ply.F
27!|| parsor_ply ../engine/source/output/anim/generate/parsor_ply.F
28!||--- calls -----------------------------------------------------
29!|| get_ply_nod ../engine/source/output/anim/generate/anin_ply_init.F
30!|| write_c_c ../common_source/tools/input_output/write_routtines.c
31!|| write_i_c ../common_source/tools/input_output/write_routtines.c
32!||--- uses -----------------------------------------------------
33!|| plyxfem_mod ../engine/share/modules/plyxfem_mod.F
34!|| spmd_comm_world_mod ../engine/source/mpi/spmd_comm_world.F90
35!||====================================================================
36 SUBROUTINE spmd_iget_partn_ply(SIZE,NBF_L,NP,NBPART,IADG,
37 * SRBUF,IFLAG,IDPLY)
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
136 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
integer, dimension(:), allocatable indx_ply
Definition plyxfem_mod.F:60
subroutine spmd_iget_partn_ply(size, nbf_l, np, nbpart, iadg, srbuf, iflag, idply)
void write_i_c(int *w, int *len)
void write_c_c(int *w, int *len)