C and C++: | int Zoltan_Initialize (
int argc, char **argv, float *ver); |
FORTRAN: | FUNCTION Zoltan_Initialize( argc, argv,
ver)
INTEGER(Zoltan_INT) :: Zoltan_Initialize INTEGER(Zoltan_INT), INTENT(IN), OPTIONAL :: argc CHARACTER(LEN=*), DIMENSION(*), INTENT(IN), OPTIONAL :: argv REAL(Zoltan_FLOAT), INTENT(OUT) :: ver |
Zoltan_Initialize returns the Zoltan version number so that users can verify which version of the library their application is linked to.
C++ applications should call the C Zoltan_Initialize function
before using the C++ interface to the Zoltan library.
Arguments: | |
argc | The number of command-line arguments to the application. |
argv | An array of strings containing the command-line arguments to the application. |
ver | Upon return, the version number of the library. |
Returned Value: | |
int | Error code. |
C: | struct Zoltan_Struct *Zoltan_Create (
MPI_Comm communicator); |
FORTRAN: | FUNCTION Zoltan_Create(communicator)
TYPE(Zoltan_Struct), pointer :: Zoltan_Create INTEGER, INTENT(IN) :: communicator |
C++: | Zoltan (
const MPI_Comm &communicator = MPI_COMM_WORLD); |
In the C++ interface to Zoltan, the Zoltan class represents
a Zoltan load balancing data structure and the functions that operate on it.
It is the constructor which allocates an instance of a Zoltan object. It has
no return value.
Arguments: | |
communicator | The MPI communicator to be used for this Zoltan structure. Only those processors included in the communicator participate in Zoltan functions. If all processors are to participate, communicator should be MPI_COMM_WORLD . |
Returned Value: | |
struct Zoltan_Struct * | Pointer to memory for storage of Zoltan information. If an error occurs, NULL will be returned in C, or the result will be a nullified pointer in Fortran. Any error that occurs in this function is assumed to be fatal. |
C: | struct Zoltan_Struct *Zoltan_Copy (
Zoltan_Struct *from); |
FORTRAN: | FUNCTION Zoltan_Copy(from)
TYPE(Zoltan_Struct), pointer :: Zoltan_Copy TYPE(Zoltan_Struct), INTENT(IN) :: from |
C++: | Zoltan (
const Zoltan &zz); |
There is no direct interface to Zoltan_Copy from C++. Rather, the
Zoltan copy constructor invokes the C library Zoltan_Copy
program.
Arguments: | |
from | A pointer to the Zoltan_Struct that is to be copied. |
Returned Value: | |
struct Zoltan_Struct * | Pointer to a new Zoltan_Struct, which is now a copy of from. |
C: | int Zoltan_Copy_To (
Zoltan_Struct *to, Zoltan_Struct *from); |
FORTRAN: | FUNCTION Zoltan_Copy_To(to, from)
INTEGER(Zoltan_INT) :: Zoltan_Copy_To TYPE(Zoltan_Struct), INTENT(IN) :: to TYPE(Zoltan_Struct), INTENT(IN) :: from |
C++: | Zoltan & operator= (
const Zoltan &zz); |
The C++ interface to the Zoltan_Copy_To function is through the
Zoltan copy operator, which invokes the C library Zoltan_Copy_To
program.
Arguments: | |
to | A pointer to an existing Zoltan_Struct, the target of the copy. |
from | A pointer to an existing Zoltan_Struct, the source of the copy. |
Returned Value: | |
int | 0 on success and 1 on failure. |
C: | int Zoltan_Set_Param (
struct Zoltan_Struct *zz, char *param_name, char *new_val); |
FORTRAN: | FUNCTION Zoltan_Set_Param(zz, param_name, new_val)
INTEGER(Zoltan_INT) :: Zoltan_Set_Param TYPE(Zoltan_Struct), INTENT(IN) :: zz CHARACTER(LEN=*), INTENT(IN) :: param_name, new_value |
C++: | int Zoltan::Set_Param (
const std::string ¶m_name, const std::string &new_value); |
Arguments: | |
zz | Pointer to the Zoltan structure created by Zoltan_Create. |
param_name | A string containing the name of the parameter to be altered. Note that the string is case-insensitive. Also, different Zoltan structures can have different parameter values. |
new_val | A string containing the new value for the parameter. Example strings include "3.154", "True", "7" or anything appropriate for the parameter being set. As above, the string is case-insensitive. |
Returned Value: | |
int | Error code. |
C: | int Zoltan_Set_Param_Vec (
struct Zoltan_Struct *zz, char *param_name, char *new_val, int index); |
FORTRAN: | FUNCTION Zoltan_Set_Param_Vec(zz, param_name, new_val, index)
INTEGER(Zoltan_INT) :: Zoltan_Set_Param_Vec TYPE(Zoltan_Struct), INTENT(IN) :: zz CHARACTER(LEN=*), INTENT(IN) :: param_name, new_value INTEGER(Zoltan_INT), INTENT(IN) :: index |
C++: | int Zoltan::Set_Param_Vec (
const std::string ¶m_name, const std::string &new_val, const int &index); |
Arguments: | |
zz | Pointer to the Zoltan structure created by Zoltan_Create. |
param_name | A string containing the name of the parameter to be altered. Note that the string is case-insensitive. Also, different Zoltan structures can have different parameter values. |
new_val | A string containing the new value for the parameter. Example strings include "3.154", "True", "7" or anything appropriate for the parameter being set. As above, the string is case-insensitive. |
index | The index of the entry of the vector parameter to be set. The default in Zoltan is that the first entry in a vector has index 0 (C-style indexing). |
Returned Value: | |
int | Error code. |
C: | int Zoltan_Set_Fn (
struct Zoltan_Struct *zz, ZOLTAN_FN_TYPE fn_type, void (*fn_ptr)(), void *data); |
FORTRAN: | FUNCTION Zoltan_Set_Fn(zz, fn_type, fn_ptr, data)
INTEGER(Zoltan_INT) :: Zoltan_Set_Fn TYPE(Zoltan_Struct), INTENT(IN) :: zz TYPE(ZOLTAN_FN_TYPE), INTENT(IN) :: fn_type EXTERNAL :: fn_ptr <type-data>, OPTIONAL :: data <type-data> can be any of INTEGER(Zoltan_INT), DIMENSION(*) or REAL(Zoltan_FLOAT), DIMENSION(*) or REAL(Zoltan_DOUBLE), DIMENSION(*) or TYPE(Zoltan_User_Data_x) where x is 1, 2, 3 or 4. See the section on Fortran query functions for an explanation. |
C++: | int Zoltan::Set_Fn (
const ZOLTAN_FN_TYPE &fn_type, void (*fn_ptr)(), void *data = 0); |
Arguments: | |
zz | Pointer to the Zoltan structure created by Zoltan_Create. |
fn_type | The type of function being registered; see Application-Registered Query Functions for possible function types. |
fn_ptr | A pointer to the application-supplied query function being registered. |
data | A pointer to user defined data that will be passed, as an argument, to the function pointed to by fn_ptr. In C it may be NULL. In Fortran it may be omitted. |
Returned Value: | |
int | Error code. |
C: | int Zoltan_Set_<zoltan_fn_type>_Fn (
struct Zoltan_Struct *zz, <zoltan_fn_type> (*fn_ptr)(), void *data); |
FORTRAN: | FUNCTION Zoltan_Set_<zoltan_fn_type>_Fn(zz, fn_ptr,
data)
INTEGER(Zoltan_INT) :: Zoltan_Set_<zoltan_fn_type>_Fn TYPE(Zoltan_Struct), INTENT(IN) :: zz EXTERNAL :: fn_ptr <type-data>, OPTIONAL :: data An interface block for fn_ptr is included in the FUNCTION definition so that strict type-checking of the registered query function can be done. <type-data> can be any of INTEGER(Zoltan_INT), DIMENSION(*) or REAL(Zoltan_FLOAT), DIMENSION(*) or REAL(Zoltan_DOUBLE), DIMENSION(*) or TYPE(Zoltan_User_Data_x) where x is 1, 2, 3 or 4. See the section on Fortran query functions for an explanation. |
C++: | int Zoltan::Set_<zoltan_fn_type>_Fn (
<zoltan_fn_type> (*fn_ptr)(), void *data = 0); |
Query functions can be registered using either Zoltan_Set_Fn
or Zoltan_Set_<zoltan_fn_type>_Fn.
Zoltan_Set_<zoltan_fn_type>_Fn provides strict type
checking of the fn_ptr argument; the argument's type is specified
for each
Zoltan_Set_<zoltan_fn_type>_Fn. Zoltan_Set_Fn
does not provide this strict type checking, as the pointer to the registered
function is cast to a void pointer.
Arguments: | |
zz | Pointer to the Zoltan structure created by Zoltan_Create. |
fn_ptr | A pointer to the application-supplied query function being registered. The type of the pointer matches <zoltan_fn_type> in the name Zoltan_Set_<zoltan_fn_type>_Fn. |
data | A pointer to user defined data that will be passed, as an argument, to the function pointed to by fn_ptr. In C it may be NULL. In Fortran it may be omitted. |
Returned Value: | |
int | Error code. |
Example: | |
The interface function
int Zoltan_Set_Geom_Fn(struct Zoltan_Struct *zz, ZOLTAN_GEOM_FN (*fn_ptr)(), void *data); registers an ZOLTAN_GEOM_FN query function. |
C: | void Zoltan_Destroy (
struct Zoltan_Struct **zz); |
FORTRAN: | SUBROUTINE Zoltan_Destroy(zz)
TYPE(Zoltan_Struct), POINTER :: zz |
C++: | ~Zoltan (); |
There is no explicit Destroy method in the C++ interface. The Zoltan object is destroyed when the destructor executes.
As a side effect, Zoltan_Destroy (and the C++ Zoltan
destructor) frees the MPI communicator that
had been allocated for the structure. So it is important that the
application does not call MPI_Finalize before it calls
Zoltan_Destroy or before the destructor executes.
Arguments: | |
zz | A pointer to the address of the Zoltan structure, created by Zoltan_Create, to be destroyed. |