MOOCHO (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
RTOp_apply_op_mpi.c File Reference
#include "RTOp_apply_op_mpi.h"
#include "RTOp_parallel_helpers.h"
#include "RTOpToMPI.h"
#include <stdlib.h>
Include dependency graph for RTOp_apply_op_mpi.c:

Go to the source code of this file.

Functions

int RTOp_apply_op_mpi (MPI_Comm comm, RTOp_index_type global_dim_in, RTOp_index_type local_sub_dim_in, RTOp_index_type local_offset_in, const int num_cols, const int num_vecs, const RTOp_value_type *l_vec_ptrs[], const ptrdiff_t l_vec_strides[], const ptrdiff_t l_vec_leading_dim[], const int num_targ_vecs, RTOp_value_type *l_targ_vec_ptrs[], const ptrdiff_t l_targ_vec_strides[], const ptrdiff_t l_targ_vec_leading_dim[], const RTOp_index_type first_ele_in, const RTOp_index_type sub_dim_in, const RTOp_index_type global_offset_in, const struct RTOp_RTOp *op, RTOp_ReductTarget reduct_objs[])
 

Function Documentation

int RTOp_apply_op_mpi ( MPI_Comm  comm,
RTOp_index_type  global_dim,
RTOp_index_type  local_sub_dim,
RTOp_index_type  local_offset,
const int  num_cols,
const int  num_vecs,
const RTOp_value_type local_vec_ptrs[],
const ptrdiff_t  local_vec_strides[],
const ptrdiff_t  local_vec_leading_dim[],
const int  num_targ_vecs,
RTOp_value_type local_targ_vec_ptrs[],
const ptrdiff_t  local_targ_vec_strides[],
const ptrdiff_t  local_targ_vec_leading_dim[],
const RTOp_index_type  first_ele,
const RTOp_index_type  sub_dim,
const RTOp_index_type  global_offset,
const struct RTOp_RTOp op,
RTOp_ReductTarget  reduct_objs[] 
)

Function that implements the guts an apply_op() method for dense MPI vectors.

Parameters
comm[in] MPI communicator
global_dim[in] Number of global elements represented by the MPI vector object that called this function.
local_dim[in] Number of vector elements stored on this local processor
num_cols[in] The number of columns in each mulit-vector argument.
num_vecs[in] Number of non-mutable vectors involved in this reduction/transformation operation (see below).
local_vec_ptrs[in] Array (size num_vecs) of pointers to the local elements of the non-mutable vectors (see below).
local_vec_strides[in] Array (size num_vecs) of strides between vector elements in local_vec_ptrs[p] (see below).
local_vec_leading_dim[in] Array (size num_vecs) of leading dimmensions between colummns for each vector in local_vec_ptrs[p] (see below). Can be NULL if num_cols==0.
num_targ_vecs[in] Number of mutable vectors involved in this reduction/transformation operation (see below).
local_targ_vec_ptrs[in/out] Array (size num_targ_vecs) of pointers to the local elements of the mutable vectors to be transformed (see below).
local_targ_vec_strides[in] Array (size num_targ_vecs) of leading dimmensions between colummns for each vector in local_targ_vec_ptrs[p] (see below).
local_targ_vec_leading_dim[in] Array (size num_vecs) of strides between vector elements in local_vec_ptrs[p] (see below). Can be NULL if num_cols==0.
first_ele[in] Identifies the first global element in the input parallel vector that defines the logical sub-vector that the RTOp operator will be applied to.
sub_dim[in] Identifies the number of elements in the input parallel vector that defines the logical sub-vector that the RTOp operator will be applied to. If sub_dim == 0 then all of the remaining global elements will be included in the logical vector.
global_offset[in] Identifies where the sub-vector selected by first_ele and sub_dim exists in the logical sub-vector that the RTOp operator will be applied to.
op[in] Reduction/transformation operator to apply over each sub-vector and use to add to the reduction target object reduct_obj (if reduct_obj != RTOp_REDUCT_OBJ_NULL).
reduct_objs[in/out] Array (sizee num_cols) of target objects of the reduction operation. These objects must have been created by the RTOp_reduct_obj_create(op&reduct_objs[kc]) function first, for kc=0...num_cols-1. The reduction operation will be added to (reduct_objs[]) if (reduct_obj[kc]) has already been through a reduction. By allowing the info in (reduct_objs[kc]) to be added to the reduction over all of these vectors, the reduction operation can be accumulated over a set of abstract vectors which can be useful for implementing composite vectors for instance. If RTOp_get_reduct_type_num_entries(op,...) returns num_values == 0, num_indexes == 0 and num_chars == 0 then reduct_obj should be set to NULL and no reduction will be performed.

This function takes care of all of the ugly details that goes on under the hood of using RTOp operators in a distrubuted parallel application using MPI.

This first set of arguments specifies the MPI environment and defines the parallel vector arguments and their local data.

The set of arguments first_ele, sub_dim and global_offset defines the logical sub-vectors that the operator will be applied to. See the function RTOp_parallel_calc_overlap() for a description of what these arguments mean.

This last set of arguments passes in the RTOp operator object op and the reduction target object reduct_obj.

ToDo: Finish documentation!

Definition at line 50 of file RTOp_apply_op_mpi.c.