EpetraExt Development
Zoltan_QueryFunctions.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 // Filename       : $Zoltan_QueryFunctions.C$
00046 //
00047 // Purpose        : Static methods which are directly registered with
00048 //                  Zoltan.  They us the static container to access
00049 //                  the dynamic object methods.
00050 //
00051 // Special Notes  :
00052 //
00053 // Creator        : Robert J. Hoekstra, Parallel Computational Sciences
00054 //
00055 // Creation Date  : 08/04/2000
00056 //
00057 // Revision Information:
00058 // ---------------------
00059 //
00060 // Revision Number: $Revision$
00061 //
00062 // Revision Date  : $Date$
00063 //
00064 // Current Owner  : $Author$
00065 //-------------------------------------------------------------------------
00066 
00067 #include <Zoltan_QueryFunctions.h>
00068 #include <Zoltan_QueryContainer.h>
00069 #include <Zoltan_QueryObject.h>
00070 
00071   //General Functions
00072 EPETRAEXT_DEPRECATED
00073 int Zoltan::QueryFunctions::Number_Objects     (  void * data,
00074             int * ierr )
00075 {
00076   Zoltan::QueryObject * obj_ptr = Zoltan::QueryContainer::getQueryObject(
00077   Zoltan::QueryContainer::getQueryID() );
00078 
00079   return obj_ptr->Number_Objects( data, ierr );
00080 }
00081 
00082 EPETRAEXT_DEPRECATED
00083 void Zoltan::QueryFunctions::Object_List       (  void * data,
00084             int num_gid_entries,
00085             int num_lid_entries,
00086             ZOLTAN_ID_PTR global_ids,
00087             ZOLTAN_ID_PTR local_ids, 
00088             int weight_dim,
00089             float * object_weights,
00090             int * ierr )
00091 {
00092   Zoltan::QueryObject * obj_ptr = Zoltan::QueryContainer::getQueryObject(
00093   Zoltan::QueryContainer::getQueryID() );
00094 
00095   obj_ptr->Object_List( data, num_gid_entries, num_lid_entries, global_ids,
00096   local_ids, weight_dim, object_weights, ierr );
00097 }
00098 
00099 EPETRAEXT_DEPRECATED
00100 int Zoltan::QueryFunctions::First_Object       (  void * data,
00101             int num_gid_entries,
00102             int num_lid_entries,
00103             ZOLTAN_ID_PTR first_global_id,
00104             ZOLTAN_ID_PTR first_local_id, 
00105             int weight_dim,
00106             float * first_weight,
00107             int * ierr )
00108 {
00109   Zoltan::QueryObject * obj_ptr = Zoltan::QueryContainer::getQueryObject(
00110   Zoltan::QueryContainer::getQueryID() );
00111 
00112   return obj_ptr->First_Object( data, num_gid_entries, num_lid_entries,
00113   first_global_id, first_local_id, weight_dim, first_weight, ierr );
00114 }
00115 
00116 EPETRAEXT_DEPRECATED
00117 int Zoltan::QueryFunctions::Next_Object        (  void * data,
00118             int num_gid_entries,
00119             int num_lid_entries,
00120             ZOLTAN_ID_PTR global_id,
00121             ZOLTAN_ID_PTR local_id, 
00122             ZOLTAN_ID_PTR next_global_id,
00123             ZOLTAN_ID_PTR next_local_id, 
00124             int weight_dim,
00125             float * next_weight,
00126             int * ierr )
00127 {
00128   Zoltan::QueryObject * obj_ptr = Zoltan::QueryContainer::getQueryObject(
00129   Zoltan::QueryContainer::getQueryID() );
00130 
00131   return obj_ptr->Next_Object( data, num_gid_entries, num_lid_entries,
00132   global_id, local_id, next_global_id, next_local_id,
00133   weight_dim, next_weight, ierr );
00134 }
00135 
00136 EPETRAEXT_DEPRECATED
00137 int Zoltan::QueryFunctions::Number_Border_Objects    ( void * data,
00138                   int number_neighbor_procs,
00139                   int * ierr )
00140 {
00141   Zoltan::QueryObject * obj_ptr = Zoltan::QueryContainer::getQueryObject(
00142   Zoltan::QueryContainer::getQueryID() );
00143 
00144   return obj_ptr->Number_Border_Objects( data, number_neighbor_procs, ierr );
00145 }
00146 
00147 EPETRAEXT_DEPRECATED
00148 void Zoltan::QueryFunctions::Border_Object_List     ( void * data,
00149                  int num_gid_entries,
00150                  int num_lid_entries,
00151                  int number_neighbor_procs, 
00152                  ZOLTAN_ID_PTR global_ids,
00153                  ZOLTAN_ID_PTR local_ids,
00154                  int weight_dim, 
00155                  float * object_weights,
00156                  int * ierr )
00157 {
00158   Zoltan::QueryObject * obj_ptr = Zoltan::QueryContainer::getQueryObject(
00159   Zoltan::QueryContainer::getQueryID() );
00160 
00161   obj_ptr->Border_Object_List( data, num_gid_entries, num_lid_entries,
00162   number_neighbor_procs, global_ids, local_ids, weight_dim,
00163   object_weights, ierr );
00164 }
00165 
00166 
00167 EPETRAEXT_DEPRECATED
00168 int Zoltan::QueryFunctions::First_Border_Object     ( void * data,
00169                  int num_gid_entries,
00170                  int num_lid_entries,
00171                  int number_neighbor_procs, 
00172                  ZOLTAN_ID_PTR first_global_id,
00173                  ZOLTAN_ID_PTR first_local_id,
00174                  int weight_dim,
00175                  float * first_weight,
00176                  int * ierr )
00177 {
00178   Zoltan::QueryObject * obj_ptr = Zoltan::QueryContainer::getQueryObject(
00179   Zoltan::QueryContainer::getQueryID() );
00180 
00181   return obj_ptr->First_Border_Object( data, num_gid_entries, num_lid_entries,
00182   number_neighbor_procs, first_global_id, first_local_id, weight_dim,
00183   first_weight, ierr );
00184 }
00185 
00186 EPETRAEXT_DEPRECATED
00187 int Zoltan::QueryFunctions::Next_Border_Object      ( void * data,
00188                  int num_gid_entries,
00189                  int num_lid_entries,
00190                  ZOLTAN_ID_PTR global_id,
00191                  ZOLTAN_ID_PTR local_id,
00192                  int number_neighbor_procs,
00193                  ZOLTAN_ID_PTR next_global_id,
00194                  ZOLTAN_ID_PTR next_local_id,
00195                  int weight_dim,
00196                  float * next_weight,
00197                  int * ierr )
00198 {
00199   Zoltan::QueryObject * obj_ptr = Zoltan::QueryContainer::getQueryObject(
00200   Zoltan::QueryContainer::getQueryID() );
00201 
00202   return obj_ptr->Next_Border_Object( data, num_gid_entries, num_lid_entries,
00203   global_id, local_id, number_neighbor_procs, next_global_id,
00204   next_local_id, weight_dim, next_weight, ierr );
00205 }
00206 
00207   //Geometry Based Functions
00208 EPETRAEXT_DEPRECATED
00209 int Zoltan::QueryFunctions::Number_Geometry_Objects    (  void * data,
00210               int * ierr )
00211 {
00212   Zoltan::QueryObject * obj_ptr = Zoltan::QueryContainer::getQueryObject(
00213   Zoltan::QueryContainer::getQueryID() );
00214 
00215   return obj_ptr->Number_Geometry_Objects( data, ierr );
00216 }
00217 
00218 EPETRAEXT_DEPRECATED
00219 void Zoltan::QueryFunctions::Geometry_Values   (  void * data,
00220             int num_gid_entries,
00221             int num_lid_entries,
00222             ZOLTAN_ID_PTR global_id,
00223             ZOLTAN_ID_PTR local_id,
00224             double * geometry_vector,
00225             int * ierr )
00226 {
00227   Zoltan::QueryObject * obj_ptr = Zoltan::QueryContainer::getQueryObject(
00228   Zoltan::QueryContainer::getQueryID() );
00229 
00230   obj_ptr->Geometry_Values( data, num_gid_entries, num_lid_entries, global_id,
00231   local_id, geometry_vector, ierr );
00232 }
00233 
00234   //Graph Based Functions
00235 EPETRAEXT_DEPRECATED
00236 int Zoltan::QueryFunctions::Number_Edges       (  void * data,
00237             int num_gid_entries,
00238             int num_lid_entries,
00239             ZOLTAN_ID_PTR global_id,
00240             ZOLTAN_ID_PTR local_id,
00241             int * ierr )
00242 {
00243   Zoltan::QueryObject * obj_ptr = Zoltan::QueryContainer::getQueryObject(
00244   Zoltan::QueryContainer::getQueryID() );
00245 
00246   return obj_ptr->Number_Edges( data, num_gid_entries, num_lid_entries,
00247   global_id, local_id, ierr );
00248 }
00249 
00250 EPETRAEXT_DEPRECATED
00251 void Zoltan::QueryFunctions::Edge_List (  void * data,
00252           int num_gid_entries,
00253           int num_lid_entries,
00254           ZOLTAN_ID_PTR global_id,
00255           ZOLTAN_ID_PTR local_id,
00256           ZOLTAN_ID_PTR neighbor_global_ids,
00257           int * neighbor_procs,
00258           int weight_dim,
00259           float * edge_weights,
00260           int * ierr )
00261 {
00262   Zoltan::QueryObject * obj_ptr = Zoltan::QueryContainer::getQueryObject(
00263   Zoltan::QueryContainer::getQueryID() );
00264 
00265   obj_ptr->Edge_List( data, num_gid_entries, num_lid_entries, global_id,
00266   local_id, neighbor_global_ids, neighbor_procs, weight_dim,
00267   edge_weights, ierr );
00268 }
00269 
00270   //Tree Based Functions
00271 EPETRAEXT_DEPRECATED
00272 int Zoltan::QueryFunctions::Number_Coarse_Objects      (  void * data,
00273               int * ierr )
00274 {
00275   Zoltan::QueryObject * obj_ptr = Zoltan::QueryContainer::getQueryObject(
00276   Zoltan::QueryContainer::getQueryID() );
00277 
00278   return obj_ptr->Number_Coarse_Objects( data, ierr );
00279 }
00280 
00281 EPETRAEXT_DEPRECATED
00282 void Zoltan::QueryFunctions::Coarse_Object_List        (  void * data,
00283               int num_gid_entries,
00284               int num_lid_entries,
00285               ZOLTAN_ID_PTR global_ids,
00286               ZOLTAN_ID_PTR local_ids,
00287               int * assigned,
00288               int * number_vertices,
00289               ZOLTAN_ID_PTR vertices,
00290               int * in_order,
00291               ZOLTAN_ID_PTR in_vertex,
00292               ZOLTAN_ID_PTR out_vertex,
00293               int * ierr )
00294 {
00295   Zoltan::QueryObject * obj_ptr = Zoltan::QueryContainer::getQueryObject(
00296   Zoltan::QueryContainer::getQueryID() );
00297 
00298   obj_ptr->Coarse_Object_List( data, num_gid_entries, num_lid_entries,
00299   global_ids, local_ids, assigned, number_vertices, vertices,
00300   in_order, in_vertex, out_vertex, ierr );
00301 }
00302 
00303 EPETRAEXT_DEPRECATED
00304 int Zoltan::QueryFunctions::First_Coarse_Object      ( void * data,
00305                   int num_gid_entries,
00306                   int num_lid_entries,
00307                   ZOLTAN_ID_PTR first_global_id,
00308                   ZOLTAN_ID_PTR first_local_id,
00309                   int * assigned,
00310                   int * number_vertices,
00311                   ZOLTAN_ID_PTR vertices,
00312                   int * in_order,
00313                   ZOLTAN_ID_PTR in_vertex,
00314                   ZOLTAN_ID_PTR out_vertex,
00315                   int * ierr )
00316 {
00317   Zoltan::QueryObject * obj_ptr = Zoltan::QueryContainer::getQueryObject(
00318   Zoltan::QueryContainer::getQueryID() );
00319 
00320   return obj_ptr->First_Coarse_Object( data, num_gid_entries, num_lid_entries,
00321   first_global_id, first_local_id, assigned, number_vertices, vertices,
00322   in_order, in_vertex, out_vertex, ierr );
00323 }
00324 
00325 EPETRAEXT_DEPRECATED
00326 int Zoltan::QueryFunctions::Next_Coarse_Object       ( void * data,
00327                   int num_gid_entries,
00328                   int num_lid_entries,
00329                   ZOLTAN_ID_PTR global_id,
00330                   ZOLTAN_ID_PTR local_id,
00331                   ZOLTAN_ID_PTR next_global_id,
00332                   ZOLTAN_ID_PTR next_local_id,
00333                   int * assigned,
00334                   int * number_vertices,
00335                   ZOLTAN_ID_PTR vertices,
00336                   ZOLTAN_ID_PTR in_vertex,
00337                   ZOLTAN_ID_PTR out_vertex,
00338                   int * ierr )
00339 {
00340   Zoltan::QueryObject * obj_ptr = Zoltan::QueryContainer::getQueryObject(
00341   Zoltan::QueryContainer::getQueryID() );
00342 
00343   return obj_ptr->Next_Coarse_Object( data, num_gid_entries, num_lid_entries,
00344   global_id, local_id, next_global_id, next_local_id,
00345   assigned, number_vertices, vertices, in_vertex, out_vertex,
00346   ierr );
00347 }
00348 
00349 EPETRAEXT_DEPRECATED
00350 int Zoltan::QueryFunctions::Number_Children    (  void * data,
00351             int num_gid_entries,
00352             int num_lid_entries,
00353             ZOLTAN_ID_PTR global_id,
00354             ZOLTAN_ID_PTR local_id,
00355             int * ierr)
00356 {
00357   Zoltan::QueryObject * obj_ptr = Zoltan::QueryContainer::getQueryObject(
00358   Zoltan::QueryContainer::getQueryID() );
00359 
00360   return obj_ptr->Number_Children( data, num_gid_entries, num_lid_entries,
00361   global_id, local_id, ierr );
00362 }
00363 
00364 EPETRAEXT_DEPRECATED
00365 void Zoltan::QueryFunctions::Child_List        (  void * data,
00366             int num_gid_entries,
00367             int num_lid_entries,
00368             ZOLTAN_ID_PTR parent_global_id,
00369             ZOLTAN_ID_PTR parent_local_id,
00370             ZOLTAN_ID_PTR child_global_ids,
00371             ZOLTAN_ID_PTR child_local_ids,
00372             int * assigned,
00373             int * number_vertices,
00374             ZOLTAN_ID_PTR vertices,
00375             ZOLTAN_REF_TYPE * reference_type,
00376             ZOLTAN_ID_PTR in_vertex,
00377             ZOLTAN_ID_PTR out_vertex,
00378             int * ierr )
00379 {
00380   Zoltan::QueryObject * obj_ptr = Zoltan::QueryContainer::getQueryObject(
00381   Zoltan::QueryContainer::getQueryID() );
00382 
00383   obj_ptr->Child_List( data, num_gid_entries, num_lid_entries,
00384   parent_global_id, parent_local_id,
00385   child_global_ids, child_local_ids, assigned, number_vertices,
00386   vertices, reference_type, in_vertex, out_vertex, ierr );
00387 }
00388 
00389 EPETRAEXT_DEPRECATED
00390 void Zoltan::QueryFunctions::Child_Weight      (  void * data,
00391             int num_gid_entries,
00392             int num_lid_entries,
00393             ZOLTAN_ID_PTR global_id,
00394             ZOLTAN_ID_PTR local_id,
00395             int weight_dim,
00396             float * object_weight,
00397             int * ierr )
00398 {
00399   Zoltan::QueryObject * obj_ptr = Zoltan::QueryContainer::getQueryObject(
00400   Zoltan::QueryContainer::getQueryID() );
00401 
00402   obj_ptr->Child_Weight( data, num_gid_entries, num_lid_entries,
00403   global_id, local_id, weight_dim, object_weight, ierr );
00404 }
00405 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines