00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef RTOPPACK_MPI_APPLY_OP_DECL_HPP
00031 #define RTOPPACK_MPI_APPLY_OP_DECL_HPP
00032
00033 #include "RTOpPack_RTOpT.hpp"
00034 #include "RTOp_MPI_config.h"
00035
00036 #define RTOPPACK_MPI_APPLY_OP_DUMP
00037
00038 namespace RTOpPack {
00039
00040 #ifdef RTOPPACK_MPI_APPLY_OP_DUMP
00041 extern bool show_mpi_apply_op_dump;
00042 #endif // RTOPPACK_MPI_APPLY_OP_DUMP
00043
00060 template<class primitive_value_type>
00061 void MPI_type_signature(
00062 const int num_values
00063 ,const int num_indexes
00064 ,const int num_chars
00065 ,int* num_entries
00066 ,int block_lengths[]
00067 ,MPI_Aint displacements[]
00068 ,MPI_Datatype datatypes[]
00069 );
00070
00075 template<class primitive_value_type>
00076 int reduct_obj_ext_size(
00077 int num_values
00078 ,int num_indexes
00079 ,int num_chars
00080 )
00081 {
00082 return (3 + num_values) * sizeof(primitive_value_type)
00083 + num_indexes * sizeof(index_type)
00084 + num_chars * sizeof(char_type);
00085 }
00086
00091 template<class Scalar>
00092 void extract_reduct_obj_ext_state(
00093 const RTOpT<Scalar> &op
00094 ,const ReductTarget &reduct_obj
00095 ,int num_values
00096 ,int num_indexes
00097 ,int num_chars
00098 ,void *reduct_obj_ext
00099 );
00100
00105 template<class Scalar>
00106 void load_reduct_obj_ext_state(
00107 const RTOpT<Scalar> &op
00108 ,const void *reduct_obj_ext
00109 ,ReductTarget *reduct_obj
00110 );
00111
00119 template<class Scalar>
00120 void MPI_apply_op(
00121 MPI_Comm comm
00122 ,const RTOpT<Scalar> &op
00123 ,const int root_rank
00124 ,const int num_vecs
00125 ,const ConstSubVectorView<Scalar> sub_vecs[]
00126 ,const int num_targ_vecs
00127 ,const SubVectorView<Scalar> targ_sub_vecs[]
00128 ,ReductTarget *reduct_obj
00129 );
00130
00138 template<class Scalar>
00139 void MPI_apply_op(
00140 MPI_Comm comm
00141 ,const RTOpT<Scalar> &op
00142 ,const int root_rank
00143 ,const int num_cols
00144 ,const int num_multi_vecs
00145 ,const ConstSubMultiVectorView<Scalar> sub_multi_vecs[]
00146 ,const int num_targ_multi_vecs
00147 ,const SubMultiVectorView<Scalar> targ_sub_multi_vecs[]
00148 ,ReductTarget*const reduct_objs[]
00149 );
00150
00171 template<class Scalar>
00172 void MPI_all_reduce(
00173 MPI_Comm comm
00174 ,const RTOpT<Scalar> &op
00175 ,const int root_rank
00176 ,const int num_cols
00177 ,const ReductTarget*const i_reduct_objs[]
00178 ,ReductTarget*const reduct_objs[]
00179 );
00180
00188 template<class Scalar>
00189 void MPI_apply_op(
00190 MPI_Comm comm
00191 ,const RTOpT<Scalar> &op
00192 ,const int root_rank
00193 ,const int num_cols
00194 ,const int num_vecs
00195 ,const ConstSubVectorView<Scalar> sub_vecs[]
00196 ,const int num_targ_vecs
00197 ,const SubVectorView<Scalar> sub_targ_vecs[]
00198 ,ReductTarget*const reduct_objs[]
00199 );
00200
00201 }
00202
00203 #endif // RTOPPACK_MPI_APPLY_OP_DECL_HPP