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