#include "RTOp_MPI_config.h"
Include dependency graph for RTOp_parallel_helpers.h:
This graph shows which files directly or indirectly include this file:
Go to the source code of this file.
Functions | |
void | RTOp_parallel_calc_overlap (Teuchos_Index global_dim, Teuchos_Index local_sub_dim, Teuchos_Index local_off, const Teuchos_Index first_ele_off, const Teuchos_Index sub_dim, const Teuchos_Index global_off, Teuchos_Index *overlap_first_local_ele_off, Teuchos_Index *overalap_local_sub_dim, Teuchos_Index *overlap_global_off) |
This function helps to implement vector method apply_op(...) for any type of parallel vector. |
void RTOp_parallel_calc_overlap | ( | Teuchos_Index | global_dim, | |
Teuchos_Index | local_sub_dim, | |||
Teuchos_Index | local_off, | |||
const Teuchos_Index | first_ele_off, | |||
const Teuchos_Index | sub_dim, | |||
const Teuchos_Index | global_off, | |||
Teuchos_Index * | overlap_first_local_ele_off, | |||
Teuchos_Index * | overalap_local_sub_dim, | |||
Teuchos_Index * | overlap_global_off | |||
) |
This function helps to implement vector method apply_op(...)
for any type of parallel vector.
global_dim | [in] Dimension of the original parallel vector 'v' (see above). | |
local_sub_dim | [in] Dimension of the local subvector 'u' (see above). | |
local_off | [in] Gives the offset of the first element in the local sub-vector 'u' into the global vector 'v' (see above). | |
first_ele_off | [in] Determines the first element in 'v' which is used to define the logical sub-vector 'g' (see above). | |
sub_dim | [in] Determines the length of the logical sub-vector 'g' (see above). If sub_dim < 0 then sub_dim = global_dim - first_ele_off is used in its place. | |
global_off | [in] Determines the offset of the logical subvector 'g' into the logical global vector 'p' (see above). | |
overlap_first_local_ele_off | [out] If *overlap_first_local_ele < 0 on output, then this means that there is no overlap of 'u' with 'g' (see above). Otherwise, there is overlap and *overlap_first_local_ele_off gives the first element in 'u' that overlaps with 'g' which defines 'w' (see above). | |
overlap_local_sub_dim | [out] If *overlap_first_local_ele_off < 0 on output then this argument is not set and should be ignored. Otherwise, *overlap_local_sub_dim gives number of elements in 'u' that overlaps with 'g' that defines 'w' (see above). | |
overlap_global_off | [out] If *overlap_first_local_ele_off < 0 on output then this argument is not set and should be ignored. Otherwise, *overlap_global_off gives the placement of 'w' into 'p' (see above). |
global_dim > 0
local_sub_dim > 0
0 <= local_off <= global_dim - local_sub_dim
1 <= first_ele_off <= global_dim
sub_dim > 0
] 0 < sub_dim <= global_dim - first_ele_off
0 <= global_off
Postconditions:
0 <= overlap_first_local_ele_off <= local_sub_dim
overlap_first_local_ele_off == 0
] There is no overlap of 'g' with 'u' overlap_first_local_ele_off != 0
] 0 <= overlap_local_sub_dim <= local_sub_dim - overlap_first_local_ele_off
To understand what this function computes first consider the what an apply_op(...)
method might look like from a vector class. This method would take a list of non-mutable vectors:
v_1, v_2, ..., v_p
z_1, z_2, ..., z_q
op
over some subset of the elements in these vectors according to their placement as a set of sub-vectors in some other logical vector.
Let's consider how things are treated for a single vector argument v_i
or z_i
which we will call 'v'. This global vector 'v' is the first vector that we identity. One must understand that there are five distict vectors (or sub-vectors) being refered to here. The first vector (call it 'v') and is one of the parallel vectors that apply_op()
is called on that we have already discussed. The second vector (call it 'g') is the logical sub-vector that the client wants to represent using the elements in 'v'. This logical sub-vector is specified by the input arguments first_ele_off
, sub_dim
and global_off
. If for the time being we ignore global_off
, and then 'g' is defined in terms of 'v' as:
g(k) = v(first_ele_off+k), for k = 0...sub_dim-1
global_off
as: p(k+global_off) = g(k) = v(first_ele_off+k), for k = 0...sub_dim-1
u(k) = v(local_off+k), for k = 0...local_sub_dim-1
w(k) = p(overlap_global_off+k) = u(overlap_first_local_ele_off+k), for k = 0...overalap_local_sub_dim-1
Definition at line 36 of file RTOp_parallel_helpers.c.