Molssi Driver Interface Library
|
Global structures used by MDI. More...
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <stdint.h>
#include <stdarg.h>
#include "mdi_global.h"
Functions | |
int | vector_init (vector *v, size_t stride) |
Initialize memory allocation for a vector structure. More... | |
int | vector_push_back (vector *v, void *element) |
Append a new element to the end of the vector. More... | |
int | vector_delete (vector *v, int index) |
Remove an element from a vector. More... | |
int | vector_free (vector *v) |
Free all data associated with a vector. More... | |
int | vector_get (vector *v, int index, void **element) |
Return a pointer to an element of a vector. More... | |
int | get_node_index (vector *v, const char *node_name, int *node_index) |
Determine the index of a node within a vector of nodes. More... | |
int | get_command_index (node *n, const char *command_name, int *command_index) |
Determine the index of a command within a node. More... | |
int | get_callback_index (node *n, const char *callback_name, int *callback_index) |
Determine the index of a callback within a node. More... | |
int | free_node_vector (vector *v) |
Determine the index of a callback within a node. | |
int | new_code (size_t *code_id) |
Create a new code structure and add it to the list of codes Returns the index of the new code. | |
int | get_code (size_t code_id, code **ret_code) |
Get a code from a code handle Returns a pointer to the code. | |
int | get_current_code (code **this_code_ptr) |
Get the currently active code Returns a pointer to the code. | |
int | delete_code (size_t code_id) |
Delete a code Returns 0 on success. | |
int | new_method (size_t code_id, int method_id, int *id_ptr) |
Create a new method structure and add it to the vector of methods Returns the handle of the new method. | |
int | get_method (size_t code_id, int method_id, method **method_ptr) |
Get a method from a method handle Returns a pointer to the method. | |
int | delete_method (size_t code_id, int method_id) |
Delete a method Returns 0 on success. | |
int | free_methods_vector (vector *v) |
Free the memory associated with a methods vector. | |
int | new_communicator (size_t code_id, int method, MDI_Comm_Type *comm_id_ptr) |
Create a new communicator structure and add it to the list of communicators Returns the handle of the new communicator. | |
int | get_communicator (size_t code_id, MDI_Comm_Type comm_id, communicator **comm_ptr) |
Get a communicator from a communicator handle Returns a pointer to the communicator. | |
int | delete_communicator (size_t code_id, MDI_Comm_Type comm_id) |
Delete a communicator. More... | |
int | communicator_delete (void *comm) |
Dummy function for method-specific deletion operations for communicator deletion. | |
int | file_exists (const char *file_name, int *flag) |
Print error message and exit. More... | |
void | mdi_error (const char *message) |
Print error message. More... | |
void | mdi_warning (const char *message) |
Print warning message. More... | |
int | mdi_debug (const char *message,...) |
Print a debug message. More... | |
int | datatype_info (MDI_Datatype_Type datatype, size_t *size, MDI_Datatype_Type *base) |
Get information about an MDI datatype. More... | |
int | datatype_mpitype (MDI_Datatype_Type datatype, MPI_Datatype *mpitype) |
Get the MPI datatype that corresponds to an MDI datatype. More... | |
int | convert_buf_datatype (void *recvbuf_in, MDI_Datatype_Type recvtype, void *sendbuf_in, MDI_Datatype_Type sendtype, int count) |
Convert a buffer from one datatype to another. | |
Variables | |
vector | codes = { .initialized = 0 } |
Vector containing all codes that have been initiailized on this rank Typically, this will only include a single code, unless the communication method is LIBRARY. More... | |
Global structures used by MDI.
int datatype_info | ( | MDI_Datatype_Type | datatype, |
size_t * | size, | ||
MDI_Datatype_Type * | base | ||
) |
Get information about an MDI datatype.
Get information about an MDI_Datatype.
[in] | datatype | MDI datatype. |
[out] | size | Size of the MDI datatype. |
[out] | base | Base type of an MDI datatype. |
int datatype_mpitype | ( | MDI_Datatype_Type | datatype, |
MPI_Datatype * | mpitype | ||
) |
Get the MPI datatype that corresponds to an MDI datatype.
[in] | datatype | MDI datatype. |
[out] | mpitype | MPI datatype. |
int delete_communicator | ( | size_t | code_id, |
MDI_Comm_Type | comm_id | ||
) |
Delete a communicator.
The function returns 0
on a success.
int file_exists | ( | const char * | file_name, |
int * | flag | ||
) |
Print error message and exit.
Check whether a file exists.
[in] | message | Message printed before exiting. |
int get_callback_index | ( | node * | n, |
const char * | callback_name, | ||
int * | callback_index | ||
) |
Determine the index of a callback within a node.
[in] | node | Pointer to the node |
[in] | callback_name | Name of the callback |
int get_command_index | ( | node * | n, |
const char * | command_name, | ||
int * | command_index | ||
) |
Determine the index of a command within a node.
[in] | node | Pointer to the node |
[in] | command_name | Name of the command |
int get_node_index | ( | vector * | v, |
const char * | node_name, | ||
int * | node_index | ||
) |
Determine the index of a node within a vector of nodes.
[in] | v | Pointer to the vector |
[in] | node_name | Name of the node |
int mdi_debug | ( | const char * | message, |
... | |||
) |
Print a debug message.
[in] | message | Message printed before exiting. |
void mdi_error | ( | const char * | message | ) |
Print error message.
[in] | message | Message printed before exiting. |
void mdi_warning | ( | const char * | message | ) |
Print warning message.
[in] | message | Message printed before exiting. |
int vector_delete | ( | vector * | v, |
int | index | ||
) |
Remove an element from a vector.
The function returns 0
on a success.
[in] | v | Pointer to the vector from which the element will be removed |
[in] | index | Index of the element that will be removed from the vector |
int vector_free | ( | vector * | v | ) |
Free all data associated with a vector.
The function returns 0
on a success.
[in] | v | Pointer to the vector that will be freed |
int vector_get | ( | vector * | v, |
int | index, | ||
void ** | element | ||
) |
Return a pointer to an element of a vector.
The function returns 0
on a success.
[in] | v | Pointer to the vector |
[in] | index | Index of the element within the vector |
int vector_init | ( | vector * | v, |
size_t | stride | ||
) |
Initialize memory allocation for a vector structure.
The function returns 0
on a success.
[in] | v | Pointer to the vector structure for which the memory will be allocated |
[in] | stride | Stride of the vector |
int vector_push_back | ( | vector * | v, |
void * | element | ||
) |
Append a new element to the end of the vector.
The function returns 0
on a success.
[in] | v | Pointer to the vector to which the element will be appended |
[in] | element | Pointer to the element that will be appended to the vector |
vector codes = { .initialized = 0 } |
Vector containing all codes that have been initiailized on this rank Typically, this will only include a single code, unless the communication method is LIBRARY.
Vector containing all codes that have been initiailized on this rank. Typically, this will only include a single code, unless the communication method is LINK. ALL global MDI data is stored within this vector.