EpetraExt Development
Zoltan_LoadBalance.cpp
Go to the documentation of this file.
00001 /*
00002 //@HEADER
00003 // ***********************************************************************
00004 //
00005 //     EpetraExt: Epetra Extended - Linear Algebra Services Package
00006 //                 Copyright (2011) Sandia Corporation
00007 //
00008 // Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
00009 // the U.S. Government retains certain rights in this software.
00010 //
00011 // Redistribution and use in source and binary forms, with or without
00012 // modification, are permitted provided that the following conditions are
00013 // met:
00014 //
00015 // 1. Redistributions of source code must retain the above copyright
00016 // notice, this list of conditions and the following disclaimer.
00017 //
00018 // 2. Redistributions in binary form must reproduce the above copyright
00019 // notice, this list of conditions and the following disclaimer in the
00020 // documentation and/or other materials provided with the distribution.
00021 //
00022 // 3. Neither the name of the Corporation nor the names of the
00023 // contributors may be used to endorse or promote products derived from
00024 // this software without specific prior written permission.
00025 //
00026 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
00027 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00028 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00029 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
00030 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00031 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00032 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00033 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00034 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00035 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00036 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00037 //
00038 // Questions? Contact Michael A. Heroux (maherou@sandia.gov)
00039 //
00040 // ***********************************************************************
00041 //@HEADER
00042 */
00043 
00044 //-------------------------------------------------------------------------
00045 // Copyright Notice
00046 //
00047 // Copyright (c) 2000, Sandia Corporation, Albuquerque, NM.
00048 //-------------------------------------------------------------------------
00049 
00050 //-------------------------------------------------------------------------
00051 // Filename       : $Zoltan_LoadBalance.C$
00052 //
00053 // Purpose        : C++ wrapper object for Zoltan Load Balance Routines.
00054 //
00055 // Special Notes  :
00056 //
00057 // Creator        : Robert J. Hoekstra, Parallel Computational Sciences
00058 //
00059 // Creation Date  : 08/04/2000
00060 //
00061 // Revision Information:
00062 // ---------------------
00063 //
00064 // Revision Number: $$
00065 //
00066 // Revision Date  : $$
00067 //
00068 // Current Owner  : $$
00069 //-------------------------------------------------------------------------
00070 
00071 #include <Zoltan_LoadBalance.h>
00072 #include <Zoltan_QueryContainer.h>
00073 #include <Zoltan_QueryFunctions.h>
00074 #include <Zoltan_MigrationContainer.h>
00075 #include <Zoltan_MigrationFunctions.h>
00076 
00077 int Zoltan::LoadBalance::ObjectCount = 0;
00078 
00079 EPETRAEXT_DEPRECATED
00080 Zoltan::LoadBalance::LoadBalance( int argc,
00081                                   char ** argv,
00082                                   float * ver )
00083   : ObjectID( 0 ),
00084     LoadBalance_Ptr_( 0 ),
00085     QueryObject_Ptr_( 0 ),
00086     MigrationObject_Ptr_( 0 )
00087 {
00088   ObjectID = ObjectCount++;
00089 
00090   int tmpReturn = Zoltan_Initialize( argc, argv, ver );
00091 }
00092 
00093 EPETRAEXT_DEPRECATED
00094 Zoltan::LoadBalance::~LoadBalance()
00095 {
00096   Zoltan_Destroy( &LoadBalance_Ptr_ );
00097 }
00098 
00099  //Load Balance Calls
00100 EPETRAEXT_DEPRECATED
00101 int Zoltan::LoadBalance::Create( MPI_Comm communicator )
00102 {
00103   LoadBalance_Ptr_ = Zoltan_Create( communicator );
00104 
00105   if( !LoadBalance_Ptr_ )
00106     return ZOLTAN_FATAL;
00107   else
00108     return ZOLTAN_OK;
00109 }
00110 
00111 #ifdef ZOLTAN_OLD_CALLBACK
00112 
00113 //Old callback support
00114 //--------------------------------
00115 
00116 EPETRAEXT_DEPRECATED
00117 int Zoltan::LoadBalance::Set_CallBack_Fn       ( ZOLTAN_FN_TYPE fn_type,
00118              void * fn_ptr,
00119              void * data )
00120 {
00121   return Zoltan_Set_Fn( LoadBalance_Ptr_, fn_type, fn_ptr, data );
00122 }
00123 
00124 #else /* ZOLTAN_OLD_CALLBACK */
00125 
00126 //Individual callback registration
00127 //--------------------------------
00128 
00129 EPETRAEXT_DEPRECATED
00130 int Zoltan::LoadBalance::Set_Num_Edges_Fn      ( ZOLTAN_NUM_EDGES_FN * fn_ptr,
00131              void * data )
00132 {
00133   return Zoltan_Set_Num_Edges_Fn( LoadBalance_Ptr_, fn_ptr, data );
00134 }
00135 
00136 EPETRAEXT_DEPRECATED
00137 int Zoltan::LoadBalance::Set_Edge_List_Fn      (  ZOLTAN_EDGE_LIST_FN * fn_ptr,
00138             void * data )
00139 {
00140   return Zoltan_Set_Edge_List_Fn( LoadBalance_Ptr_, fn_ptr, data );
00141 }
00142 
00143 EPETRAEXT_DEPRECATED
00144 int Zoltan::LoadBalance::Set_Num_Geom_Fn      ( ZOLTAN_NUM_GEOM_FN * fn_ptr,
00145             void * data )
00146 {
00147   return Zoltan_Set_Num_Geom_Fn( LoadBalance_Ptr_, fn_ptr, data );
00148 }
00149 
00150 EPETRAEXT_DEPRECATED
00151 int Zoltan::LoadBalance::Set_Geom_Fn      ( ZOLTAN_GEOM_FN * fn_ptr,
00152             void * data )
00153 {
00154   return Zoltan_Set_Geom_Fn( LoadBalance_Ptr_, fn_ptr, data );
00155 }
00156 
00157 EPETRAEXT_DEPRECATED
00158 int Zoltan::LoadBalance::Set_Num_Obj_Fn      (  ZOLTAN_NUM_OBJ_FN * fn_ptr,
00159             void * data )
00160 {
00161   return Zoltan_Set_Num_Obj_Fn( LoadBalance_Ptr_, fn_ptr, data );
00162 }
00163 
00164 EPETRAEXT_DEPRECATED
00165 int Zoltan::LoadBalance::Set_Obj_List_Fn      ( ZOLTAN_OBJ_LIST_FN * fn_ptr,
00166             void * data )
00167 {
00168   return Zoltan_Set_Obj_List_Fn( LoadBalance_Ptr_, fn_ptr, data );
00169 }
00170 
00171 EPETRAEXT_DEPRECATED
00172 int Zoltan::LoadBalance::Set_First_Obj_Fn      (  ZOLTAN_FIRST_OBJ_FN * fn_ptr,
00173             void * data )
00174 {
00175   return Zoltan_Set_First_Obj_Fn( LoadBalance_Ptr_, fn_ptr, data );
00176 }
00177 
00178 EPETRAEXT_DEPRECATED
00179 int Zoltan::LoadBalance::Set_Next_Obj_Fn      ( ZOLTAN_NEXT_OBJ_FN * fn_ptr,
00180             void * data )
00181 {
00182   return Zoltan_Set_Next_Obj_Fn( LoadBalance_Ptr_, fn_ptr, data );
00183 }
00184 
00185 EPETRAEXT_DEPRECATED
00186 int Zoltan::LoadBalance::Set_Num_Border_Obj_Fn (  ZOLTAN_NUM_BORDER_OBJ_FN * fn_ptr,
00187             void * data )
00188 {
00189   return Zoltan_Set_Num_Border_Obj_Fn( LoadBalance_Ptr_, fn_ptr, data );
00190 }
00191 
00192 EPETRAEXT_DEPRECATED
00193 int Zoltan::LoadBalance::Set_Border_Obj_List_Fn ( ZOLTAN_BORDER_OBJ_LIST_FN * fn_ptr,
00194             void * data )
00195 {
00196   return Zoltan_Set_Border_Obj_List_Fn( LoadBalance_Ptr_, fn_ptr, data );
00197 }
00198 
00199 EPETRAEXT_DEPRECATED
00200 int Zoltan::LoadBalance::Set_First_Border_Obj_Fn ( ZOLTAN_FIRST_BORDER_OBJ_FN * fn_ptr,
00201             void * data )
00202 {
00203   return Zoltan_Set_First_Border_Obj_Fn( LoadBalance_Ptr_, fn_ptr, data );
00204 }
00205 
00206 EPETRAEXT_DEPRECATED
00207 int Zoltan::LoadBalance::Set_Next_Border_Obj_Fn ( ZOLTAN_NEXT_BORDER_OBJ_FN * fn_ptr,
00208             void * data )
00209 {
00210   return Zoltan_Set_Next_Border_Obj_Fn( LoadBalance_Ptr_, fn_ptr, data );
00211 }
00212 
00213 EPETRAEXT_DEPRECATED
00214 int Zoltan::LoadBalance::Set_Num_Coarse_Obj_Fn (  ZOLTAN_NUM_COARSE_OBJ_FN * fn_ptr,
00215             void * data )
00216 {
00217   return Zoltan_Set_Num_Coarse_Obj_Fn( LoadBalance_Ptr_, fn_ptr, data );
00218 }
00219 
00220 EPETRAEXT_DEPRECATED
00221 int Zoltan::LoadBalance::Set_Coarse_Obj_List_Fn ( ZOLTAN_COARSE_OBJ_LIST_FN * fn_ptr,
00222             void * data )
00223 {
00224   return Zoltan_Set_Coarse_Obj_List_Fn( LoadBalance_Ptr_, fn_ptr, data );
00225 }
00226 
00227 EPETRAEXT_DEPRECATED
00228 int Zoltan::LoadBalance::Set_First_Coarse_Obj_Fn ( ZOLTAN_FIRST_COARSE_OBJ_FN * fn_ptr,
00229             void * data )
00230 {
00231   return Zoltan_Set_First_Coarse_Obj_Fn( LoadBalance_Ptr_, fn_ptr, data );
00232 }
00233 
00234 EPETRAEXT_DEPRECATED
00235 int Zoltan::LoadBalance::Set_Next_Coarse_Obj_Fn ( ZOLTAN_NEXT_COARSE_OBJ_FN * fn_ptr,
00236             void * data )
00237 {
00238   return Zoltan_Set_Next_Coarse_Obj_Fn( LoadBalance_Ptr_, fn_ptr, data );
00239 }
00240 
00241 EPETRAEXT_DEPRECATED
00242 int Zoltan::LoadBalance::Set_Num_Child_Fn      (  ZOLTAN_NUM_CHILD_FN * fn_ptr,
00243             void * data )
00244 {
00245   return Zoltan_Set_Num_Child_Fn( LoadBalance_Ptr_, fn_ptr, data );
00246 }
00247 
00248 EPETRAEXT_DEPRECATED
00249 int Zoltan::LoadBalance::Set_Child_List_Fn ( ZOLTAN_CHILD_LIST_FN * fn_ptr,
00250             void * data )
00251 {
00252   return Zoltan_Set_Child_List_Fn( LoadBalance_Ptr_, fn_ptr, data );
00253 }
00254 
00255 EPETRAEXT_DEPRECATED
00256 int Zoltan::LoadBalance::Set_Child_Weight_Fn ( ZOLTAN_CHILD_WEIGHT_FN * fn_ptr,
00257             void * data )
00258 {
00259   return Zoltan_Set_Child_Weight_Fn( LoadBalance_Ptr_, fn_ptr, data );
00260 }
00261 
00262 EPETRAEXT_DEPRECATED
00263 int Zoltan::LoadBalance::Set_Pre_Migrate_Fn    (  ZOLTAN_PRE_MIGRATE_FN * fn_ptr,
00264             void * data )
00265 {
00266   return Zoltan_Set_Pre_Migrate_Fn( LoadBalance_Ptr_, fn_ptr, data );
00267 }
00268 
00269 EPETRAEXT_DEPRECATED
00270 int Zoltan::LoadBalance::Set_Mid_Migrate_Fn    (  ZOLTAN_MID_MIGRATE_FN * fn_ptr,
00271             void * data )
00272 {
00273   return Zoltan_Set_Mid_Migrate_Fn( LoadBalance_Ptr_, fn_ptr, data );
00274 }
00275 
00276 EPETRAEXT_DEPRECATED
00277 int Zoltan::LoadBalance::Set_Post_Migrate_Fn   (  ZOLTAN_POST_MIGRATE_FN * fn_ptr,
00278             void * data )
00279 {
00280   return Zoltan_Set_Post_Migrate_Fn( LoadBalance_Ptr_, fn_ptr, data );
00281 }
00282 
00283 EPETRAEXT_DEPRECATED
00284 int Zoltan::LoadBalance::Set_Obj_Size_Fn       (  ZOLTAN_OBJ_SIZE_FN * fn_ptr,
00285             void * data )
00286 {
00287   return Zoltan_Set_Obj_Size_Fn( LoadBalance_Ptr_, fn_ptr, data );
00288 }
00289 
00290 EPETRAEXT_DEPRECATED
00291 int Zoltan::LoadBalance::Set_Pack_Obj_Fn       (  ZOLTAN_PACK_OBJ_FN * fn_ptr,
00292             void * data )
00293 {
00294   return Zoltan_Set_Pack_Obj_Fn( LoadBalance_Ptr_, fn_ptr, data );
00295 }
00296 
00297 EPETRAEXT_DEPRECATED
00298 int Zoltan::LoadBalance::Set_Unpack_Obj_Fn     (  ZOLTAN_UNPACK_OBJ_FN * fn_ptr,
00299             void * data )
00300 {
00301   return Zoltan_Set_Unpack_Obj_Fn( LoadBalance_Ptr_, fn_ptr, data );
00302 }
00303 
00304 #endif /* ZOLTAN_OLD_CALLBACK */
00305 
00306 EPETRAEXT_DEPRECATED
00307 int Zoltan::LoadBalance::Set_QueryObject( Zoltan::QueryObject * query_obj_ptr )
00308 {
00309   Zoltan::QueryContainer::registerQueryObject( ObjectID, query_obj_ptr );
00310 
00311 #ifdef ZOLTAN_OLD_CALLBACK
00312 
00313   //LB_Set_Fn all Cstyle Functions
00314   Set_CallBack_Fn( ZOLTAN_NUM_EDGES_FN_TYPE,
00315   reinterpret_cast<void *> (Zoltan::QueryFunctions::Number_Edges),
00316   0 );
00317   Set_CallBack_Fn( ZOLTAN_EDGE_LIST_FN_TYPE,
00318   reinterpret_cast<void *> (Zoltan::QueryFunctions::Edge_List),
00319   0 );
00320   Set_CallBack_Fn( ZOLTAN_NUM_GEOM_FN_TYPE,
00321     reinterpret_cast<void *> (Zoltan::QueryFunctions::Number_Geometry_Objects),
00322   0 );
00323   Set_CallBack_Fn( ZOLTAN_GEOM_FN_TYPE,
00324   reinterpret_cast<void *> (Zoltan::QueryFunctions::Geometry_Values),
00325   0 );
00326   Set_CallBack_Fn( ZOLTAN_NUM_OBJ_FN_TYPE, 
00327   reinterpret_cast<void *> (Zoltan::QueryFunctions::Number_Objects),
00328   0 );
00329   Set_CallBack_Fn( ZOLTAN_OBJ_LIST_FN_TYPE,
00330   reinterpret_cast<void *> (Zoltan::QueryFunctions::Object_List),
00331   0 );
00332   Set_CallBack_Fn( ZOLTAN_FIRST_OBJ_FN_TYPE,
00333   reinterpret_cast<void *> (Zoltan::QueryFunctions::First_Object),
00334   0 );
00335   Set_CallBack_Fn( ZOLTAN_NEXT_OBJ_FN_TYPE,
00336   reinterpret_cast<void *> (Zoltan::QueryFunctions::Next_Object),
00337   0 );
00338   Set_CallBack_Fn( ZOLTAN_NUM_BORDER_OBJ_FN_TYPE,
00339   reinterpret_cast<void *> (Zoltan::QueryFunctions::Number_Border_Objects),
00340   0 );
00341   Set_CallBack_Fn( ZOLTAN_BORDER_OBJ_LIST_FN_TYPE,
00342   reinterpret_cast<void *> (Zoltan::QueryFunctions::Border_Object_List),
00343   0 );
00344   Set_CallBack_Fn( ZOLTAN_FIRST_BORDER_OBJ_FN_TYPE,
00345   reinterpret_cast<void *> (Zoltan::QueryFunctions::First_Border_Object),
00346   0 );
00347   Set_CallBack_Fn( ZOLTAN_NEXT_BORDER_OBJ_FN_TYPE,
00348   reinterpret_cast<void *> (Zoltan::QueryFunctions::Next_Border_Object),
00349   0 );
00350   Set_CallBack_Fn( ZOLTAN_NUM_COARSE_OBJ_FN_TYPE,
00351   reinterpret_cast<void *> (Zoltan::QueryFunctions::Number_Coarse_Objects),
00352   0 );
00353   Set_CallBack_Fn( ZOLTAN_COARSE_OBJ_LIST_FN_TYPE,
00354   reinterpret_cast<void *> (Zoltan::QueryFunctions::Coarse_Object_List),
00355   0 );
00356   Set_CallBack_Fn( ZOLTAN_FIRST_COARSE_OBJ_FN_TYPE,
00357   reinterpret_cast<void *> (Zoltan::QueryFunctions::First_Coarse_Object),
00358   0 );
00359   Set_CallBack_Fn( ZOLTAN_NEXT_COARSE_OBJ_FN_TYPE,
00360   reinterpret_cast<void *> (Zoltan::QueryFunctions::Next_Coarse_Object),
00361   0 );
00362   Set_CallBack_Fn( ZOLTAN_NUM_CHILD_FN_TYPE,
00363   reinterpret_cast<void *> (Zoltan::QueryFunctions::Number_Children),
00364   0 );
00365   Set_CallBack_Fn( ZOLTAN_CHILD_LIST_FN_TYPE,
00366   reinterpret_cast<void *> (Zoltan::QueryFunctions::Child_List),
00367   0 );
00368   Set_CallBack_Fn( ZOLTAN_CHILD_WEIGHT_FN_TYPE,
00369   reinterpret_cast<void *> (Zoltan::QueryFunctions::Child_Weight),
00370   0 );
00371 
00372 #else /* ZOLTAN_OLD_CALLBACK */
00373 
00374   Set_Num_Edges_Fn        ( Zoltan::QueryFunctions::Number_Edges,
00375                             0 );
00376   Set_Edge_List_Fn        ( Zoltan::QueryFunctions::Edge_List,
00377                             0 );
00378   Set_Num_Geom_Fn         ( Zoltan::QueryFunctions::Number_Geometry_Objects,
00379                             0 );
00380   Set_Geom_Fn             ( Zoltan::QueryFunctions::Geometry_Values,
00381                             0 );
00382   Set_Num_Obj_Fn          ( Zoltan::QueryFunctions::Number_Objects,
00383                             0 );
00384   Set_Obj_List_Fn         ( Zoltan::QueryFunctions::Object_List,
00385                             0 );
00386   Set_First_Obj_Fn        ( Zoltan::QueryFunctions::First_Object,
00387                             0 );
00388   Set_Next_Obj_Fn         ( Zoltan::QueryFunctions::Next_Object,
00389                             0 );
00390   Set_Num_Border_Obj_Fn   ( Zoltan::QueryFunctions::Number_Border_Objects,
00391                             0 );
00392   Set_Border_Obj_List_Fn  ( Zoltan::QueryFunctions::Border_Object_List,
00393                             0 );
00394   Set_First_Border_Obj_Fn ( Zoltan::QueryFunctions::First_Border_Object,
00395                             0 );
00396   Set_Next_Border_Obj_Fn  ( Zoltan::QueryFunctions::Next_Border_Object,
00397                             0 );
00398   Set_Num_Coarse_Obj_Fn   ( Zoltan::QueryFunctions::Number_Coarse_Objects,
00399                             0 );
00400   Set_Coarse_Obj_List_Fn  ( Zoltan::QueryFunctions::Coarse_Object_List,
00401                             0 );
00402   Set_First_Coarse_Obj_Fn ( Zoltan::QueryFunctions::First_Coarse_Object,
00403                             0 );
00404   Set_Next_Coarse_Obj_Fn  ( Zoltan::QueryFunctions::Next_Coarse_Object,
00405                             0 );
00406   Set_Num_Child_Fn        ( Zoltan::QueryFunctions::Number_Children,
00407                             0 );
00408   Set_Child_List_Fn       ( Zoltan::QueryFunctions::Child_List,
00409                             0 );
00410   Set_Child_Weight_Fn     ( Zoltan::QueryFunctions::Child_Weight,
00411                             0 );
00412 
00413 #endif /* ZOLTAN_OLD_CALLBACK */
00414 
00415   return ZOLTAN_OK;
00416 }
00417 
00418 EPETRAEXT_DEPRECATED
00419 int Zoltan::LoadBalance::Set_MigrationObject( 
00420       Zoltan::MigrationObject * migration_obj_ptr )
00421 {
00422   Zoltan::MigrationContainer::registerMigrationObject( ObjectID,
00423   migration_obj_ptr );
00424 
00425 #ifdef ZOLTAN_OLD_CALLBACK
00426 
00427   //LB_Set_Fn all Cstyle Functions
00428   Set_CallBack_Fn( ZOLTAN_OBJ_SIZE_FN_TYPE,
00429   reinterpret_cast<void *> (Zoltan::MigrationFunctions::Object_Size),
00430         0 );
00431   Set_CallBack_Fn( ZOLTAN_PRE_MIGRATE_FN_TYPE,
00432   reinterpret_cast<void *> (Zoltan::MigrationFunctions::Pre_Migrate),
00433         0 );
00434   Set_CallBack_Fn( ZOLTAN_MID_MIGRATE_FN_TYPE,
00435   reinterpret_cast<void *> (Zoltan::MigrationFunctions::Mid_Migrate),
00436         0 );
00437   Set_CallBack_Fn( ZOLTAN_POST_MIGRATE_FN_TYPE,
00438   reinterpret_cast<void *> (Zoltan::MigrationFunctions::Post_Migrate),
00439         0 );
00440   Set_CallBack_Fn( ZOLTAN_PACK_OBJ_FN_TYPE,
00441   reinterpret_cast<void *> (Zoltan::MigrationFunctions::Pack_Object),
00442         0 );
00443   Set_CallBack_Fn( ZOLTAN_UNPACK_OBJ_FN_TYPE,
00444   reinterpret_cast<void *> (Zoltan::MigrationFunctions::Unpack_Object),
00445         0 );
00446 
00447 #else /* ZOLTAN_OLD_CALLBACK */
00448 
00449   Set_Obj_Size_Fn        ( Zoltan::MigrationFunctions::Object_Size, 0 );
00450   Set_Pre_Migrate_Fn     ( Zoltan::MigrationFunctions::Pre_Migrate, 0 );
00451   Set_Mid_Migrate_Fn     ( Zoltan::MigrationFunctions::Mid_Migrate, 0 );
00452   Set_Post_Migrate_Fn    ( Zoltan::MigrationFunctions::Post_Migrate, 0 );
00453   Set_Pack_Obj_Fn        ( Zoltan::MigrationFunctions::Pack_Object, 0 );
00454   Set_Unpack_Obj_Fn      ( Zoltan::MigrationFunctions::Unpack_Object, 0 );
00455 
00456 #endif /* ZOLTAN_OLD_CALLBACK */
00457 
00458   return ZOLTAN_OK;
00459 }
00460 
00461 EPETRAEXT_DEPRECATED
00462 int Zoltan::LoadBalance::Set_Param( const std::string & param, const std::string & value )
00463 {
00464   return Zoltan_Set_Param( LoadBalance_Ptr_,
00465                            const_cast<char*>(param.c_str()),
00466                            const_cast<char*>(value.c_str()) );
00467 }
00468 
00469 EPETRAEXT_DEPRECATED
00470 int Zoltan::LoadBalance::Balance(        int * changes,
00471           int * num_gid_entries,
00472           int * num_lid_entries,
00473           int * num_import,
00474           ZOLTAN_ID_PTR * import_global_ids,
00475           ZOLTAN_ID_PTR * import_local_ids,
00476           int ** import_procs,
00477           int * num_export,
00478           ZOLTAN_ID_PTR * export_global_ids,
00479           ZOLTAN_ID_PTR * export_local_ids,
00480           int ** export_procs )
00481 {
00482   Zoltan::QueryContainer::setQueryID( ObjectID );
00483   Zoltan::MigrationContainer::setMigrationID( ObjectID );
00484 
00485   return Zoltan_LB_Balance( LoadBalance_Ptr_, changes, num_gid_entries,
00486   num_lid_entries, num_import, import_global_ids,
00487   import_local_ids, import_procs, num_export, export_global_ids,
00488   export_local_ids, export_procs );
00489 }
00490 
00491 #ifdef ZOLTAN_ORDER
00492 EPETRAEXT_DEPRECATED
00493 int Zoltan::LoadBalance::Order(   int * num_gid_entries,
00494           int * num_lid_entries,
00495                                         int num_objs,
00496           ZOLTAN_ID_PTR global_ids,
00497           ZOLTAN_ID_PTR local_ids,
00498                                         int * rank,
00499                                         int * iperm )
00500 {
00501   Zoltan::QueryContainer::setQueryID( ObjectID );
00502 
00503   return Zoltan_Order( LoadBalance_Ptr_, num_gid_entries,
00504   num_lid_entries, num_objs, global_ids, local_ids,
00505         rank, iperm, NULL );
00506 }
00507 #endif
00508 
00509 EPETRAEXT_DEPRECATED
00510 void Zoltan::LoadBalance::Evaluate     ( int print_stats,
00511           int * num_objects,
00512           float * object_weights,
00513                                         int * num_cuts,
00514           float * cut_weights,
00515           int * num_boundary_objects,
00516           int * num_adj_procs )
00517 {
00518   Zoltan::QueryContainer::setQueryID( ObjectID );
00519 
00520 //  HKT 6/24/2009 Commented out call to Zoltan because interface under construction.
00521 //  Zoltan_LB_Eval( LoadBalance_Ptr_, print_stats, num_objects, object_weights,
00522 //  num_cuts, cut_weights, num_boundary_objects, num_adj_procs );
00523 }
00524 
00525 EPETRAEXT_DEPRECATED
00526 int Zoltan::LoadBalance::Free_Data     ( ZOLTAN_ID_PTR * import_global_ids,
00527           ZOLTAN_ID_PTR * import_local_ids,
00528           int ** import_procs,
00529           ZOLTAN_ID_PTR * export_global_ids,
00530           ZOLTAN_ID_PTR * export_local_ids,
00531           int ** export_procs )
00532 {
00533   return Zoltan_LB_Free_Data( import_global_ids, import_local_ids, import_procs,
00534   export_global_ids, export_local_ids, export_procs );
00535 }
00536 
00537  //Decomposition Augmentation
00538 EPETRAEXT_DEPRECATED
00539 int Zoltan::LoadBalance::Point_Assign  ( double * coords,
00540           int * proc )
00541 {
00542   return Zoltan_LB_Point_Assign( LoadBalance_Ptr_, coords, proc );
00543 }
00544 
00545 EPETRAEXT_DEPRECATED
00546 int Zoltan::LoadBalance::Box_Assign    ( double xmin,
00547           double ymin,
00548           double zmin,
00549           double xmax,
00550           double ymax,
00551           double zmax,
00552           int * procs,
00553           int * numprocs )
00554 {
00555   return Zoltan_LB_Box_Assign( LoadBalance_Ptr_, xmin, ymin, zmin, xmax, ymax, zmax,
00556   procs, numprocs );
00557 }
00558 
00559  //Migration Functions
00560 EPETRAEXT_DEPRECATED
00561 int Zoltan::LoadBalance::Compute_Destinations  ( int num_import,
00562             ZOLTAN_ID_PTR import_global_ids,
00563             ZOLTAN_ID_PTR import_local_ids,
00564             int * import_procs,
00565             int * num_export,
00566             ZOLTAN_ID_PTR * export_global_ids,
00567             ZOLTAN_ID_PTR * export_local_ids,
00568             int ** export_procs )
00569 {
00570   return Zoltan_Compute_Destinations( LoadBalance_Ptr_, num_import,
00571   import_global_ids, import_local_ids, import_procs, num_export,
00572   export_global_ids, export_local_ids, export_procs );
00573 }
00574 
00575 EPETRAEXT_DEPRECATED
00576 int Zoltan::LoadBalance::Help_Migrate  ( int num_import,
00577           ZOLTAN_ID_PTR import_global_ids,
00578           ZOLTAN_ID_PTR import_local_ids,
00579           int * import_procs,
00580           int num_export,
00581           ZOLTAN_ID_PTR export_global_ids,
00582           ZOLTAN_ID_PTR export_local_ids,
00583           int * export_procs )
00584 {
00585   Zoltan::MigrationContainer::setMigrationID( ObjectID );
00586 
00587   return Zoltan_Help_Migrate( LoadBalance_Ptr_, num_import,
00588   import_global_ids, import_local_ids, import_procs,
00589   num_export, export_global_ids, export_local_ids, export_procs );
00590 }
00591 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines