OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_allreduce_db_comm.F File Reference
#include "implicit_f.inc"
#include "spmd.inc"

Go to the source code of this file.

Functions/Subroutines

subroutine spmd_allreduce_db_comm (value, res, my_size, my_operation, my_comm)

Function/Subroutine Documentation

◆ spmd_allreduce_db_comm()

subroutine spmd_allreduce_db_comm ( real(kind=8), dimension(my_size), intent(in) value,
real(kind=8), dimension(my_size), intent(out) res,
integer, intent(in) my_size,
character(len=*), intent(in) my_operation,
integer, intent(in) my_comm )

Definition at line 27 of file spmd_allreduce_db_comm.F.

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
subroutine mpi_allreduce(sendbuf, recvbuf, cnt, datatype, operation, comm, ierr)
Definition mpi.f:103