OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_reduce_db.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_reduce_db ../engine/source/mpi/generic/spmd_reduce_db.F
25!||--- called by ------------------------------------------------------
26!|| radioss2 ../engine/source/engine/radioss2.F
27!||--- calls -----------------------------------------------------
28!||--- uses -----------------------------------------------------
29!|| spmd_comm_world_mod ../engine/source/mpi/spmd_comm_world.F90
30!||====================================================================
31 SUBROUTINE spmd_reduce_db(VALUE,RES,MY_SIZE,MY_RANK,MY_OPERATION)
32C-----------------------------------------------
33C I m p l i c i t T y p e s
34C-----------------------------------------------
35 USE spmd_comm_world_mod, ONLY : spmd_comm_world
36#include "implicit_f.inc"
37C-----------------------------------------------------------------
38C M e s s a g e P a s s i n g
39C-----------------------------------------------
40#include "spmd.inc"
41C-----------------------------------------------
42C D u m m y A r g u m e n t s
43C-----------------------------------------------
44 CHARACTER(len=4), INTENT(in) :: MY_OPERATION
45 INTEGER, INTENT(in) :: MY_SIZE,MY_RANK
46 REAL(kind=8), dimension(my_size), INTENT(in) :: VALUE
47 REAL(kind=8), dimension(my_size), INTENT(out) :: res
48
49#ifdef MPI
50C-----------------------------------------------
51C L o c a l V a r i a b l e s
52C-----------------------------------------------
53 INTEGER :: error
54 INTEGER :: MPI_OPERATION
55! ----------------------------------------
56
57 IF(my_operation(1:3)=="SUM") THEN
58 mpi_operation=mpi_sum
59 ELSEIF(my_operation(1:4)=="PROD") THEN
60 mpi_operation=mpi_prod
61 ELSEIF(my_operation(1:3)=="MAX") THEN
62 mpi_operation=mpi_max
63 ELSEIF(my_operation(1:3)=="MIN") THEN
64 mpi_operation=mpi_min
65 ENDIF
66
67! ------------------
68! mpi comm reduce
69 CALL mpi_reduce(VALUE,res,my_size,mpi_double_precision,mpi_operation,my_rank,spmd_comm_world,error)
70! ------------------
71#else
72 res = 0
73#endif
74 RETURN
75 END SUBROUTINE spmd_reduce_db
76! ----------------------------------------
77
subroutine mpi_reduce(sendbuf, recvbuf, cnt, datatype, op, root, comm, ierr)
Definition mpi.f:120
subroutine spmd_reduce_db(value, res, my_size, my_rank, my_operation)