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 INTEGER :: ierror
67 INTEGER :: STATUS_(MPI_STATUS_SIZE)
68 CHARACTER(len=4) :: MY_OPERATION
69C-----------------------------------------------
70 ! ------------------
71 ! globalization of min/max position
72 DO i=1,3
73 buffer_s(i) = box_limit(i) ! max values
74 buffer_s(3+i) = -one * box_limit(3+i) ! min values
75 ENDDO
76 ! ------------------
77 my_operation(1:4) = ''
78 my_operation(1:3) = "MAX"
79
80 CALL spmd_allreduce(buffer_s,buffer_r,6,spmd_max)
81 ! ------------------
82 IF(nb_inter_sorted>0) THEN
83 DO i=1,3
84 box_limit(i) = buffer_r(i)
85 box_limit(3+i) = -one * buffer_r(3+i)
86 ENDDO
87 ENDIF
88 ! ------------------
89#endif
90 RETURN
#define my_real
Definition cppsort.cpp:32