OpenMPI
0.1.1
|
See opal_bitmap.h for an explanation of why there is a split between OPAL and ORTE for this generic class. More...
Go to the source code of this file.
Data Structures | |
struct | opal_pointer_array_t |
dynamic pointer array More... | |
Typedefs | |
typedef struct opal_pointer_array_t | opal_pointer_array_t |
Convenience typedef. | |
Functions | |
OPAL_DECLSPEC | OBJ_CLASS_DECLARATION (opal_pointer_array_t) |
Class declaration. | |
OPAL_DECLSPEC int | opal_pointer_array_init (opal_pointer_array_t *array, int initial_allocation, int max_size, int block_size) |
Initialize the pointer array with an initial size of initial_allocation. More... | |
OPAL_DECLSPEC int | opal_pointer_array_add (opal_pointer_array_t *array, void *ptr) |
Add a pointer to the array (Grow the array, if need be) More... | |
OPAL_DECLSPEC int | opal_pointer_array_set_item (opal_pointer_array_t *array, int index, void *value) |
Set the value of an element in array. More... | |
static void * | opal_pointer_array_get_item (opal_pointer_array_t *table, int element_index) |
Get the value of an element in array. More... | |
static int | opal_pointer_array_get_size (opal_pointer_array_t *array) |
Get the size of the pointer array. More... | |
OPAL_DECLSPEC int | opal_pointer_array_set_size (opal_pointer_array_t *array, int size) |
Set the size of the pointer array. More... | |
OPAL_DECLSPEC bool | opal_pointer_array_test_and_set_item (opal_pointer_array_t *table, int index, void *value) |
Test whether a certain element is already in use. More... | |
static void | opal_pointer_array_remove_all (opal_pointer_array_t *array) |
Empty the array. More... | |
See opal_bitmap.h for an explanation of why there is a split between OPAL and ORTE for this generic class.
Utility functions to manage fortran <-> c opaque object translation. Note that since MPI defines fortran handles as [signed] int's, we use int everywhere in here where you would normally expect size_t. There's some code that makes sure indices don't go above FORTRAN_HANDLE_MAX (which is min(INT_MAX, fortran INTEGER max)), just to be sure.
OPAL_DECLSPEC int opal_pointer_array_add | ( | opal_pointer_array_t * | table, |
void * | ptr | ||
) |
Add a pointer to the array (Grow the array, if need be)
array | Pointer to array (IN) |
ptr | Pointer value (IN) |
Add a pointer to the array (Grow the array, if need be)
table | Pointer to opal_pointer_array_t object (IN) |
ptr | Pointer to be added to table (IN) |
References opal_pointer_array_t::addr, opal_pointer_array_t::lock, opal_pointer_array_t::lowest_free, opal_pointer_array_t::number_free, OPAL_THREAD_LOCK, OPAL_THREAD_UNLOCK, and opal_pointer_array_t::size.
Referenced by ompi_request_init(), opal_graph_get_graph_vertices(), orte_ras_base_node_insert(), and orte_sensor_base_select().
|
inlinestatic |
Get the value of an element in array.
array | Pointer to array (IN) |
element_index | Index of element to be returned (IN) |
References opal_pointer_array_t::addr, opal_pointer_array_t::lock, OPAL_THREAD_LOCK, OPAL_THREAD_UNLOCK, and opal_pointer_array_t::size.
Referenced by btl_openib_handle_failover_control_messages(), mca_btl_openib_dump_all_internal_queues(), mca_btl_openib_endpoint_notify(), mca_btl_openib_handle_btl_error(), mca_btl_udapl_component_progress(), mca_btl_udapl_finalize(), ompi_errcode_get_mpi_code(), ompi_mpi_errcode_finalize(), ompi_mpi_errcode_get_class(), ompi_mpi_errnum_add_string(), ompi_mpi_errnum_get_string(), opal_carto_base_duplicate_graph_fn(), opal_carto_base_free_graph_fn(), opal_dss_close(), orte_get_job_data_object(), orte_plm_base_orted_exit(), orte_ras_base_node_insert(), orte_rmaps_base_get_target_nodes(), orte_rml_base_get_contact_info(), and orte_sensor_base_select().
|
inlinestatic |
Get the size of the pointer array.
array | Pointer to array (IN) |
Simple inline function to return the size of the array in order to hide the member field from external users.
References opal_pointer_array_t::size.
Referenced by btl_openib_handle_failover_control_messages(), mca_btl_openib_dump_all_internal_queues(), mca_btl_openib_endpoint_notify(), mca_btl_openib_handle_btl_error(), and opal_dss_close().
OPAL_DECLSPEC int opal_pointer_array_init | ( | opal_pointer_array_t * | array, |
int | initial_allocation, | ||
int | max_size, | ||
int | block_size | ||
) |
Initialize the pointer array with an initial size of initial_allocation.
Set the maximum size of the array, as well as the size of the allocation block for all subsequent growing operations. Remarque: The pointer array has to be created bfore calling this function.
array | Pointer to pointer of an array (IN/OUT) |
initial_allocation | The number of elements in the initial array (IN) |
max_size | The maximum size of the array (IN) |
block_size | The size for all subsequent grows of the array (IN). |
Initialize the pointer array with an initial size of initial_allocation.
References opal_pointer_array_t::addr, opal_pointer_array_t::block_size, opal_pointer_array_t::max_size, opal_pointer_array_t::number_free, and opal_pointer_array_t::size.
Referenced by mca_btl_udapl_init(), ompi_errcode_intern_init(), ompi_errhandler_init(), ompi_group_init(), ompi_mpi_errcode_init(), ompi_request_init(), opal_carto_base_duplicate_graph_fn(), opal_carto_base_free_graph_fn(), opal_dss_open(), and orte_sensor_base_open().
|
inlinestatic |
Empty the array.
array | Pointer to array (IN) |
References opal_pointer_array_t::addr, opal_pointer_array_t::lock, opal_pointer_array_t::lowest_free, opal_pointer_array_t::number_free, OPAL_THREAD_LOCK, OPAL_THREAD_UNLOCK, and opal_pointer_array_t::size.
OPAL_DECLSPEC int opal_pointer_array_set_item | ( | opal_pointer_array_t * | table, |
int | index, | ||
void * | value | ||
) |
Set the value of an element in array.
array | Pointer to array (IN) |
index | Index of element to be reset (IN) |
value | New value to be set at element index (IN) |
Set the value of an element in array.
table | Pointer to opal_pointer_array_t object (IN) |
ptr | Pointer to be added to table (IN) |
Assumption: NULL element is free element.
References opal_pointer_array_t::addr, opal_pointer_array_t::lock, opal_pointer_array_t::lowest_free, opal_pointer_array_t::number_free, opal_output(), OPAL_THREAD_LOCK, OPAL_THREAD_UNLOCK, and opal_pointer_array_t::size.
Referenced by ompi_errcode_intern_init(), ompi_mpi_errclass_add(), ompi_mpi_errcode_add(), opal_dss_close(), and orte_sensor_base_select().
OPAL_DECLSPEC int opal_pointer_array_set_size | ( | opal_pointer_array_t * | array, |
int | size | ||
) |
Set the size of the pointer array.
array | Pointer to array (IN) |
size | Desired size of the array |
Simple function to set the size of the array in order to hide the member field from external users.
References opal_pointer_array_t::lock, OPAL_THREAD_LOCK, OPAL_THREAD_UNLOCK, and opal_pointer_array_t::size.
Referenced by orte_ras_base_node_insert().
OPAL_DECLSPEC bool opal_pointer_array_test_and_set_item | ( | opal_pointer_array_t * | table, |
int | index, | ||
void * | value | ||
) |
Test whether a certain element is already in use.
If not yet in use, reserve it.
array | Pointer to array (IN) |
index | Index of element to be tested (IN) |
value | New value to be set at element index (IN) |
In contrary to array_set, this function does not allow to overwrite a value, unless the previous value is NULL ( equiv. to free ).
If not yet in use, reserve it.
array | Pointer to array (IN) |
index | Index of element to be tested (IN) |
value | New value to be set at element index (IN) |
In contrary to array_set, this function does not allow to overwrite a value, unless the previous value is NULL ( equiv. to free ).
References opal_pointer_array_t::addr, opal_pointer_array_t::lock, opal_pointer_array_t::lowest_free, opal_pointer_array_t::number_free, opal_output(), OPAL_THREAD_LOCK, OPAL_THREAD_UNLOCK, and opal_pointer_array_t::size.