EpetraExt Package Browser (Single Doxygen Collection) Development
Zoltan_LoadBalance.h
Go to the documentation of this file.
00001 // @HEADER
00002 // ************************************************************************
00003 // 
00004 //            Zoltan_CPP: An Object-Oriented Interface To Zoltan
00005 //                    Copyright (2001) Sandia Corporation
00006 // 
00007 // Questions? Contact Robert J. Hoekstra (rjhoeks@sandia.gov)
00008 // 
00009 // ************************************************************************
00010 // @HEADER
00011 
00012 #ifndef ZOLTAN_LOADBALANCE_H_
00013 #define ZOLTAN_LOADBALANCE_H_
00014 
00015 #include <EpetraExt_ConfigDefs.h>
00016 
00017 #include <zoltan.h>
00018 
00019 #include <string>
00020 
00021 namespace Zoltan {
00022 
00023 class QueryObject;
00024 class MigrationObject;
00025 
00027 
00035 class LoadBalance
00036 {
00037 
00038 public:
00039 
00041 
00043 
00045  LoadBalance   ( int argc = 0,
00046                  char ** argv = 0,
00047                  float * ver = 0 );
00048 
00050  ~LoadBalance();
00051 
00053 
00055  
00057  int Create( MPI_Comm communicator );
00058 
00060  int Set_QueryObject( QueryObject * query_obj_ptr );
00061 
00063  int Set_MigrationObject( MigrationObject * migration_obj_ptr );
00064 
00066  int Set_Param( const std::string & param, const std::string & value );
00067 
00069  int Balance  ( int * changes,
00070                 int * num_gid_entries,
00071                 int * num_lid_entries,
00072     int * num_import,
00073     ZOLTAN_ID_PTR * import_global_ids,
00074     ZOLTAN_ID_PTR * import_local_ids,
00075     int ** import_procs,
00076     int * num_export,
00077     ZOLTAN_ID_PTR * export_global_ids,
00078     ZOLTAN_ID_PTR * export_local_ids,
00079     int ** export_procs );
00080 
00081 #ifdef ZOLTAN_ORDER
00082  int Order    ( int * num_gid_entries,
00083                 int * num_lid_entries,
00084                 int num_objs,
00085     ZOLTAN_ID_PTR global_ids,
00086     ZOLTAN_ID_PTR local_ids,
00087                 int * rank,
00088                 int * iperm );
00089 #endif
00090 
00092  void Evaluate( int print_stats,
00093     int * num_objects,
00094     float * object_weights,
00095         int * num_cut,
00096         float * cut_weights,
00097     int * num_boundary_objects,
00098     int * num_adj_procs );
00099 
00101  int Free_Data( ZOLTAN_ID_PTR * import_global_ids,
00102     ZOLTAN_ID_PTR * import_local_ids,
00103     int ** import_procs,
00104     ZOLTAN_ID_PTR * export_global_ids,
00105     ZOLTAN_ID_PTR * export_local_ids,
00106     int ** export_procs );
00107 
00109 
00111 
00112 #ifdef ZOLTAN_OLD_CALLBACK
00113 
00115  int Set_CallBack_Fn  ( ZOLTAN_FN_TYPE fn_type,
00116       void * fn_ptr,
00117       void * data = 0 );
00118 
00119 #else /* ZOLTAN_OLD_CALLBACK */
00120 
00122 
00124  int Set_Num_Edges_Fn        ( ZOLTAN_NUM_EDGES_FN * fn_ptr,
00125                               void * data = 0 );
00127  int Set_Edge_List_Fn        ( ZOLTAN_EDGE_LIST_FN * fn_ptr,
00128                               void * data = 0 );
00130  int Set_Num_Geom_Fn         ( ZOLTAN_NUM_GEOM_FN * fn_ptr,
00131                               void * data = 0 );
00133  int Set_Geom_Fn             ( ZOLTAN_GEOM_FN * fn_ptr,
00134                               void * data = 0 );
00136  int Set_Num_Obj_Fn          ( ZOLTAN_NUM_OBJ_FN * fn_ptr,
00137                               void * data = 0 );
00139  int Set_Obj_List_Fn         ( ZOLTAN_OBJ_LIST_FN * fn_ptr,
00140                               void * data = 0 );
00142  int Set_First_Obj_Fn        ( ZOLTAN_FIRST_OBJ_FN * fn_ptr,
00143                               void * data = 0 );
00145  int Set_Next_Obj_Fn         ( ZOLTAN_NEXT_OBJ_FN * fn_ptr,
00146                               void * data = 0 );
00148  int Set_Num_Border_Obj_Fn   ( ZOLTAN_NUM_BORDER_OBJ_FN * fn_ptr,
00149                               void * data = 0 );
00151  int Set_Border_Obj_List_Fn  ( ZOLTAN_BORDER_OBJ_LIST_FN * fn_ptr,
00152                               void * data = 0 );
00154  int Set_First_Border_Obj_Fn ( ZOLTAN_FIRST_BORDER_OBJ_FN * fn_ptr,
00155                               void * data = 0 );
00157  int Set_Next_Border_Obj_Fn  ( ZOLTAN_NEXT_BORDER_OBJ_FN * fn_ptr,
00158                               void * data = 0 );
00160  int Set_Num_Coarse_Obj_Fn   ( ZOLTAN_NUM_COARSE_OBJ_FN * fn_ptr,
00161                               void * data = 0 );
00163  int Set_Coarse_Obj_List_Fn  ( ZOLTAN_COARSE_OBJ_LIST_FN * fn_ptr,
00164                               void * data = 0 );
00166  int Set_First_Coarse_Obj_Fn ( ZOLTAN_FIRST_COARSE_OBJ_FN * fn_ptr,
00167                               void * data = 0 );
00169  int Set_Next_Coarse_Obj_Fn  ( ZOLTAN_NEXT_COARSE_OBJ_FN * fn_ptr,
00170                               void * data = 0 );
00172  int Set_Num_Child_Fn        ( ZOLTAN_NUM_CHILD_FN * fn_ptr,
00173                               void * data = 0 );
00175  int Set_Child_List_Fn       ( ZOLTAN_CHILD_LIST_FN * fn_ptr,
00176                               void * data = 0 );
00178  int Set_Child_Weight_Fn     ( ZOLTAN_CHILD_WEIGHT_FN * fn_ptr,
00179                               void * data = 0 );
00181  int Set_Pre_Migrate_Fn      ( ZOLTAN_PRE_MIGRATE_FN * fn_ptr,
00182                               void * data = 0 );
00184  int Set_Mid_Migrate_Fn      ( ZOLTAN_MID_MIGRATE_FN * fn_ptr,
00185                               void * data = 0 );
00187  int Set_Post_Migrate_Fn     ( ZOLTAN_POST_MIGRATE_FN * fn_ptr,
00188                               void * data = 0 );
00190  int Set_Obj_Size_Fn         ( ZOLTAN_OBJ_SIZE_FN * fn_ptr,
00191                               void * data = 0 );
00193  int Set_Pack_Obj_Fn         ( ZOLTAN_PACK_OBJ_FN * fn_ptr,
00194                               void * data = 0 );
00196  int Set_Unpack_Obj_Fn       ( ZOLTAN_UNPACK_OBJ_FN * fn_ptr,
00197                               void * data = 0 );
00198 
00199 #endif /* ZOLTAN_OLD_CALLBACK */
00200 
00202 
00204 
00206  int Point_Assign     ( double * coords,
00207       int * proc );
00208 
00210  int Box_Assign       ( double xmin,
00211       double ymin,
00212       double zmin,
00213       double xmax,
00214       double ymax,
00215       double zmax,
00216       int * procs,
00217       int * numprocs );
00218 
00220  
00222 
00224  int Compute_Destinations     ( int num_import,
00225         ZOLTAN_ID_PTR import_global_ids,
00226         ZOLTAN_ID_PTR import_local_ids,
00227         int * import_procs,
00228         int * num_export,
00229         ZOLTAN_ID_PTR * export_global_ids,
00230         ZOLTAN_ID_PTR * export_local_ids,
00231         int ** export_procs );
00232 
00234  int Help_Migrate     ( int num_import,
00235       ZOLTAN_ID_PTR import_global_ids,
00236       ZOLTAN_ID_PTR import_local_ids,
00237       int * import_procs,
00238       int num_export,
00239       ZOLTAN_ID_PTR export_global_ids,
00240       ZOLTAN_ID_PTR export_local_ids,
00241       int * export_procs );
00242 
00244 
00246  
00248  Zoltan_Struct * Return_Zoltan_Struct()
00249  { return LoadBalance_Ptr_; }
00250 
00252 
00253 private:
00254 
00255  static int ObjectCount;
00256 
00257  int ObjectID;
00258 
00259  Zoltan_Struct * LoadBalance_Ptr_; 
00260 
00261  QueryObject * QueryObject_Ptr_;
00262  MigrationObject * MigrationObject_Ptr_;
00263 
00264 };
00265 
00266 } //namespace Zoltan
00267 
00268 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines