|
EpetraExt Development
|
00001 //@HEADER 00002 // *********************************************************************** 00003 // 00004 // EpetraExt: Epetra Extended - Linear Algebra Services Package 00005 // Copyright (2011) Sandia Corporation 00006 // 00007 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation, 00008 // the U.S. Government retains certain rights in this software. 00009 // 00010 // Redistribution and use in source and binary forms, with or without 00011 // modification, are permitted provided that the following conditions are 00012 // met: 00013 // 00014 // 1. Redistributions of source code must retain the above copyright 00015 // notice, this list of conditions and the following disclaimer. 00016 // 00017 // 2. Redistributions in binary form must reproduce the above copyright 00018 // notice, this list of conditions and the following disclaimer in the 00019 // documentation and/or other materials provided with the distribution. 00020 // 00021 // 3. Neither the name of the Corporation nor the names of the 00022 // contributors may be used to endorse or promote products derived from 00023 // this software without specific prior written permission. 00024 // 00025 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY 00026 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00027 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00028 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE 00029 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00030 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00031 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 00032 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 00033 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 00034 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 00035 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00036 // 00037 // Questions? Contact Michael A. Heroux (maherou@sandia.gov) 00038 // 00039 // *********************************************************************** 00040 //@HEADER 00041 00042 #ifndef ZOLTAN_LOADBALANCE_H_ 00043 #define ZOLTAN_LOADBALANCE_H_ 00044 00045 #include <EpetraExt_ConfigDefs.h> 00046 00047 #include <zoltan.h> 00048 00049 #include <string> 00050 00051 namespace Zoltan { 00052 00053 class QueryObject; 00054 class MigrationObject; 00055 00057 00065 class EPETRAEXT_DEPRECATED LoadBalance 00066 { 00067 00068 public: 00069 00071 00073 00075 LoadBalance ( int argc = 0, 00076 char ** argv = 0, 00077 float * ver = 0 ); 00078 00080 ~LoadBalance(); 00081 00083 00085 00087 int Create( MPI_Comm communicator ); 00088 00090 int Set_QueryObject( QueryObject * query_obj_ptr ); 00091 00093 int Set_MigrationObject( MigrationObject * migration_obj_ptr ); 00094 00096 int Set_Param( const std::string & param, const std::string & value ); 00097 00099 int Balance ( int * changes, 00100 int * num_gid_entries, 00101 int * num_lid_entries, 00102 int * num_import, 00103 ZOLTAN_ID_PTR * import_global_ids, 00104 ZOLTAN_ID_PTR * import_local_ids, 00105 int ** import_procs, 00106 int * num_export, 00107 ZOLTAN_ID_PTR * export_global_ids, 00108 ZOLTAN_ID_PTR * export_local_ids, 00109 int ** export_procs ); 00110 00111 #ifdef ZOLTAN_ORDER 00112 int Order ( int * num_gid_entries, 00113 int * num_lid_entries, 00114 int num_objs, 00115 ZOLTAN_ID_PTR global_ids, 00116 ZOLTAN_ID_PTR local_ids, 00117 int * rank, 00118 int * iperm ); 00119 #endif 00120 00122 void Evaluate( int print_stats, 00123 int * num_objects, 00124 float * object_weights, 00125 int * num_cut, 00126 float * cut_weights, 00127 int * num_boundary_objects, 00128 int * num_adj_procs ); 00129 00131 int Free_Data( ZOLTAN_ID_PTR * import_global_ids, 00132 ZOLTAN_ID_PTR * import_local_ids, 00133 int ** import_procs, 00134 ZOLTAN_ID_PTR * export_global_ids, 00135 ZOLTAN_ID_PTR * export_local_ids, 00136 int ** export_procs ); 00137 00139 00141 00142 #ifdef ZOLTAN_OLD_CALLBACK 00143 00145 int Set_CallBack_Fn ( ZOLTAN_FN_TYPE fn_type, 00146 void * fn_ptr, 00147 void * data = 0 ); 00148 00149 #else /* ZOLTAN_OLD_CALLBACK */ 00150 00152 00154 int Set_Num_Edges_Fn ( ZOLTAN_NUM_EDGES_FN * fn_ptr, 00155 void * data = 0 ); 00157 int Set_Edge_List_Fn ( ZOLTAN_EDGE_LIST_FN * fn_ptr, 00158 void * data = 0 ); 00160 int Set_Num_Geom_Fn ( ZOLTAN_NUM_GEOM_FN * fn_ptr, 00161 void * data = 0 ); 00163 int Set_Geom_Fn ( ZOLTAN_GEOM_FN * fn_ptr, 00164 void * data = 0 ); 00166 int Set_Num_Obj_Fn ( ZOLTAN_NUM_OBJ_FN * fn_ptr, 00167 void * data = 0 ); 00169 int Set_Obj_List_Fn ( ZOLTAN_OBJ_LIST_FN * fn_ptr, 00170 void * data = 0 ); 00172 int Set_First_Obj_Fn ( ZOLTAN_FIRST_OBJ_FN * fn_ptr, 00173 void * data = 0 ); 00175 int Set_Next_Obj_Fn ( ZOLTAN_NEXT_OBJ_FN * fn_ptr, 00176 void * data = 0 ); 00178 int Set_Num_Border_Obj_Fn ( ZOLTAN_NUM_BORDER_OBJ_FN * fn_ptr, 00179 void * data = 0 ); 00181 int Set_Border_Obj_List_Fn ( ZOLTAN_BORDER_OBJ_LIST_FN * fn_ptr, 00182 void * data = 0 ); 00184 int Set_First_Border_Obj_Fn ( ZOLTAN_FIRST_BORDER_OBJ_FN * fn_ptr, 00185 void * data = 0 ); 00187 int Set_Next_Border_Obj_Fn ( ZOLTAN_NEXT_BORDER_OBJ_FN * fn_ptr, 00188 void * data = 0 ); 00190 int Set_Num_Coarse_Obj_Fn ( ZOLTAN_NUM_COARSE_OBJ_FN * fn_ptr, 00191 void * data = 0 ); 00193 int Set_Coarse_Obj_List_Fn ( ZOLTAN_COARSE_OBJ_LIST_FN * fn_ptr, 00194 void * data = 0 ); 00196 int Set_First_Coarse_Obj_Fn ( ZOLTAN_FIRST_COARSE_OBJ_FN * fn_ptr, 00197 void * data = 0 ); 00199 int Set_Next_Coarse_Obj_Fn ( ZOLTAN_NEXT_COARSE_OBJ_FN * fn_ptr, 00200 void * data = 0 ); 00202 int Set_Num_Child_Fn ( ZOLTAN_NUM_CHILD_FN * fn_ptr, 00203 void * data = 0 ); 00205 int Set_Child_List_Fn ( ZOLTAN_CHILD_LIST_FN * fn_ptr, 00206 void * data = 0 ); 00208 int Set_Child_Weight_Fn ( ZOLTAN_CHILD_WEIGHT_FN * fn_ptr, 00209 void * data = 0 ); 00211 int Set_Pre_Migrate_Fn ( ZOLTAN_PRE_MIGRATE_FN * fn_ptr, 00212 void * data = 0 ); 00214 int Set_Mid_Migrate_Fn ( ZOLTAN_MID_MIGRATE_FN * fn_ptr, 00215 void * data = 0 ); 00217 int Set_Post_Migrate_Fn ( ZOLTAN_POST_MIGRATE_FN * fn_ptr, 00218 void * data = 0 ); 00220 int Set_Obj_Size_Fn ( ZOLTAN_OBJ_SIZE_FN * fn_ptr, 00221 void * data = 0 ); 00223 int Set_Pack_Obj_Fn ( ZOLTAN_PACK_OBJ_FN * fn_ptr, 00224 void * data = 0 ); 00226 int Set_Unpack_Obj_Fn ( ZOLTAN_UNPACK_OBJ_FN * fn_ptr, 00227 void * data = 0 ); 00228 00229 #endif /* ZOLTAN_OLD_CALLBACK */ 00230 00232 00234 00236 int Point_Assign ( double * coords, 00237 int * proc ); 00238 00240 int Box_Assign ( double xmin, 00241 double ymin, 00242 double zmin, 00243 double xmax, 00244 double ymax, 00245 double zmax, 00246 int * procs, 00247 int * numprocs ); 00248 00250 00252 00254 int Compute_Destinations ( int num_import, 00255 ZOLTAN_ID_PTR import_global_ids, 00256 ZOLTAN_ID_PTR import_local_ids, 00257 int * import_procs, 00258 int * num_export, 00259 ZOLTAN_ID_PTR * export_global_ids, 00260 ZOLTAN_ID_PTR * export_local_ids, 00261 int ** export_procs ); 00262 00264 int Help_Migrate ( int num_import, 00265 ZOLTAN_ID_PTR import_global_ids, 00266 ZOLTAN_ID_PTR import_local_ids, 00267 int * import_procs, 00268 int num_export, 00269 ZOLTAN_ID_PTR export_global_ids, 00270 ZOLTAN_ID_PTR export_local_ids, 00271 int * export_procs ); 00272 00274 00276 00278 Zoltan_Struct * Return_Zoltan_Struct() 00279 { return LoadBalance_Ptr_; } 00280 00282 00283 private: 00284 00285 static int ObjectCount; 00286 00287 int ObjectID; 00288 00289 Zoltan_Struct * LoadBalance_Ptr_; 00290 00291 QueryObject * QueryObject_Ptr_; 00292 MigrationObject * MigrationObject_Ptr_; 00293 00294 }; 00295 00296 } //namespace Zoltan 00297 00298 #endif
1.7.4