OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_fvb_comm_pattern.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_fvb_comm_pattern ../engine/source/mpi/airbags/spmd_fvb_comm_pattern.F
26!||--- called by ------------------------------------------------------
27!|| fvrrest ../engine/source/output/restart/rdresb.F
28!||--- calls -----------------------------------------------------
29!||--- uses -----------------------------------------------------
30!|| fvbag_mod ../engine/share/modules/fvbag_mod.F
31!||====================================================================
32 SUBROUTINE spmd_fvb_comm_pattern(IFV)
33
34! Prepare the communication pattern for the FVB
35C-----------------------------------------------
36C M o d u l e s
37C-----------------------------------------------
38 USE fvbag_mod
39C-----------------------------------------------
40C I m p l i c i t T y p e s
41C-----------------------------------------------
42#include "implicit_f.inc"
43C-----------------------------------------------------------------
44C M e s s a g e P a s s i n g
45C-----------------------------------------------
46#include "spmd.inc"
47C-----------------------------------------------
48C C o m m o n B l o c k s
49C-----------------------------------------------
50#include "com01_c.inc"
51C-----------------------------------------------
52C D u m m y A r g u m e n t s
53C-----------------------------------------------
54 INTEGER IFV
55C-----------------------------------------------
56C L o c a l V a r i a b l e s
57C-----------------------------------------------
58#ifdef MPI
59 INTEGER IERROR, LENG,ITABL(4)
60 INTEGER II, I, ITAG, LEN, ITAB(3,NSPMD-1),REQ(2*(NSPMD-1)),
61 . STAT(MPI_STATUS_SIZE,2*(NSPMD-1)), IERR,
62 . MSGOFF
63 DATA msgoff/238/
64
65C-----------------------------------------------
66C S o u r c e L i n e s
67C-----------------------------------------------
68 leng=1
69 IF(fvspmd(ifv)%RANK > -1) THEN
70 CALL mpi_allreduce(fvspmd(ifv)%NNA_L,fvspmd(ifv)%NNA_L_GLOB,leng,
71 . mpi_integer,mpi_sum, fvspmd(ifv)%MPI_COMM, ierror)
72C
73 ELSE
74 fvspmd(ifv)%NNA_L_GLOB = 0
75 ENDIF
76
77 IF (fvspmd(ifv)%RANK == 0) THEN
78C Reception des longueurs
79 ii=0
80 DO i=1,fvspmd(ifv)%NSPMD-1
81 ii=ii+1
82 itag=msgoff+i
83 len=4
84 CALL mpi_irecv(fvspmd(ifv)%ITAB(1,ii), len, mpi_integer, i,
85 . itag, fvspmd(ifv)%MPI_COMM, req(ii), ierr)
86 ENDDO
87 CALL mpi_waitall(fvspmd(ifv)%NSPMD-1, req, stat, ierr)
88
89 ELSE IF(fvspmd(ifv)%RANK > 0) THEN
90 itabl(1)=fvspmd(ifv)%NN_L
91C ajout noeuds internes
92 itabl(2)=fvspmd(ifv)%NNA_L
93 itabl(3)=fvspmd(ifv)%NNSA_L
94 itabl(4)=fvspmd(ifv)%NNI_L
95 itag=msgoff+fvspmd(ifv)%RANK
96 len=4
97 CALL mpi_send(itabl, len, mpi_integer, 0,
98 . itag, fvspmd(ifv)%MPI_COMM, ierr)
99C
100 ENDIF
101#endif
102 RETURN
103 END
subroutine mpi_waitall(cnt, array_of_requests, status, ierr)
Definition mpi.f:536
subroutine mpi_send(buf, cnt, datatype, dest, tag, comm, ierr)
Definition mpi.f:480
subroutine mpi_allreduce(sendbuf, recvbuf, cnt, datatype, operation, comm, ierr)
Definition mpi.f:103
subroutine mpi_irecv(buf, cnt, datatype, source, tag, comm, ireq, ierr)
Definition mpi.f:372
type(fvbag_spmd), dimension(:), allocatable fvspmd
Definition fvbag_mod.F:129
subroutine spmd_fvb_comm_pattern(ifv)