45 #include "RTOp_parallel_helpers.h"
47 #define MY_MIN(a,b) ( (a) < (b) ? (a) : (b) )
48 #define MY_MAX(a,b) ( (a) > (b) ? (a) : (b) )
50 void RTOp_parallel_calc_overlap(
51 Teuchos_Ordinal global_dim_in, Teuchos_Ordinal local_sub_dim_in, Teuchos_Ordinal local_off_in
52 ,
const Teuchos_Ordinal first_ele_off_in,
const Teuchos_Ordinal sub_dim_in,
const Teuchos_Ordinal global_off_in
53 ,Teuchos_Ordinal* overlap_first_local_ele_off, Teuchos_Ordinal* overalap_local_sub_dim
54 ,Teuchos_Ordinal* overlap_global_off
57 Teuchos_Ordinal global_sub_dim = 0;
59 assert( overlap_first_local_ele_off );
60 assert( overalap_local_sub_dim );
61 assert( overlap_global_off );
65 global_sub_dim = sub_dim_in >= 0 ? sub_dim_in : global_dim_in - first_ele_off_in;
71 local_off_in + local_sub_dim_in < first_ele_off_in + 1
73 first_ele_off_in + global_sub_dim < local_off_in + 1
82 *overlap_first_local_ele_off = first_ele_off_in <= local_off_in ? 0 : first_ele_off_in - local_off_in;
87 *overalap_local_sub_dim = (
88 MY_MIN(first_ele_off_in+global_sub_dim,local_off_in+local_sub_dim_in)
90 MY_MAX(first_ele_off_in,local_off_in)
102 *overlap_global_off = (
103 ( first_ele_off_in > local_off_in
105 : local_off_in - first_ele_off_in
111 *overlap_first_local_ele_off = -1;