OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_fl_sum.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/.
23C
24C
25!||====================================================================
26!|| spmd_fl_sum ../engine/source/mpi/generic/spmd_fl_sum.F
27!||--- called by ------------------------------------------------------
28!|| bemsolvp ../engine/source/fluid/bemsolvp.F
29!|| daaacc ../engine/source/fluid/daaacc.F
30!|| daasolvp ../engine/source/fluid/daasolvp.F
31!|| incpflow ../engine/source/fluid/incpflow.F
32!||--- calls -----------------------------------------------------
33!||--- uses -----------------------------------------------------
34!|| spmd_comm_world_mod ../engine/source/mpi/spmd_comm_world.F90
35!||====================================================================
36 SUBROUTINE spmd_fl_sum(LSUM, LEN, LSUMT)
37C-----------------------------------------------
38C I m p l i c i t T y p e s
39C-----------------------------------------------
40 USE spmd_comm_world_mod, ONLY : spmd_comm_world
41#include "implicit_f.inc"
42C-----------------------------------------------------------------
43C M e s s a g e P a s s i n g
44C-----------------------------------------------
45#include "spmd.inc"
46C-----------------------------------------------
47C C o m m o n B l o c k s
48C-----------------------------------------------
49#include "com01_c.inc"
50#include "task_c.inc"
51C-----------------------------------------------
52C D u m m y A r g u m e n t s
53C-----------------------------------------------
54 INTEGER LEN
56 . lsum(*), lsumt(*)
57C-----------------------------------------------
58C L o c a l V a r i a b l e s
59C-----------------------------------------------
60#ifdef MPI
61 INTEGER MSGOFF, MSGOFF2,ITAG, REQ(2), TSTAT(MPI_STATUS_SIZE,2), IERR,
62 . I, II, REQ1(NSPMD-1), J,
63 . STAT1(MPI_STATUS_SIZE,NSPMD-1)
65 . lsumc(len)
66C
67 DATA msgoff/186/
68 DATA msgoff2/187/
69C
70 IF (ispmd/=0) THEN
71 itag=msgoff
72 CALL mpi_isend(lsum, len, real, it_spmd(1), itag,
73 . spmd_comm_world, req(1), ierr)
74C
75 itag=msgoff2
76 CALL mpi_irecv(lsumt, len, real, it_spmd(1), itag,
77 . spmd_comm_world, req(2), ierr)
78C
79 CALL mpi_waitall(2, req, tstat, ierr)
80 ELSE
81 DO i=1,len
82 lsumt(i)=lsum(i)
83 ENDDO
84C
85 DO i=1,nspmd-1
86 ii=i+1
87 itag=msgoff
88 CALL mpi_irecv(lsumc, len, real, it_spmd(ii), itag,
89 . spmd_comm_world, req1(1), ierr)
90 CALL mpi_wait(req1(1), stat1(1,1), ierr)
91C
92 DO j=1,len
93 lsumt(j)=lsumt(j)+lsumc(j)
94 ENDDO
95 ENDDO
96C
97 DO i=1,nspmd-1
98 ii=i+1
99 itag=msgoff2
100 CALL mpi_isend(lsumt, len, real, it_spmd(ii), itag,
101 . spmd_comm_world, req1(i), ierr)
102 ENDDO
103C
104 CALL mpi_waitall(nspmd-1, req1, stat1, ierr)
105 ENDIF
106C
107#endif
108 RETURN
109 END
#define my_real
Definition cppsort.cpp:32
subroutine mpi_isend(buf, cnt, datatype, dest, tag, comm, ireq, ierr)
Definition mpi.f:382
subroutine mpi_wait(ireq, status, ierr)
Definition mpi.f:525
subroutine mpi_waitall(cnt, array_of_requests, status, ierr)
Definition mpi.f:536
subroutine mpi_irecv(buf, cnt, datatype, source, tag, comm, ireq, ierr)
Definition mpi.f:372
subroutine spmd_fl_sum(lsum, len, lsumt)
Definition spmd_fl_sum.F:37