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

Go to the source code of this file.

Functions/Subroutines

subroutine spmd_box_limit_reduction (nb_inter_sorted, box_limit)

Function/Subroutine Documentation

◆ spmd_box_limit_reduction()

subroutine spmd_box_limit_reduction ( integer, intent(in) nb_inter_sorted,
intent(inout) box_limit )
Parameters
[in]nb_inter_sortednumber of interfaces that need to be sorted

Definition at line 34 of file spmd_box_limit_reduction.F.

35!$COMMENT
36! SPMD_GRID_LIMIT_REDUCTION description :
37! compute the minimal & maximal positions
38!
39! SPMD_GRID_LIMIT_REDUCTION organization :
40! loop over the nodes & min+max computation
41!$ENDCOMMENT
42C-----------------------------------------------
43C M o d u l e s
44C-----------------------------------------------
46 USE spmd_mod
47C-----------------------------------------------
48C I m p l i c i t T y p e s
49C-----------------------------------------------
50#include "implicit_f.inc"
51C-----------------------------------------------
52C M e s s a g e P a s s i n g
53C-----------------------------------------------
54#include "spmd.inc"
55C-----------------------------------------------
56C D u m m y A r g u m e n t s
57C-----------------------------------------------
58 INTEGER, INTENT(in) :: NB_INTER_SORTED !< number of interfaces that need to be sorted
59 my_real, dimension(6), intent(inout) :: box_limit !< upper & lower bound of the box
60C-----------------------------------------------
61C L o c a l V a r i a b l e s
62C-----------------------------------------------
63 INTEGER :: I
64 REAL(kind=8), dimension(6) :: buffer_s,buffer_r
65#ifdef MPI
66 CHARACTER(len=4) :: MY_OPERATION
67C-----------------------------------------------
68 ! ------------------
69 ! globalization of min/max position
70 DO i=1,3
71 buffer_s(i) = box_limit(i) ! max values
72 buffer_s(3+i) = -one * box_limit(3+i) ! min values
73 ENDDO
74 ! ------------------
75 my_operation(1:4) = ''
76 my_operation(1:3) = "MAX"
77
78 CALL spmd_allreduce(buffer_s,buffer_r,6,spmd_max)
79 ! ------------------
80 IF(nb_inter_sorted>0) THEN
81 DO i=1,3
82 box_limit(i) = buffer_r(i)
83 box_limit(3+i) = -one * buffer_r(3+i)
84 ENDDO
85 ENDIF
86 ! ------------------
87#endif
88 RETURN
#define my_real
Definition cppsort.cpp:32