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

Go to the source code of this file.

Functions/Subroutines

subroutine spmd_reduce_db (value, res, my_size, my_rank, my_operation)

Function/Subroutine Documentation

◆ spmd_reduce_db()

subroutine spmd_reduce_db ( real(kind=8), dimension(my_size), intent(in) value,
real(kind=8), dimension(my_size), intent(out) res,
integer, intent(in) my_size,
integer, intent(in) my_rank,
character(len=4), intent(in) my_operation )

Definition at line 31 of file spmd_reduce_db.F.

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
subroutine mpi_reduce(sendbuf, recvbuf, cnt, datatype, op, root, comm, ierr)
Definition mpi.f:120