OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_iget_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_iget_partn ../engine/source/mpi/anim/spmd_iget_partn.F
26!||--- called by ------------------------------------------------------
27!|| anioff0 ../engine/source/output/anim/generate/anioff0.F
28!|| anioffc ../engine/source/output/anim/generate/anioffc.F
29!|| anioffc_crk ../engine/source/output/anim/generate/anioffc_crk.F
30!|| anioffc_ply ../engine/source/output/anim/generate/anioffc_ply.F
31!|| aniofff ../engine/source/output/anim/generate/aniofff.F
32!|| anioffs ../engine/source/output/anim/generate/anioff6.F
33!|| delnumb0 ../engine/source/output/anim/generate/delnumb0.f
34!|| delnumbc ../engine/source/output/anim/generate/delnumbc.F
35!|| delnumbc_crk ../engine/source/output/anim/generate/delnumbc_crk.F
36!|| delnumbf ../engine/source/output/anim/generate/delnumbf.F
37!|| delnumbs ../engine/source/output/anim/generate/delnumb6.F
38!|| parsor0 ../engine/source/output/anim/generate/parsor0.F
39!|| parsor_crk ../engine/source/output/anim/generate/parsor_crk.F
40!|| parsorc ../engine/source/output/anim/generate/parsorc.F
41!|| parsorf ../engine/source/output/anim/generate/parsorf.F
42!|| parsors ../engine/source/output/anim/generate/parsors.F
43!||--- calls -----------------------------------------------------
44!|| write_c_c ../common_source/tools/input_output/write_routtines.c
45!|| write_i_c ../common_source/tools/input_output/write_routtines.c
46!||--- uses -----------------------------------------------------
47!|| spmd_comm_world_mod ../engine/source/mpi/spmd_comm_world.F90
48!||====================================================================
49 SUBROUTINE spmd_iget_partn(SIZE,NBF_L,NP,NBPART,IADG,SRBUF,IFLAG)
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
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
subroutine spmd_iget_partn(size, nbf_l, np, nbpart, iadg, srbuf, iflag)
subroutine delnumb0(iparg, el2fa, nbf, inum, kxsp)
Definition delnumb0.F:30
void write_i_c(int *w, int *len)
void write_c_c(int *w, int *len)