/usr/include/trilinos/zoltan_cpp.h is in libtrilinos-zoltan-dev 12.4.2-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 | /*
* @HEADER
*
* ***********************************************************************
*
* Zoltan Toolkit for Load-balancing, Partitioning, Ordering and Coloring
* Copyright 2012 Sandia Corporation
*
* Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
* the U.S. Government retains certain rights in this software.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the Corporation nor the names of the
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Questions? Contact Karen Devine kddevin@sandia.gov
* Erik Boman egboman@sandia.gov
*
* ***********************************************************************
*
* @HEADER
*/
// ************************************************************************
// C++ class representing a Zoltan_Struct object.
//
// Assumption: Zoltan_Initialize has been called prior to creating
// a Zoltan object.
// ************************************************************************
#ifndef ZOLTAN_CPP_H_
#define ZOLTAN_CPP_H_
#include "zoltan.h"
#include "zoltan_comm_cpp.h"
#include "zoltan_dd_cpp.h"
#include <cstdlib>
/* F90 names must be less than 31 characters, support old name */
#define Set_HG_Size_Edge_Weights_Fn Set_HG_Size_Edge_Wts_Fn
#define Set_HG_Edge_Weights_Fn Set_HG_Edge_Wts_Fn
#ifdef TFLOP
#include <string.h>
#else
#include <string>
#endif
class Zoltan {
public:
// Constructor
Zoltan (const MPI_Comm &communicator = MPI_COMM_WORLD)
{
this->ZZ_Ptr = Zoltan_Create(communicator);
// int fail = (this->ZZ_Ptr == NULL); should catch this exception
}
// Copy constructor
Zoltan (const Zoltan &zz)
{
this->ZZ_Ptr = Zoltan_Copy(zz.ZZ_Ptr);
}
// Destructor
~Zoltan()
{
// Warning: Zoltan_Destroy calls MPI.
// Do not call MPI_Finalize() before this destructor gets called.
// Ensure that ZoltanObject's created on the stack are deleted
// before MPI_Finalize().
// Alternatively, you can allocate and destroy Zoltans explicitly:
//
// MPI_Init(...);
// Zoltan_Initialize(...);
// Zoltan *zz = new Zoltan();
// ... more code ...
// delete zz;
// MPI_Finalize();
Zoltan_Destroy( &(this->ZZ_Ptr) );
}
// Copy operator
Zoltan & operator= (const Zoltan &zz)
{
Zoltan_Copy_To(this->ZZ_Ptr, zz.ZZ_Ptr);
return *this;
}
// Wrappers for Zoltan functions
static int LB_Free_Part( ZOLTAN_ID_PTR *global_ids,
ZOLTAN_ID_PTR *local_ids,
int **procs,
int **to_part )
{
return Zoltan_LB_Free_Part( global_ids, local_ids, procs, to_part );
}
int Set_Param( const std::string & param, const std::string & value )
{
return Zoltan_Set_Param( ZZ_Ptr, param.c_str(), value.c_str() );
}
//! Replaces Zoltan_Set_Param_Vec
int Set_Param_Vec( const std::string & param, const std::string & value,
const int &index )
{
return Zoltan_Set_Param_Vec( ZZ_Ptr, param.c_str(), value.c_str(), index);
}
int LB_Partition ( int &changes,
int &num_gid_entries,
int &num_lid_entries,
int &num_import,
ZOLTAN_ID_PTR &import_global_ids,
ZOLTAN_ID_PTR &import_local_ids,
int * &import_procs,
int * &import_to_part,
int &num_export,
ZOLTAN_ID_PTR &export_global_ids,
ZOLTAN_ID_PTR &export_local_ids,
int * &export_procs,
int * &export_to_part )
{
return Zoltan_LB_Partition( ZZ_Ptr, &changes,
&num_gid_entries, &num_lid_entries,
&num_import, &import_global_ids, &import_local_ids,
&import_procs, &import_to_part,
&num_export, &export_global_ids, &export_local_ids,
&export_procs, &export_to_part );
}
int LB_Set_Part_Sizes( const int &global_num,
const int &len,
int * part_ids,
int * wgt_idx,
float * part_sizes )
{
return Zoltan_LB_Set_Part_Sizes( ZZ_Ptr,
global_num, len,
part_ids, wgt_idx, part_sizes );
}
/* This method is deprecated */
int Order ( int num_gid_entries,
int num_objs,
ZOLTAN_ID_PTR global_ids,
int *rank,
int * iperm )
{
return Order( num_gid_entries, num_objs, global_ids,
(ZOLTAN_ID_PTR)rank);
}
int Order ( int num_gid_entries,
int num_objs,
ZOLTAN_ID_PTR global_ids,
ZOLTAN_ID_PTR permuted_global_ids)
{
return Zoltan_Order( ZZ_Ptr,
num_gid_entries, num_objs, global_ids,
permuted_global_ids);
}
int Order_Get_Num_Blocks() {
return Zoltan_Order_Get_Num_Blocks(ZZ_Ptr);
}
int Order_Get_Block_Bounds(int block_num, int &first, int &last) {
return Zoltan_Order_Get_Block_Bounds(ZZ_Ptr, block_num, &first, &last);
}
int Order_Get_Block_Size(int block_num) {
return Zoltan_Order_Get_Block_Size(ZZ_Ptr, block_num);
}
int Order_Get_Block_Parent(int block_num) {
return Zoltan_Order_Get_Block_Parent(ZZ_Ptr, block_num);
}
int Order_Get_Num_Leaves() {
return Zoltan_Order_Get_Num_Leaves(ZZ_Ptr);
}
void Order_Get_Block_Leaves(int *leaves) {
return Zoltan_Order_Get_Block_Leaves(ZZ_Ptr, leaves);
}
int Color (int &num_gid_entries,
const int &num_objs,
ZOLTAN_ID_PTR global_ids,
int *color_exp )
{
return Zoltan_Color(ZZ_Ptr, num_gid_entries,
num_objs, global_ids, color_exp);
}
/* Simpler method to do coloring */
/* int Color (int *color_exp); */
int Color_Test (int &num_gid_entries,
int &num_lid_entries,
const int &num_objs,
ZOLTAN_ID_PTR global_ids,
ZOLTAN_ID_PTR local_ids,
int *color_exp )
{
return Zoltan_Color_Test(ZZ_Ptr, &num_gid_entries, &num_lid_entries,
num_objs, global_ids, local_ids, color_exp);
}
int LB_Eval_Balance(int print_stats, ZOLTAN_BALANCE_EVAL *eval)
{
return Zoltan_LB_Eval_Balance(ZZ_Ptr, print_stats, eval);
}
int LB_Eval_Graph(int print_stats, ZOLTAN_GRAPH_EVAL *graph)
{
return Zoltan_LB_Eval_Graph(ZZ_Ptr, print_stats, graph);
}
int LB_Eval_HG(int print_stats, ZOLTAN_HG_EVAL *hg)
{
return Zoltan_LB_Eval_HG(ZZ_Ptr, print_stats, hg);
}
int LB_Eval( const int &print_stats, ZOLTAN_BALANCE_EVAL *eval,
ZOLTAN_GRAPH_EVAL *graph, ZOLTAN_HG_EVAL *hg)
{
return Zoltan_LB_Eval( ZZ_Ptr, print_stats, eval, graph, hg);
}
int RCB_Box( const int &part,
int &ndim,
double &xmin,
double &ymin,
double &zmin,
double &xmax,
double &ymax,
double &zmax )
{
return Zoltan_RCB_Box( ZZ_Ptr,part,&ndim,&xmin,&ymin,&zmin,&xmax,&ymax,&zmax);
}
int Set_Fn ( const ZOLTAN_FN_TYPE &fn_type,
void (*fn_ptr)(),
void * data = 0 )
{
return Zoltan_Set_Fn( ZZ_Ptr, fn_type, fn_ptr, data );
}
// Individual callback support
///--------------------------
int Set_Part_Multi_Fn ( ZOLTAN_PART_MULTI_FN * fn_ptr,
void * data = 0 )
{
return Zoltan_Set_Part_Multi_Fn( ZZ_Ptr, fn_ptr, data );
}
///--------------------------
int Set_Part_Fn ( ZOLTAN_PART_FN * fn_ptr,
void * data = 0 )
{
return Zoltan_Set_Part_Fn( ZZ_Ptr, fn_ptr, data );
}
///--------------------------
int Set_Num_Edges_Multi_Fn ( ZOLTAN_NUM_EDGES_MULTI_FN * fn_ptr,
void * data = 0 )
{
return Zoltan_Set_Num_Edges_Multi_Fn( ZZ_Ptr, fn_ptr, data );
}
///--------------------------
int Set_Num_Edges_Fn ( ZOLTAN_NUM_EDGES_FN * fn_ptr,
void * data = 0 )
{
return Zoltan_Set_Num_Edges_Fn( ZZ_Ptr, fn_ptr, data );
}
///--------------------------
int Set_Edge_List_Multi_Fn ( ZOLTAN_EDGE_LIST_MULTI_FN * fn_ptr,
void * data = 0 )
{
return Zoltan_Set_Edge_List_Multi_Fn( ZZ_Ptr, fn_ptr, data );
}
///--------------------------
int Set_Edge_List_Fn ( ZOLTAN_EDGE_LIST_FN * fn_ptr,
void * data = 0 )
{
return Zoltan_Set_Edge_List_Fn( ZZ_Ptr, fn_ptr, data );
}
///--------------------------
int Set_Num_Geom_Fn ( ZOLTAN_NUM_GEOM_FN * fn_ptr,
void * data = 0 )
{
return Zoltan_Set_Num_Geom_Fn( ZZ_Ptr, fn_ptr, data );
}
///--------------------------
int Set_Geom_Multi_Fn ( ZOLTAN_GEOM_MULTI_FN * fn_ptr,
void * data = 0 )
{
return Zoltan_Set_Geom_Multi_Fn( ZZ_Ptr, fn_ptr, data );
}
///--------------------------
int Set_Geom_Fn ( ZOLTAN_GEOM_FN * fn_ptr,
void * data = 0 )
{
return Zoltan_Set_Geom_Fn( ZZ_Ptr, fn_ptr, data );
}
///--------------------------
int Set_Num_Obj_Fn ( ZOLTAN_NUM_OBJ_FN * fn_ptr,
void * data = 0 )
{
return Zoltan_Set_Num_Obj_Fn( ZZ_Ptr, fn_ptr, data );
}
///--------------------------
int Set_Obj_List_Fn ( ZOLTAN_OBJ_LIST_FN * fn_ptr,
void * data = 0 )
{
return Zoltan_Set_Obj_List_Fn( ZZ_Ptr, fn_ptr, data );
}
///--------------------------
int Set_First_Obj_Fn ( ZOLTAN_FIRST_OBJ_FN * fn_ptr,
void * data = 0 )
{
return Zoltan_Set_First_Obj_Fn( ZZ_Ptr, fn_ptr, data );
}
///--------------------------
int Set_Next_Obj_Fn ( ZOLTAN_NEXT_OBJ_FN * fn_ptr,
void * data = 0 )
{
return Zoltan_Set_Next_Obj_Fn( ZZ_Ptr, fn_ptr, data );
}
///--------------------------
int Set_Num_Coarse_Obj_Fn ( ZOLTAN_NUM_COARSE_OBJ_FN * fn_ptr,
void * data = 0 )
{
return Zoltan_Set_Num_Coarse_Obj_Fn( ZZ_Ptr, fn_ptr, data );
}
///--------------------------
int Set_Coarse_Obj_List_Fn ( ZOLTAN_COARSE_OBJ_LIST_FN * fn_ptr,
void * data = 0 )
{
return Zoltan_Set_Coarse_Obj_List_Fn( ZZ_Ptr, fn_ptr, data );
}
///--------------------------
int Set_First_Coarse_Obj_Fn( ZOLTAN_FIRST_COARSE_OBJ_FN * fn_ptr,
void * data = 0 )
{
return Zoltan_Set_First_Coarse_Obj_Fn( ZZ_Ptr, fn_ptr, data );
}
///--------------------------
int Set_Next_Coarse_Obj_Fn ( ZOLTAN_NEXT_COARSE_OBJ_FN * fn_ptr,
void * data = 0 )
{
return Zoltan_Set_Next_Coarse_Obj_Fn( ZZ_Ptr, fn_ptr, data );
}
///--------------------------
int Set_Num_Child_Fn ( ZOLTAN_NUM_CHILD_FN * fn_ptr,
void * data = 0 )
{
return Zoltan_Set_Num_Child_Fn( ZZ_Ptr, fn_ptr, data );
}
///--------------------------
int Set_Child_List_Fn ( ZOLTAN_CHILD_LIST_FN * fn_ptr,
void * data = 0 )
{
return Zoltan_Set_Child_List_Fn( ZZ_Ptr, fn_ptr, data );
}
///--------------------------
int Set_Child_Weight_Fn ( ZOLTAN_CHILD_WEIGHT_FN * fn_ptr,
void * data = 0 )
{
return Zoltan_Set_Child_Weight_Fn( ZZ_Ptr, fn_ptr, data );
}
///--------------------------
int Set_HG_Size_CS_Fn ( ZOLTAN_HG_SIZE_CS_FN * fn_ptr,
void * data = 0 )
{
return Zoltan_Set_HG_Size_CS_Fn( ZZ_Ptr, fn_ptr, data );
}
///--------------------------
int Set_HG_CS_Fn ( ZOLTAN_HG_CS_FN * fn_ptr,
void * data = 0 )
{
return Zoltan_Set_HG_CS_Fn( ZZ_Ptr, fn_ptr, data );
}
///--------------------------
int Set_HG_Size_Edge_Wts_Fn ( ZOLTAN_HG_SIZE_EDGE_WTS_FN * fn_ptr,
void * data = 0 )
{
return Zoltan_Set_HG_Size_Edge_Wts_Fn( ZZ_Ptr, fn_ptr, data );
}
///--------------------------
int Set_HG_Edge_Wts_Fn ( ZOLTAN_HG_EDGE_WTS_FN * fn_ptr,
void * data = 0 )
{
return Zoltan_Set_HG_Edge_Wts_Fn( ZZ_Ptr, fn_ptr, data );
}
///--------------------------
int Set_Hier_Num_Levels_Fn( ZOLTAN_HIER_NUM_LEVELS_FN * fn_ptr,
void * data = 0 )
{
return Zoltan_Set_Hier_Num_Levels_Fn( ZZ_Ptr, fn_ptr, data );
}
///--------------------------
int Set_Hier_Part_Fn( ZOLTAN_HIER_PART_FN * fn_ptr,
void * data = 0 )
{
return Zoltan_Set_Hier_Part_Fn( ZZ_Ptr, fn_ptr, data );
}
///--------------------------
int Set_Hier_Method_Fn( ZOLTAN_HIER_METHOD_FN * fn_ptr,
void * data = 0 )
{
return Zoltan_Set_Hier_Method_Fn( ZZ_Ptr, fn_ptr, data );
}
///--------------------------
int Set_Num_Fixed_Obj_Fn ( ZOLTAN_NUM_FIXED_OBJ_FN * fn_ptr,
void * data = 0 )
{
return Zoltan_Set_Num_Fixed_Obj_Fn( ZZ_Ptr, fn_ptr, data );
}
///--------------------------
int Set_Fixed_Obj_List_Fn ( ZOLTAN_FIXED_OBJ_LIST_FN * fn_ptr,
void * data = 0 )
{
return Zoltan_Set_Fixed_Obj_List_Fn( ZZ_Ptr, fn_ptr, data );
}
///--------------------------
int Set_Pre_Migrate_PP_Fn ( ZOLTAN_PRE_MIGRATE_PP_FN * fn_ptr,
void * data = 0 )
{
return Zoltan_Set_Pre_Migrate_PP_Fn( ZZ_Ptr, fn_ptr, data );
}
///--------------------------
int Set_Mid_Migrate_PP_Fn ( ZOLTAN_MID_MIGRATE_PP_FN * fn_ptr,
void * data = 0 )
{
return Zoltan_Set_Mid_Migrate_PP_Fn( ZZ_Ptr, fn_ptr, data );
}
///--------------------------
int Set_Post_Migrate_PP_Fn ( ZOLTAN_POST_MIGRATE_PP_FN * fn_ptr,
void * data = 0 )
{
return Zoltan_Set_Post_Migrate_PP_Fn( ZZ_Ptr, fn_ptr, data );
}
///--------------------------
int Set_Obj_Size_Multi_Fn ( ZOLTAN_OBJ_SIZE_MULTI_FN * fn_ptr,
void * data = 0 )
{
return Zoltan_Set_Obj_Size_Multi_Fn( ZZ_Ptr, fn_ptr, data );
}
///--------------------------
int Set_Obj_Size_Fn ( ZOLTAN_OBJ_SIZE_FN * fn_ptr,
void * data = 0 )
{
return Zoltan_Set_Obj_Size_Fn( ZZ_Ptr, fn_ptr, data );
}
///--------------------------
int Set_Pack_Obj_Multi_Fn ( ZOLTAN_PACK_OBJ_MULTI_FN * fn_ptr,
void * data = 0 )
{
return Zoltan_Set_Pack_Obj_Multi_Fn( ZZ_Ptr, fn_ptr, data );
}
///--------------------------
int Set_Pack_Obj_Fn ( ZOLTAN_PACK_OBJ_FN * fn_ptr,
void * data = 0 )
{
return Zoltan_Set_Pack_Obj_Fn( ZZ_Ptr, fn_ptr, data );
}
///--------------------------
int Set_Unpack_Obj_Multi_Fn( ZOLTAN_UNPACK_OBJ_MULTI_FN * fn_ptr,
void * data = 0 )
{
return Zoltan_Set_Unpack_Obj_Multi_Fn( ZZ_Ptr, fn_ptr, data );
}
///--------------------------
int Set_Unpack_Obj_Fn ( ZOLTAN_UNPACK_OBJ_FN * fn_ptr,
void * data = 0 )
{
return Zoltan_Set_Unpack_Obj_Fn( ZZ_Ptr, fn_ptr, data );
}
/// Backward compatibility with v3.0
///--------------------------
int Set_Partition_Multi_Fn ( ZOLTAN_PART_MULTI_FN * fn_ptr,
void * data = 0 )
{
return Zoltan_Set_Part_Multi_Fn( ZZ_Ptr, fn_ptr, data );
}
///--------------------------
int Set_Partition_Fn ( ZOLTAN_PART_FN * fn_ptr,
void * data = 0 )
{
return Zoltan_Set_Part_Fn( ZZ_Ptr, fn_ptr, data );
}
///--------------------------
int Set_Hier_Partition_Fn( ZOLTAN_HIER_PART_FN * fn_ptr,
void * data = 0 )
{
return Zoltan_Set_Hier_Part_Fn( ZZ_Ptr, fn_ptr, data );
}
///--------------------------
///--------------------------
int LB_Point_PP_Assign ( double * const coords,
int &proc,
int &part )
{
return Zoltan_LB_Point_PP_Assign( ZZ_Ptr, coords, &proc, &part );
}
int LB_Box_PP_Assign ( const double &xmin,
const double &ymin,
const double &zmin,
const double &xmax,
const double &ymax,
const double &zmax,
int * const procs,
int &numprocs,
int * const parts,
int &numparts )
{
return Zoltan_LB_Box_PP_Assign( ZZ_Ptr,
xmin, ymin, zmin,
xmax, ymax, zmax,
procs, &numprocs,
parts, &numparts );
}
int Invert_Lists ( const int &num_known,
ZOLTAN_ID_PTR const known_global_ids,
ZOLTAN_ID_PTR const known_local_ids,
int * const known_procs,
int * const known_to_part,
int &num_found,
ZOLTAN_ID_PTR &found_global_ids,
ZOLTAN_ID_PTR &found_local_ids,
int * &found_procs,
int * &found_to_part )
{
return Zoltan_Invert_Lists( ZZ_Ptr,
num_known, known_global_ids, known_local_ids,
known_procs, known_to_part,
&num_found, &found_global_ids, &found_local_ids,
&found_procs, &found_to_part );
}
int Migrate ( const int &num_import,
ZOLTAN_ID_PTR const import_global_ids,
ZOLTAN_ID_PTR const import_local_ids,
int * const import_procs,
int * const import_to_part,
const int &num_export,
ZOLTAN_ID_PTR const export_global_ids,
ZOLTAN_ID_PTR const export_local_ids,
int * const export_procs,
int * const export_to_part )
{
return Zoltan_Migrate( ZZ_Ptr,
num_import, import_global_ids, import_local_ids,
import_procs, import_to_part,
num_export, export_global_ids, export_local_ids,
export_procs, export_to_part );
}
int Generate_Files( std::string & fname,
const int &base_index,
const int &gen_geom,
const int &gen_graph,
const int &gen_hg )
{
// c_str() is a "const char *", and Zoltan_Generate_Files may re-write
// the name passed in, so in order to compile we need a non-const
// "char *" file name to pass to Zoltan_Generate_Files.
#ifdef TFLOP
char *fn = strdup((char *)fname.c_str());
#else
char *fn = strdup(fname.c_str());
#endif
int rc = Zoltan_Generate_Files( ZZ_Ptr, fn, base_index,
gen_geom, gen_graph, gen_hg );
std::free(fn);
return rc;
}
// Access to the "C" language structure, required for use of
// Zoltan "C" functions. (Deprecated "C" functions were not
// included in the C++ interface.)
Zoltan_Struct *Get_C_Handle(void)
{
return ZZ_Ptr;
}
private:
Zoltan_Struct * ZZ_Ptr;
};
#endif
|