OpenRadioss 2025.1.11
OpenRadioss project
Loading...
Searching...
No Matches
spmd_box_limit_reduction.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!||====================================================================
25!|| spmd_box_limit_reduction ../engine/source/mpi/interfaces/spmd_box_limit_reduction.F
26!||--- called by ------------------------------------------------------
27!|| inter_init_component ../engine/source/interfaces/generic/inter_init_component.F90
28!|| inter_prepare_sort ../engine/source/interfaces/generic/inter_prepare_sort.F
29!||--- calls -----------------------------------------------------
30!||--- uses -----------------------------------------------------
31!|| inter_struct_mod ../engine/share/modules/inter_struct_mod.F
32!|| spmd_mod ../engine/source/mpi/spmd_mod.F90
33!||====================================================================
34 SUBROUTINE spmd_box_limit_reduction(NB_INTER_SORTED,box_limit)
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
91 END SUBROUTINE spmd_box_limit_reduction
#define my_real
Definition cppsort.cpp:32
subroutine spmd_box_limit_reduction(nb_inter_sorted, box_limit)