Data Structures | |
struct | tclmpi_comm |
struct | tclmpi_dblint |
struct | tclmpi_intint |
struct | tclmpi_req |
Macros | |
#define | TCLMPI_LABEL_SIZE 32 |
#define | TCLMPI_TOZERO -4 |
#define | TCLMPI_ABORT -3 |
#define | TCLMPI_ERROR -2 |
#define | TCLMPI_INVALID -1 |
#define | TCLMPI_NONE 0 |
#define | TCLMPI_AUTO 1 |
#define | TCLMPI_INT 2 |
#define | TCLMPI_INT_INT 3 |
#define | TCLMPI_DOUBLE 4 |
#define | TCLMPI_DOUBLE_INT 5 |
#define | TCLMPI_CONV_CHECK(type, in, out, assign) |
Typedefs | |
typedef struct tclmpi_comm | tclmpi_comm_t |
typedef struct tclmpi_dblint | tclmpi_dblint_t |
typedef struct tclmpi_intint | tclmpi_intint_t |
typedef struct tclmpi_req | tclmpi_req_t |
Functions | |
static const char * | mpi2tcl_comm (MPI_Comm comm) |
static MPI_Comm | tcl2mpi_comm (const char *label) |
static const char * | tclmpi_add_comm (MPI_Comm comm) |
static int | tclmpi_del_comm (const char *label) |
static int | tclmpi_get_op (const char *opstr, MPI_Op *op) |
static const char * | tclmpi_add_req () |
static tclmpi_req_t * | tclmpi_find_req (const char *label) |
static int | tclmpi_del_req (tclmpi_req_t *req) |
static int | tclmpi_datatype (const char *type) |
static int | tclmpi_errcheck (Tcl_Interp *interp, int ierr, Tcl_Obj *obj) |
static int | tclmpi_commcheck (Tcl_Interp *interp, MPI_Comm comm, Tcl_Obj *obj0, Tcl_Obj *obj1) |
static int | tclmpi_typecheck (Tcl_Interp *interp, int type, Tcl_Obj *obj0, Tcl_Obj *obj1) |
Variables | |
static tclmpi_comm_t * | first_comm = NULL |
static tclmpi_comm_t * | last_comm = NULL |
static int | tclmpi_comm_cntr = 0 |
static MPI_Comm | MPI_COMM_INVALID |
static tclmpi_req_t * | first_req = NULL |
static int | tclmpi_req_cntr = 0 |
static int | tclmpi_conv_handler = TCLMPI_ERROR |
static char | tclmpi_errmsg [MPI_MAX_ERROR_STRING] |
#define TCLMPI_ABORT -3 |
abort on problems
#define TCLMPI_AUTO 1 |
the tcl native data type (string)
#define TCLMPI_CONV_CHECK | ( | type, | |
in, | |||
out, | |||
assign | |||
) |
Data conversion with with error handling
type | Tcl data type for calling Tcl_Get<Type>FromObj() |
in | pointer to input object for conversion |
out | pointer to output storage for conversion |
assign | target to assign a zero to for TCLMPI_TOZERO |
This macro enables consistent handling of data conversions. It also queries the tclmpi_conv_handler variable to jump to the selected conversion error behavior. For TCLMPI_ERROR (the default) a Tcl error is raised and TclMPI returns to the calling function. For TCLMPI_ABORT and error message is written to stderr and parallel execution on the current communicator is terminated via MPI_Abort(). For TCLMPI_TOZERO the error is silently ignored and the data element handed in as assign parameter is set to zero.
#define TCLMPI_DOUBLE 4 |
floating point data type
#define TCLMPI_DOUBLE_INT 5 |
data type for double/integer pair
#define TCLMPI_ERROR -2 |
flag problems as Tcl errors
#define TCLMPI_INT 2 |
data type for integers
#define TCLMPI_INT_INT 3 |
data type for pairs of integers
#define TCLMPI_INVALID -1 |
not ready to handle data
#define TCLMPI_LABEL_SIZE 32 |
Size of stringbuffer for tclmpi labels
#define TCLMPI_NONE 0 |
no data type assigned
#define TCLMPI_TOZERO -4 |
convert problematic data items to zero
typedef struct tclmpi_comm tclmpi_comm_t |
Linked list entry type for managing MPI communicators
typedef struct tclmpi_dblint tclmpi_dblint_t |
Data type for maxloc/minloc reductions with a double and an integer
typedef struct tclmpi_intint tclmpi_intint_t |
Data type for maxloc/minloc reductions with two integers
typedef struct tclmpi_req tclmpi_req_t |
Linked list entry type for managing MPI requests
|
static |
Translate an MPI communicator to its Tcl label.
comm | an MPI communicator |
This function will search through the linked list of known communicators until it finds the (first) match and then returns the string label to the calling function. If a NULL is returned, the communicator does not yet exist in the linked list.
|
static |
Translate a Tcl communicator label into the MPI communicator it represents.
label | the Tcl name for the communicator |
This function will search through the linked list of known communicators until it finds the (first) match and then returns the string label to the calling function. If a NULL is returned, the communicator does not yet exist in the linked list.
|
static |
Add an MPI communicator to the linked list of communicators, if needed.
comm | an MPI communicator |
This function will first call mpi2tcl_comm in order to see, if the communicator handed in, is already listed and return that communicators Tcl label string. If it is not yet lists, a new entry is added to the linked list and a new label of the format "tclmpi::comm%d" assigned. The (global/static) variable tclmpi_comm_cntr is incremented every time to make the communicator label unique.
|
static |
Allocate and add an entry to the request map linked list
This function will allocate and initialize a new linked list entry for the translation between MPI requests and their string representation passed to Tcl scripts. The assigned label of the for "tclmpi::req%d" will be returned. The (global/static) variable tclmpi_req_cntr is incremented every time to make the communicator label unique.
|
static |
convenience function to report an unknown communicator as Tcl error
interp | current Tcl interpreter |
comm | MPI communicator |
obj0 | Tcl object representing the current command name |
obj1 | Tcl object representing the communicator as Tcl name |
|
static |
convert a string describing a data type to a numeric representation
|
static |
Remove an MPI communicator from the linked list of communicators
label | the Tcl name for the communicator |
This function will find the entry in the linked list that matches the Tcl label string, remove it and free the associated resources.
|
static |
remove tclmpi_req_t entry from the request linked list
req | a pointer to the request in question |
This function will search through the linked list of known MPI requests until it finds the (first) match and then will remove it from the linked and free the allocated storage. If TCL_ERROR is returned, the request did not exist in the linked list.
|
static |
convert MPI error code to Tcl error error message and append to result
interp | current Tcl interpreter |
ierr | MPI error number. return value of an MPI call. |
obj | Tcl object representing the current command name |
This is a convenience wrapper that will use MPI_Error_string() to convert any error code returned from MPI function calls to the respective error class and that into a string. This string is appended to the Tcl result vector of the current command. Should be called after each MPI call. Since we change error handlers on all communicators to not result in fatal errors, we have to generate Tcl errors instead (which can be caught).
|
static |
translate Tcl representation of an MPI request to request itself.
label | the Tcl name for the communicator |
This function will search through the linked list of known MPI requests until it finds the (first) match and then returns a pointer to this data. If NULL is returned, the communicator does not exist in the linked list.
|
static |
Translate TclMPI strings to MPI constants for reductions
opstr | string constant describing the operator |
op | pointer to location for storing the MPI constant |
This is a convenience function to consistently convert TclMPI string constants representing reduction operators to their corresponding MPI counterparts.
|
static |
convenience function to report an unknown data type as Tcl error
interp | current Tcl interpreter |
type | TclMPI data type |
obj0 | Tcl object representing the current command name |
obj1 | Tcl object representing the data type as Tcl name |
|
static |
First element of the communicator map list
|
static |
First element of the list of generated requests
|
static |
Last element of the communicator map list
|
static |
Additional global communicator to detect unlisted communicators
|
static |
Communicator counter. Incremented to get unique strings
|
static |
Selects what to do when a data element in a list cannot be successfully converted to the desired data type. Default is to throw a Tcl error.
|
static |
buffer for error messages.
|
static |
Request counter. Incremented to get unique strings