/usr/lib/python2.7/dist-packages/PySPH-1.0a4.dev0-py2.7-linux-x86_64.egg/pyzoltan/czoltan/czoltan.pxd is in python-pysph 0~20160514.git91867dc-4build1.
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 | """Cython Wrapper for Zoltan. """
from mpi4py.mpi_c cimport MPI_Comm
from czoltan_types cimport ZOLTAN_ID_PTR
cdef extern from "zoltan.h":
# Zoltan version number
float ZOLTAN_VERSION_NUMBER
# ****************************************************************** #
# * Enumerated type used to indicate which function is to be set by
# * ZOLTAN_Set_Fn.
enum Zoltan_Fn_Type:
ZOLTAN_NUM_EDGES_FN_TYPE
ZOLTAN_NUM_EDGES_MULTI_FN_TYPE
ZOLTAN_EDGE_LIST_FN_TYPE
ZOLTAN_EDGE_LIST_MULTI_FN_TYPE
ZOLTAN_NUM_GEOM_FN_TYPE
ZOLTAN_GEOM_MULTI_FN_TYPE
ZOLTAN_GEOM_FN_TYPE
ZOLTAN_NUM_OBJ_FN_TYPE
ZOLTAN_OBJ_LIST_FN_TYPE
ZOLTAN_FIRST_OBJ_FN_TYPE
ZOLTAN_NEXT_OBJ_FN_TYPE
ZOLTAN_NUM_BORDER_OBJ_FN_TYPE
ZOLTAN_BORDER_OBJ_LIST_FN_TYPE
ZOLTAN_FIRST_BORDER_OBJ_FN_TYPE
ZOLTAN_NEXT_BORDER_OBJ_FN_TYPE
ZOLTAN_PRE_MIGRATE_PP_FN_TYPE
ZOLTAN_MID_MIGRATE_PP_FN_TYPE
ZOLTAN_POST_MIGRATE_PP_FN_TYPE
ZOLTAN_PRE_MIGRATE_FN_TYPE
ZOLTAN_MID_MIGRATE_FN_TYPE
ZOLTAN_POST_MIGRATE_FN_TYPE
ZOLTAN_OBJ_SIZE_FN_TYPE
ZOLTAN_PACK_OBJ_FN_TYPE
ZOLTAN_UNPACK_OBJ_FN_TYPE
ZOLTAN_NUM_COARSE_OBJ_FN_TYPE
ZOLTAN_COARSE_OBJ_LIST_FN_TYPE
ZOLTAN_FIRST_COARSE_OBJ_FN_TYPE
ZOLTAN_NEXT_COARSE_OBJ_FN_TYPE
ZOLTAN_NUM_CHILD_FN_TYPE
ZOLTAN_CHILD_LIST_FN_TYPE
ZOLTAN_CHILD_WEIGHT_FN_TYPE
ZOLTAN_OBJ_SIZE_MULTI_FN_TYPE
ZOLTAN_PACK_OBJ_MULTI_FN_TYPE
ZOLTAN_UNPACK_OBJ_MULTI_FN_TYPE
ZOLTAN_PART_FN_TYPE
ZOLTAN_PART_MULTI_FN_TYPE
ZOLTAN_PROC_NAME_FN_TYPE
ZOLTAN_HG_SIZE_CS_FN_TYPE
ZOLTAN_HG_CS_FN_TYPE
ZOLTAN_HG_SIZE_EDGE_WTS_FN_TYPE
ZOLTAN_HG_EDGE_WTS_FN_TYPE
ZOLTAN_NUM_FIXED_OBJ_FN_TYPE
ZOLTAN_FIXED_OBJ_LIST_FN_TYPE
ZOLTAN_HIER_NUM_LEVELS_FN_TYPE
ZOLTAN_HIER_PART_FN_TYPE
ZOLTAN_HIER_METHOD_FN_TYPE
ZOLTAN_MAX_FN_TYPES
ctypedef Zoltan_Fn_Type ZOLTAN_FN_TYPE
# ************************************************************************
# * Enumerated type used to indicate what type of refinement was used when
# * building a refinement tree.
# */
enum Zoltan_Ref_Type:
ZOLTAN_OTHER_REF
ZOLTAN_IN_ORDER
ZOLTAN_TRI_BISECT
ZOLTAN_QUAD_QUAD
ZOLTAN_HEX3D_OCT
ctypedef Zoltan_Ref_Type ZOLTAN_REF_TYPE
# /***********************************************************************
# /***********************************************************************
# /******* Functions to set-up Zoltan load-balancing data structure ****
# /***********************************************************************
# /***********************************************************************
# /*
# * Function to initialize values needed in load balancing tools, and
# * returns which version of the library this is. If the application
# * uses MPI, call this function after calling MPI_Init. If the
# * application does not use MPI, this function calls MPI_Init for
# * use by Zoltan. This function returns the version of
# * the Zoltan library.
# * Input:
# * argc -- Argument count from main()
# * argv -- Argument list from main()
# * Output:
# * ver -- Version of Zoltan library
# * Returned value: -- Error code
# */
extern int Zoltan_Initialize(int, char**, float* ver)
# Zoltan structure
struct Zoltan_Struct:
pass
# function to create a zoltan structure
extern Zoltan_Struct* Zoltan_Create(MPI_Comm)
# /*****************************************************************************/
# /*
# * Function to free the space associated with a Zoltan structure.
# * The input pointer is set to NULL when the routine returns.
# * Input/Output:
# * zz -- Pointer to a Zoltan structure.
# */
extern void Zoltan_Destroy(
Zoltan_Struct **zz
)
# /*****************************************************************************/
# /*
# * Function to change a parameter value within Zoltan.
# * Default values will be used for all parameters not explicitly altered
# * by a call to this routine.
# *
# * Input
# * zz -- The Zoltan structure to which this
# * parameter alteration applies.
# * name -- The name of the parameter to have its
# * value changed.
# * val -- The new value of the parameter.
# *
# * Returned value: -- Error code
# */
extern int Zoltan_Set_Param(
Zoltan_Struct *zz, char *name, char *val )
# /*****************************************************************************/
# /*
# * Function to return, for the calling processor, the number of objects
# * located in that processor's memory.
# * Input:
# * data -- pointer to user defined data structure
# * Output:
# * ierr -- error code
# * Returned value: -- the number of local objects.
# */
ctypedef int ZOLTAN_NUM_OBJ_FN(
void *data,
int *ierr
)
extern int Zoltan_Set_Num_Obj_Fn(
Zoltan_Struct *zz, ZOLTAN_NUM_OBJ_FN *fn_ptr, void *data_ptr)
# /*****************************************************************************/
# /*
# * Function to return a list of all local objects on a processor.
# * Input:
# * data -- pointer to user defined data structure
# * num_gid_entries -- number of array entries of type ZOLTAN_ID_TYPE
# * in a global ID
# * num_lid_entries -- number of array entries of type ZOLTAN_ID_TYPE
# * in a local ID
# * wdim -- dimension of object weights, or 0 if
# * object weights are not sought.
# * Output:
# * global_ids -- array of Global IDs of all objects on the
# * processor.
# * local_ids -- array of Local IDs of all objects on the
# * processor.
# * objwgts -- objwgts[i*wdim:(i+1)*wdim-1] correponds
# * to the weight of object i
# * ierr -- error code
# */
ctypedef void ZOLTAN_OBJ_LIST_FN(
void *data,
int num_gid_entries,
int num_lid_entries,
ZOLTAN_ID_PTR global_ids,
ZOLTAN_ID_PTR local_ids,
int wdim,
float *objwgts,
int *ierr
)
extern int Zoltan_Set_Obj_List_Fn(
Zoltan_Struct *zz,
ZOLTAN_OBJ_LIST_FN *fn_ptr,
void *data_ptr
)
# /*****************************************************************************/
# /*
# * Function to return
# * the number of geometry fields per object (e.g., the number of values
# * used to express the coordinates of the object).
# * Input:
# * data -- pointer to user defined data structure
# * Output:
# * ierr -- error code
# * Returned value: -- the number of geometry fields.
# */
# A ZOLTAN_NUM_GEOM_FN query function returns the number of values
# needed to express the geometry of an object. For example, for a
# two-dimensional mesh-based application, (x,y) coordinates are needed
# to describe an object's geometry; thus the ZOLTAN_NUM_GEOM_FN query
# function should return the value of two. For a similar
# three-dimensional application, the return value should be three.
ctypedef int ZOLTAN_NUM_GEOM_FN(
void *data,
int *ierr
)
extern int Zoltan_Set_Num_Geom_Fn(
Zoltan_Struct *zz,
ZOLTAN_NUM_GEOM_FN *fn_ptr,
void *data_ptr
)
# /*****************************************************************************/
# A ZOLTAN_GEOM_MULTI FN query function returns a vector of geometry
# values for a list of given objects. The geometry vector is
# allocated by Zoltan to be of size num_obj * num_dim; its format is
# described below
# /*
# * Function to return the geometry information (e.g., coordinates) for
# * all objects.
# * Input:
# * data -- pointer to user defined data structure
# * num_gid_entries -- number of array entries of type ZOLTAN_ID_TYPE
# * in a global ID
# * num_lid_entries -- number of array entries of type ZOLTAN_ID_TYPE
# * in a local ID
# * num_obj -- number of objects whose coordinates are needed.
# * global_id -- array of Global IDs for the objects
# * local_id -- array of Local IDs for the objects;
# * NULL if num_lid_entries == 0.
# * num_dim -- dimension of coordinates for each object.
# * Output:
# * geom_vec -- the geometry info for the objects;
# * (e.g., coordinates)
# * If num_dim == n, geom_vec[i*n+j] is the
# * jth coordinate for object i.
# * ierr -- error code
# */
ctypedef void ZOLTAN_GEOM_MULTI_FN(
void *data,
int num_gid_entries,
int num_lid_entries,
int num_obj,
ZOLTAN_ID_PTR global_id,
ZOLTAN_ID_PTR local_id,
int num_dim,
double *geom_vec,
int *ierr
)
extern int Zoltan_Set_Geom_Multi_Fn(
Zoltan_Struct *zz,
ZOLTAN_GEOM_MULTI_FN *fn_ptr,
void *data_ptr
)
# /*****************************************************************************/
# /*
# * Function to invoke the partitioner.
# *
# * Input:
# * zz -- The Zoltan structure returned by Zoltan_Create.
# * Output:
# * changes -- This value tells whether the new
# * decomposition computed by Zoltan differs
# * from the one given as input to Zoltan.
# * It can be either a one or a zero:
# * zero - No changes to the decomposition
# * were made by the partitioning
# * algorithm; migration isn't needed.
# * one - A new decomposition is suggested
# * by the partitioner; migration
# * is needed to establish the new
# * decomposition.
# * num_gid_entries -- number of entries of type ZOLTAN_ID_TYPE
# * in a global ID
# * num_lid_entries -- number of entries of type ZOLTAN_ID_TYPE
# * in a local ID
# * num_import -- The number of non-local objects in the
# * processor's new decomposition (i.e.,
# * number of objects to be imported).
# * import_global_ids -- Pointer to array of Global IDs for the
# * objects to be imported.
# * import_local_ids -- Pointer to array of Local IDs for the
# * objects to be imported (local to the
# * exporting processor).
# * import_procs -- Pointer to array of Processor IDs for the
# * objects to be imported (processor IDs of
# * source processor).
# * import_to_part -- Pointer to array of partition numbers to
# * which the imported objects should be assigned.
# * num_export -- The number of local objects that must be
# * exported from the processor to establish
# * the new decomposition.
# * export_global_ids -- Pointer to array of Global IDs for the
# * objects to be exported from the current
# * processor.
# * export_local_ids -- Pointer to array of Local IDs for the
# * objects to be exported (local to the
# * current processor).
# * export_procs -- Pointer to array of Processor IDs for the
# * objects to be exported (processor IDs of
# * destination processors).
# * export_to_part -- Pointer to array of partition numbers to
# * which the exported objects should be assigned.
# * Returned value: -- Error code
# */
extern int Zoltan_LB_Partition(
Zoltan_Struct *zz,
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
)
# /*****************************************************************************/
# /*
# * Function to invoke the load-balancer.
# * Appropriate only when the number of requested partitions is equal to the
# * number of processors.
# *
# * Input and output:
# * Arguments are analogous to Zoltan_LB_Partition. Arrays import_to_part
# * and export_to_part are not included, as Zoltan_LB_Balance assumes
# * partitions and processors are equivalent.
# * Returned value: -- Error code
# */
extern int Zoltan_LB_Balance(
Zoltan_Struct *zz,
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 *num_export,
ZOLTAN_ID_PTR *export_global_ids,
ZOLTAN_ID_PTR *export_local_ids,
int **export_procs
)
# /*****************************************************************************/
# /*
# * Routine to free the data arrays returned by Zoltan_Balance. The arrays
# * are freed and the pointers are set to NULL.
# *
# * Input:
# * import_global_ids -- Pointer to array of global IDs for
# * imported objects.
# * import_local_ids -- Pointer to array of local IDs for
# * imported objects.
# * import_procs -- Pointer to array of processor IDs of
# * imported objects.
# * export_global_ids -- Pointer to array of global IDs for
# * exported objects.
# * export_local_ids -- Pointer to array of local IDs for
# * exported objects.
# * export_procs -- Pointer to array of destination processor
# * IDs of exported objects.
# * Returned value: -- Error code
# */
extern int Zoltan_LB_Free_Data(
ZOLTAN_ID_PTR *import_global_ids,
ZOLTAN_ID_PTR *import_local_ids,
int **import_procs,
ZOLTAN_ID_PTR *export_global_ids,
ZOLTAN_ID_PTR *export_local_ids,
int **export_procs
)
# /*****************************************************************************/
# /*
# * Function to return the bounding box of a partition generated by RCB.
# * Input:
# * zz -- The Zoltan structure returned by Zoltan_Create.
# * part -- The partition number whose bounding box is to
# * be returned.
# * Output:
# * ndim -- Number of dimensions in the bounding box.
# * xmin -- lower x extent of box
# * ymin -- lower y extent of box
# * zmin -- lower z extent of box
# * xmax -- upper x extent of box
# * ymax -- upper y extent of box
# * zmax -- upper z extent of box
# * Returned value: -- Error code
# */
int Zoltan_RCB_Box(
Zoltan_Struct *zz,
int part,
int *ndim,
double *xmin,
double *ymin,
double *zmin,
double *xmax,
double *ymax,
double *zmax
)
# /*****************************************************************************/
# /*
# * Routine to determine which partitions and processors
# * a bounding box intersects.
# * Note that this only works of the current partition was produced via a
# * geometric algorithm - currently RCB, RIB, HSFC.
# *
# * Input:
# * zz -- pointer to Zoltan structure
# * xmin, ymin, zmin -- lower left corner of bounding box
# * xmax, ymax, zmax -- upper right corner of bounding box
# *
# * Output:
# * procs -- list of processors that box intersects.
# * Note: application is
# * responsible for ensuring sufficient memory.
# * numprocs -- number of processors box intersects
# * parts -- list of partitions that box intersects.
# * Note: application is
# * responsible for ensuring sufficient memory.
# * numparts -- number of partitions box intersects (may differ
# * from numprocs).
# *
# * Returned value: -- Error code
# */
extern int Zoltan_LB_Box_PP_Assign(
Zoltan_Struct *zz,
double xmin,
double ymin,
double zmin,
double xmax,
double ymax,
double zmax,
int *procs,
int *numprocs,
int *parts,
int *numparts
)
# /*****************************************************************************/
# /*
# * Routine to determine which processor and partition a new point should be
# * assigned to.
# * Note that this only works of the current partition was produced via a
# * geometric algorithm - currently RCB, RIB, HSFC.
# *
# * Input:
# * zz -- pointer to Zoltan structure
# * coords -- vector of coordinates of new point
# *
# * Output:
# * proc -- processor that point should be assigned to
# * part -- partition that point should be assigned to
# *
# * Returned value: -- Error code
# */
extern int Zoltan_LB_Point_PP_Assign(
Zoltan_Struct *zz,
double *coords,
int *proc,
int *part
)
extern int Zoltan_LB_Point_Assign(
Zoltan_Struct *zz,
double *coords,
int *proc
)
# /*****************************************************************************/
# /*
# * Routine to compute the inverse map: Given, for each processor, a list
# * of objects to be received by a processor, compute the list of objects
# * that processor needs to send to other processors to complete a
# * remapping. Conversely, given a list of objects to be sent to other
# * processors, compute the list of objects to be received.
# *
# * Input:
# * zz -- Zoltan structure for current
# * balance.
# * num_input -- Number of objects known to be
# * sent/received.
# * input_global_ids -- Array of global IDs for known objects.
# * input_local_ids -- Array of local IDs for known objects.
# * input_procs -- Array of IDs of processors to/from whom the
# * known objects will be sent/received.
# * input_to_part -- Array of partition numbers to
# * which the known objects should be assigned.
# * Output:
# * num_output -- The number of objects will be received/sent.
# * output_global_ids -- Pointer to array of Global IDs for the
# * objects to be received/sent.
# * output_local_ids -- Pointer to array of Local IDs for the
# * objects to be received/sent.
# * output_procs -- Pointer to array of Processor IDs
# * from/to which the output_global_ids will be
# * received/sent.
# * output_to_part -- Pointer to array of partition numbers to
# * which the output_global_ids should be assigned.
# * Returned value: -- Error code
# */
extern int Zoltan_Invert_Lists(
Zoltan_Struct *zz,
int num_input,
ZOLTAN_ID_PTR input_global_ids,
ZOLTAN_ID_PTR input_local_ids,
int *input_procs,
int *input_to_part,
int *num_output,
ZOLTAN_ID_PTR *output_global_ids,
ZOLTAN_ID_PTR *output_local_ids,
int **output_procs,
int **output_to_part
)
# /*****************************************************************************/
# /*
# * Wrapper around Zoltan_Invert_Lists, appropriate only when
# * number of partitions == number of processors (or when partition information
# * is not desired).
# *
# * Input and Output:
# * Arguments are analogous to Zoltan_Invert_Lists. Arrays import_to_part
# * and export_to_part are not included, as Zoltan_Compute_Destinations
# * assumes partitions and processors are equivalent.
# * Returned value: -- Error code
# */
extern int Zoltan_Compute_Destinations(
Zoltan_Struct *zz,
int num_input,
ZOLTAN_ID_PTR input_global_ids,
ZOLTAN_ID_PTR input_local_ids,
int *input_procs,
int *num_output,
ZOLTAN_ID_PTR *output_global_ids,
ZOLTAN_ID_PTR *output_local_ids,
int **output_procs
)
# /*****************************************************************************/
# /*
# * Routine to free the data arrays returned by Zoltan_LB_Partition,
# * Zoltan_LB_Balance, Zoltan_Invert_Lists, and
# * Zoltan_Compute_Destinations. The arrays
# * are freed and the pointers are set to NULL.
# *
# * Input:
# * global_ids -- Pointer to array of global IDs
# * local_ids -- Pointer to array of local IDs
# * procs -- Pointer to array of processor IDs
# * to_proc -- Pointer to array of partition assignments
# * Returned value: -- Error code
# */
extern int Zoltan_LB_Free_Part(
ZOLTAN_ID_PTR *global_ids,
ZOLTAN_ID_PTR *local_ids,
int **procs,
int **to_part
)
|