Index: test/class/ompi_pointer_array.c =================================================================== --- test/class/ompi_pointer_array.c (revision 16968) +++ test/class/ompi_pointer_array.c (working copy) @@ -1,158 +0,0 @@ -/* - * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana - * University Research and Technology - * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University - * of Tennessee Research Foundation. All rights - * reserved. - * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, - * University of Stuttgart. All rights reserved. - * Copyright (c) 2004-2005 The Regents of the University of California. - * All rights reserved. - * $COPYRIGHT$ - * - * Additional copyrights may follow - * - * $HEADER$ - */ - -/* - * This test is intended to test the ompi_pointer_array - * class - */ - -#include "ompi_config.h" -#include -#include -#include -#include - -#include "support.h" -#include "ompi/class/ompi_pointer_array.h" - -typedef union { - int ivalue; - char *cvalue; -} value_t; - -static void test(bool thread_usage){ - - /* local variables */ - ompi_pointer_array_t *array; - value_t *test_data; - int len_test_data,i,test_len_in_array,error_cnt; - int ele_index; - int use_threads,error_code; - value_t value; - - /* initialize thread levels */ - use_threads=(int)opal_set_using_threads(thread_usage); - - array=OBJ_NEW(ompi_pointer_array_t); - assert(array); - - len_test_data=5; - test_data=malloc(sizeof(value_t)*len_test_data); - assert(test_data); - - for(i=0 ; i < len_test_data ; i++ ) { - test_data[i].ivalue = (i+1); - } - - /* add data to table */ - test_len_in_array=3; - assert(len_test_data>=test_len_in_array); - for(i=0 ; i < test_len_in_array ; i++ ) { - ompi_pointer_array_add(array,test_data[i].cvalue); - } - /* check to see that test_len_in_array are in array */ - if( (array->size - array->number_free) == test_len_in_array) { - test_success(); - } else { - test_failure("check on number of elments in array"); - } - - /* check order of data */ - error_cnt=0; - for(i=0 ; i < test_len_in_array ; i++ ) { - value.cvalue = array->addr[i]; - if( (i+1) != value.ivalue ) { - error_cnt++; - } - } - if( 0 == error_cnt ) { - test_success(); - } else { - test_failure(" data check "); - } - - /* free 2nd element and make sure that value is reset correctly, - * and that the lowest_index is also reset correctly */ - ele_index=1; - error_code=ompi_pointer_array_set_item(array,ele_index,NULL); - if( 0 == error_code ) { - test_success(); - } else { - test_failure(" ompi_pointer_array_set_item "); - } - if( NULL == array->addr[ele_index]){ - test_success(); - } else { - test_failure(" set pointer value"); - } - if( ele_index == array->lowest_free ) { - test_success(); - } else { - test_failure(" lowest free "); - } - - /* test ompi_pointer_array_get_item */ - array->number_free=array->size; - array->lowest_free=0; - for(i=0 ; i < array->size ; i++ ) { - array->addr[i] = NULL; - } - error_cnt=0; - for(i=0 ; i < array->size ; i++ ) { - value.ivalue = i + 2; - ele_index=ompi_pointer_array_add(array, value.cvalue); - if( i != ele_index ) { - error_cnt++; - } - } - if( 0 == error_cnt ) { - test_success(); - } else { - test_failure(" ompi_pointer_array_add 2nd "); - } - - error_cnt=0; - for(i=0 ; i < array->size ; i++ ) { - value.cvalue = ompi_pointer_array_get_item(array,i); - if( (i+2) != value.ivalue ) { - error_cnt++; - } - } - if( 0 == error_cnt ) { - test_success(); - } else { - test_failure(" data check - 2nd "); - } - - free (array); - free(test_data); -} - - -int main(int argc, char **argv) -{ - test_init("ompi_pointer_array"); - - /* run through tests with thread usage set to false */ - test(false); - - /* run through tests with thread usage set to true */ - test(true); - - return test_finalize(); -} Index: test/class/Makefile.am =================================================================== --- test/class/Makefile.am (revision 16968) +++ test/class/Makefile.am (working copy) @@ -3,7 +3,7 @@ # Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana # University Research and Technology # Corporation. All rights reserved. -# Copyright (c) 2004-2005 The University of Tennessee and The University +# Copyright (c) 2004-2007 The University of Tennessee and The University # of Tennessee Research Foundation. All rights # reserved. # Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -24,7 +24,7 @@ opal_hash_table \ opal_list \ opal_value_array \ - ompi_pointer_array \ + opal_pointer_array \ ompi_rb_tree TESTS = \ @@ -66,13 +66,13 @@ $(top_builddir)/test/support/libsupport.a opal_hash_table_DEPENDENCIES = $(opal_hash_table_LDADD) -ompi_pointer_array_SOURCES = ompi_pointer_array.c -ompi_pointer_array_LDADD = \ +opal_pointer_array_SOURCES = opal_pointer_array.c +opal_pointer_array_LDADD = \ $(top_builddir)/ompi/libmpi.la \ $(top_builddir)/orte/libopen-rte.la \ $(top_builddir)/opal/libopen-pal.la \ $(top_builddir)/test/support/libsupport.a -ompi_pointer_array_DEPENDENCIES = $(ompi_pointer_array_LDADD) +opal_pointer_array_DEPENDENCIES = $(opal_pointer_array_LDADD) opal_value_array_SOURCES = opal_value_array.c opal_value_array_LDADD = \ Index: opal/include/opal/sys/ia32/atomic.h =================================================================== --- opal/include/opal/sys/ia32/atomic.h (revision 16968) +++ opal/include/opal/sys/ia32/atomic.h (working copy) @@ -46,7 +46,7 @@ #define OPAL_HAVE_ATOMIC_ADD_32 1 #define OPAL_HAVE_ATOMIC_SUB_32 1 -#define OPAL_HAVE_ATOMIC_CMPSET_64 1 +#define OPAL_HAVE_ATOMIC_CMPSET_64 0 #undef OPAL_HAVE_INLINE_ATOMIC_CMPSET_64 #define OPAL_HAVE_INLINE_ATOMIC_CMPSET_64 0 Index: opal/class/opal_pointer_array.h =================================================================== --- opal/class/opal_pointer_array.h (revision 0) +++ opal/class/opal_pointer_array.h (revision 0) @@ -0,0 +1,207 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2007 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ +/** @file + * + * 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. + */ + +#ifndef OPAL_POINTER_ARRAY_H +#define OPAL_POINTER_ARRAY_H + +#include "opal_config.h" + +#include "opal/threads/mutex.h" +#include "opal/class/opal_object.h" + +BEGIN_C_DECLS + +/** + * dynamic pointer array + */ +struct opal_pointer_array_t { + /** base class */ + opal_object_t super; + /** synchronization object */ + opal_mutex_t lock; + /** Index of lowest free element. NOTE: This is only an + optimization to know where to search for the first free slot. + It does \em not necessarily imply indices all above this index + are not taken! */ + int lowest_free; + /** number of free elements in the list */ + int number_free; + /** size of list, i.e. number of elements in addr */ + int size; + /** maximum size of the array */ + int max_size; + /** block size for each allocation */ + int block_size; + /** pointer to array of pointers */ + void **addr; +}; +/** + * Convenience typedef + */ +typedef struct opal_pointer_array_t opal_pointer_array_t; +/** + * Class declaration + */ +OPAL_DECLSPEC OBJ_CLASS_DECLARATION(opal_pointer_array_t); + +/** + * 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. + * + * @param array Pointer to pointer of an array (IN/OUT) + * @param initial_allocation The number of elements in the initial array (IN) + * @param max_size The maximum size of the array (IN) + * @param block_size The size for all subsequent grows of the array (IN). + * + * @return OPAL_SUCCESS if all initializations were succesfull. Otherwise, + * the error indicate what went wrong in the function. + */ +OPAL_DECLSPEC int opal_pointer_array_init( opal_pointer_array_t* array, + int initial_allocation, + int max_size, int block_size ); + +/** + * Add a pointer to the array (Grow the array, if need be) + * + * @param array Pointer to array (IN) + * @param ptr Pointer value (IN) + * + * @return Index of inserted array element. Return value of + * (-1) indicates an error. + */ +OPAL_DECLSPEC int opal_pointer_array_add(opal_pointer_array_t *array, void *ptr); + +/** + * Set the value of an element in array + * + * @param array Pointer to array (IN) + * @param index Index of element to be reset (IN) + * @param value New value to be set at element index (IN) + * + * @return Error code. (-1) indicates an error. + */ +OPAL_DECLSPEC int opal_pointer_array_set_item(opal_pointer_array_t *array, + int index, void *value); + +/** + * Get the value of an element in array + * + * @param array Pointer to array (IN) + * @param element_index Index of element to be returned (IN) + * + * @return Error code. NULL indicates an error. + */ + +static inline void *opal_pointer_array_get_item(opal_pointer_array_t *table, + int element_index) +{ + void *p; + + if( table->size <= element_index ) { + return NULL; + } + OPAL_THREAD_LOCK(&(table->lock)); + p = table->addr[element_index]; + OPAL_THREAD_UNLOCK(&(table->lock)); + return p; +} + + +/** + * Get the size of the pointer array + * + * @param array Pointer to array (IN) + * + * @returns size Size of the array + * + * Simple inline function to return the size of the array in order to + * hide the member field from external users. + */ +static inline int opal_pointer_array_get_size(opal_pointer_array_t *array) +{ + return array->size; +} + +/** + * Set the size of the pointer array + * + * @param array Pointer to array (IN) + * + * @param 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. + */ +OPAL_DECLSPEC int opal_pointer_array_set_size(opal_pointer_array_t *array, int size); + +/** + * Test whether a certain element is already in use. If not yet + * in use, reserve it. + * + * @param array Pointer to array (IN) + * @param index Index of element to be tested (IN) + * @param value New value to be set at element index (IN) + * + * @return true/false True if element could be reserved + * False if element could not be reserved (e.g., in use). + * + * In contrary to array_set, this function does not allow to overwrite + * a value, unless the previous value is NULL ( equiv. to free ). + */ +OPAL_DECLSPEC bool opal_pointer_array_test_and_set_item (opal_pointer_array_t *table, + int index, + void *value); + +/** + * Empty the array. + * + * @param array Pointer to array (IN) + * + */ +static inline void opal_pointer_array_remove_all(opal_pointer_array_t *array) +{ + int i; + if( array->number_free == array->size ) + return; /* nothing to do here this time (the array is already empty) */ + + OPAL_THREAD_LOCK(&array->lock); + array->lowest_free = 0; + array->number_free = array->size; + for(i=0; isize; i++) { + array->addr[i] = NULL; + } + OPAL_THREAD_UNLOCK(&array->lock); +} + +END_C_DECLS + +#endif /* OPAL_POINTER_ARRAY_H */ Index: opal/class/Makefile.am =================================================================== --- opal/class/Makefile.am (revision 16968) +++ opal/class/Makefile.am (working copy) @@ -3,7 +3,7 @@ # Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana # University Research and Technology # Corporation. All rights reserved. -# Copyright (c) 2004-2005 The University of Tennessee and The University +# Copyright (c) 2004-2007 The University of Tennessee and The University # of Tennessee Research Foundation. All rights # reserved. # Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -26,6 +26,7 @@ class/opal_list.h \ class/opal_object.h \ class/opal_atomic_lifo.h \ + class/opal_pointer_array.h \ class/opal_value_array.h libopen_pal_la_SOURCES += \ @@ -34,4 +35,5 @@ class/opal_list.c \ class/opal_object.c \ class/opal_atomic_lifo.c \ + class/opal_pointer_array.c \ class/opal_value_array.c Index: opal/class/opal_pointer_array.c =================================================================== --- opal/class/opal_pointer_array.c (revision 0) +++ opal/class/opal_pointer_array.c (revision 0) @@ -0,0 +1,336 @@ +/* + * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana + * University Research and Technology + * Corporation. All rights reserved. + * Copyright (c) 2004-2007 The University of Tennessee and The University + * of Tennessee Research Foundation. All rights + * reserved. + * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, + * University of Stuttgart. All rights reserved. + * Copyright (c) 2004-2005 The Regents of the University of California. + * All rights reserved. + * $COPYRIGHT$ + * + * Additional copyrights may follow + * + * $HEADER$ + */ + +#include "opal_config.h" + +#include +#include +#include + +#include "opal/constants.h" +#include "opal/class/opal_pointer_array.h" +#include "opal/util/output.h" + +enum { TABLE_INIT = 1, TABLE_GROW = 2 }; + +static void opal_pointer_array_construct(opal_pointer_array_t *); +static void opal_pointer_array_destruct(opal_pointer_array_t *); +static bool grow_table(opal_pointer_array_t *table, int soft, int hard); + +OBJ_CLASS_INSTANCE(opal_pointer_array_t, opal_object_t, + opal_pointer_array_construct, + opal_pointer_array_destruct); + +/* + * opal_pointer_array constructor + */ +static void opal_pointer_array_construct(opal_pointer_array_t *array) +{ + OBJ_CONSTRUCT(&array->lock, opal_mutex_t); + array->lowest_free = 0; + array->number_free = 0; + array->size = 0; + array->max_size = INT_MAX; + array->block_size = 0; + array->addr = 0; +} + +/* + * opal_pointer_array destructor + */ +static void opal_pointer_array_destruct(opal_pointer_array_t *array) +{ + /* free table */ + if( NULL != array->addr) { + free(array->addr); + } + + OBJ_DESTRUCT(&array->lock); +} + +/** + * initialize an array object + */ +int opal_pointer_array_init(opal_pointer_array_t* array, + int initial_allocation, + int max_size, int block_size) +{ + size_t num_bytes; + + /* check for errors */ + if (NULL == array || max_size < block_size) { + return OPAL_ERR_BAD_PARAM; + } + + array->max_size = max_size; + array->block_size = block_size; + + num_bytes = (0 < initial_allocation ? initial_allocation : block_size); + array->number_free = num_bytes; + array->size = num_bytes; + num_bytes *= sizeof(void*); + + /* Allocate and set the array to NULL */ + array->addr = (void **)calloc(num_bytes, 1); + if (NULL == array->addr) { /* out of memory */ + return OPAL_ERR_OUT_OF_RESOURCE; + } + + return OPAL_SUCCESS; +} + +/** + * add a pointer to dynamic pointer table + * + * @param table Pointer to opal_pointer_array_t object (IN) + * @param ptr Pointer to be added to table (IN) + * + * @return Array index where ptr is inserted or OPAL_ERROR if it fails + */ +int opal_pointer_array_add(opal_pointer_array_t *table, void *ptr) +{ + int i, index; + + OPAL_THREAD_LOCK(&(table->lock)); + + if (table->number_free == 0) { + /* need to grow table */ + if (!grow_table(table, + (NULL == table->addr ? TABLE_INIT : table->size * TABLE_GROW), + OMPI_FORTRAN_HANDLE_MAX)) { + OPAL_THREAD_UNLOCK(&(table->lock)); + return OPAL_ERR_OUT_OF_RESOURCE; + } + } + + assert( (table->addr != NULL) && (table->size > 0) ); + assert( (table->lowest_free >= 0) && (table->lowest_free < table->size) ); + assert( (table->number_free > 0) && (table->number_free <= table->size) ); + + /* + * add pointer to table, and return the index + */ + + index = table->lowest_free; + assert(table->addr[index] == NULL); + table->addr[index] = ptr; + table->number_free--; + if (table->number_free > 0) { + for (i = table->lowest_free + 1; i < table->size; i++) { + if (table->addr[i] == NULL) { + table->lowest_free = i; + break; + } + } + } + else { + table->lowest_free = table->size; + } + + OPAL_THREAD_UNLOCK(&(table->lock)); + return index; +} + +/** + * Set the value of the dynamic array at a specified location. + * + * + * @param table Pointer to opal_pointer_array_t object (IN) + * @param ptr Pointer to be added to table (IN) + * + * @return Error code + * + * Assumption: NULL element is free element. + */ +int opal_pointer_array_set_item(opal_pointer_array_t *table, int index, + void * value) +{ + assert(table != NULL); + + /* expand table if required to set a specific index */ + + OPAL_THREAD_LOCK(&(table->lock)); + if (table->size <= index) { + if (!grow_table(table, ((index / TABLE_GROW) + 1) * TABLE_GROW, + index)) { + OPAL_THREAD_UNLOCK(&(table->lock)); + return OPAL_ERROR; + } + } + + /* mark element as free, if NULL element */ + if( NULL == value ) { + if (index < table->lowest_free) { + table->lowest_free = index; + } + if( NULL != table->addr[index] ) { + table->number_free++; + } + } else { + /* Reset lowest_free if required */ + if ( index == table->lowest_free ) { + int i; + + table->lowest_free = table->size; + for ( i=index; isize; i++) { + if ( NULL == table->addr[i] ){ + table->lowest_free = i; + break; + } + } + } + } + table->addr[index] = value; + +#if 0 + opal_output(0,"opal_pointer_array_set_item: OUT: " + " table %p (size %ld, lowest free %ld, number free %ld)" + " addr[%d] = %p\n", + table, table->size, table->lowest_free, table->number_free, + index, table->addr[index]); +#endif + + OPAL_THREAD_UNLOCK(&(table->lock)); + return OPAL_SUCCESS; +} + +/** + * Test whether a certain element is already in use. If not yet + * in use, reserve it. + * + * @param array Pointer to array (IN) + * @param index Index of element to be tested (IN) + * @param value New value to be set at element index (IN) + * + * @return true/false True if element could be reserved + * False if element could not be reserved (e.g.in use). + * + * In contrary to array_set, this function does not allow to overwrite + * a value, unless the previous value is NULL ( equiv. to free ). + */ +bool opal_pointer_array_test_and_set_item (opal_pointer_array_t *table, + int index, void *value) +{ + assert(table != NULL); + assert(index >= 0); + +#if 0 + opal_output(0,"opal_pointer_array_test_and_set_item: IN: " + " table %p (size %ld, lowest free %ld, number free %ld)" + " addr[%d] = %p\n", + table, table->size, table->lowest_free, table->number_free, + index, table->addr[index]); +#endif + + /* expand table if required to set a specific index */ + OPAL_THREAD_LOCK(&(table->lock)); + if ( index < table->size && table->addr[index] != NULL ) { + /* This element is already in use */ + OPAL_THREAD_UNLOCK(&(table->lock)); + return false; + } + + /* Do we need to grow the table? */ + + if (table->size <= index) { + if (!grow_table(table, (((index / TABLE_GROW) + 1) * TABLE_GROW), + index)) { + OPAL_THREAD_UNLOCK(&(table->lock)); + return false; + } + } + + /* + * allow a specific index to be changed. + */ + table->addr[index] = value; + table->number_free--; + /* Reset lowest_free if required */ + if ( index == table->lowest_free ) { + int i; + + table->lowest_free = table->size; + for ( i=index; isize; i++) { + if ( NULL == table->addr[i] ){ + table->lowest_free = i; + break; + } + } + } + +#if 0 + opal_output(0,"opal_pointer_array_test_and_set_item: OUT: " + " table %p (size %ld, lowest free %ld, number free %ld)" + " addr[%d] = %p\n", + table, table->size, table->lowest_free, table->number_free, + index, table->addr[index]); +#endif + + OPAL_THREAD_UNLOCK(&(table->lock)); + return true; +} + +int opal_pointer_array_set_size(opal_pointer_array_t *array, int new_size) +{ + OPAL_THREAD_LOCK(&(array->lock)); + if(new_size > array->size) { + if (!grow_table(array, new_size, new_size)) { + OPAL_THREAD_UNLOCK(&(array->lock)); + return OPAL_ERROR; + } + } + OPAL_THREAD_UNLOCK(&(array->lock)); + return OPAL_SUCCESS; +} + +static bool grow_table(opal_pointer_array_t *table, int soft, int hard) +{ + int new_size, i, new_size_int; + void *p; + + /* new_size = ((table->size + num_needed + table->block_size - 1) / + table->block_size) * table->block_size; */ + new_size = soft; + if( soft > table->max_size ) { + if( hard > table->max_size ) { + return false; + } + new_size = hard; + } + if( new_size >= table->max_size ) { + return false; + } + + p = (void **) realloc(table->addr, new_size * sizeof(void *)); + if (p == NULL) { + return false; + } + + /* We've already established (above) that the arithmetic + below will be less than OMPI_FORTRAN_HANDLE_MAX */ + + new_size_int = (int) new_size; + table->number_free += new_size_int - table->size; + table->addr = (void**)p; + for (i = table->size; i < new_size_int; ++i) { + table->addr[i] = NULL; + } + table->size = new_size_int; + + return true; +} Index: ompi/file/file.c =================================================================== --- ompi/file/file.c (revision 16968) +++ ompi/file/file.c (working copy) @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2007 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -28,7 +28,7 @@ /* * Table for Fortran <-> C file handle conversion */ -ompi_pointer_array_t ompi_file_f_to_c_table; +opal_pointer_array_t ompi_file_f_to_c_table; /* * MPI_FILE_NULL @@ -59,7 +59,11 @@ { /* Setup file array */ - OBJ_CONSTRUCT(&ompi_file_f_to_c_table, ompi_pointer_array_t); + OBJ_CONSTRUCT(&ompi_file_f_to_c_table, opal_pointer_array_t); + if( OPAL_SUCCESS != opal_pointer_array_init(&ompi_file_f_to_c_table, 0, + OMPI_FORTRAN_HANDLE_MAX, 64) ) { + return OMPI_ERROR; + } /* Setup MPI_FILE_NULL. Note that it will have the default error handler of MPI_ERRORS_RETURN, per MPI-2:9.7 (p265). */ @@ -68,7 +72,7 @@ ompi_mpi_file_null.f_comm = &ompi_mpi_comm_null; OBJ_RETAIN(ompi_mpi_file_null.f_comm); ompi_mpi_file_null.f_f_to_c_index = 0; - ompi_pointer_array_set_item(&ompi_file_f_to_c_table, 0, + opal_pointer_array_set_item(&ompi_file_f_to_c_table, 0, &ompi_mpi_file_null); /* All done */ @@ -159,14 +163,14 @@ to call OBJ_RELEASE on it. */ OBJ_DESTRUCT(&ompi_mpi_file_null); - ompi_pointer_array_set_item(&ompi_file_f_to_c_table, 0, NULL); + opal_pointer_array_set_item(&ompi_file_f_to_c_table, 0, NULL); /* Iterate through all the file handles and destroy them. Note that this also takes care of destroying MPI_FILE_NULL. */ - max = ompi_pointer_array_get_size(&ompi_file_f_to_c_table); + max = opal_pointer_array_get_size(&ompi_file_f_to_c_table); for (num_unnamed = i = 0; i < max; ++i) { - file = (ompi_file_t *)ompi_pointer_array_get_item(&ompi_file_f_to_c_table, i); + file = (ompi_file_t *)opal_pointer_array_get_item(&ompi_file_f_to_c_table, i); /* If the file was closed but still exists because the user told us to never free handles, then do an OBJ_RELEASE it @@ -176,7 +180,7 @@ if (NULL != file && ompi_debug_no_free_handles && 0 == (file->f_flags & OMPI_FILE_ISCLOSED)) { OBJ_RELEASE(file); - file = (ompi_file_t *)ompi_pointer_array_get_item(&ompi_file_f_to_c_table, i); + file = (ompi_file_t *)opal_pointer_array_get_item(&ompi_file_f_to_c_table, i); } if (NULL != file) { @@ -223,7 +227,7 @@ /* Initialize the fortran <--> C translation index */ - file->f_f_to_c_index = ompi_pointer_array_add(&ompi_file_f_to_c_table, + file->f_f_to_c_index = opal_pointer_array_add(&ompi_file_f_to_c_table, file); /* Initialize the error handler. Per MPI-2:9.7 (p265), the @@ -313,9 +317,9 @@ /* Reset the f_to_c table entry */ if (MPI_UNDEFINED != file->f_f_to_c_index && - NULL != ompi_pointer_array_get_item(&ompi_file_f_to_c_table, + NULL != opal_pointer_array_get_item(&ompi_file_f_to_c_table, file->f_f_to_c_index)) { - ompi_pointer_array_set_item(&ompi_file_f_to_c_table, + opal_pointer_array_set_item(&ompi_file_f_to_c_table, file->f_f_to_c_index, NULL); } } Index: ompi/file/file.h =================================================================== --- ompi/file/file.h (revision 16968) +++ ompi/file/file.h (working copy) @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2006 The University of Tennessee and The University + * Copyright (c) 2004-2007 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -31,9 +31,7 @@ #define OMPI_FILE_ISCLOSED 0x00000001 #define OMPI_FILE_HIDDEN 0x00000002 -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * Back-end structure for MPI_File @@ -107,83 +105,79 @@ /** * Fortran to C conversion table */ -extern ompi_pointer_array_t ompi_file_f_to_c_table; +extern opal_pointer_array_t ompi_file_f_to_c_table; +/** + * Initialize MPI_File handling. + * + * @retval OMPI_SUCCESS Always. + * + * Invoked during ompi_mpi_init(). + */ +int ompi_file_init(void); - - /** - * Initialize MPI_File handling. - * - * @retval OMPI_SUCCESS Always. - * - * Invoked during ompi_mpi_init(). - */ - int ompi_file_init(void); - - /** - * Back-end to MPI_FILE_OPEN: create a file handle, select an io - * component to use, and have that componet open the file. - * - * @param comm Communicator - * @param filename String filename - * @param amode Mode flags - * @param info Info - * @param fh Output file handle - * - * @retval OMPI_SUCCESS Upon success - * @retval OMPI_ERR* Upon error - * - * Create a file handle and select an io module to be paired with - * it. There is a corresponding ompi_file_close() function; it - * mainly calls OBJ_RELEASE() but also does some other error - * handling as well. - */ - int ompi_file_open(struct ompi_communicator_t *comm, char *filename, - int amode, struct ompi_info_t *info, - ompi_file_t **fh); +/** + * Back-end to MPI_FILE_OPEN: create a file handle, select an io + * component to use, and have that componet open the file. + * + * @param comm Communicator + * @param filename String filename + * @param amode Mode flags + * @param info Info + * @param fh Output file handle + * + * @retval OMPI_SUCCESS Upon success + * @retval OMPI_ERR* Upon error + * + * Create a file handle and select an io module to be paired with + * it. There is a corresponding ompi_file_close() function; it + * mainly calls OBJ_RELEASE() but also does some other error + * handling as well. + */ +int ompi_file_open(struct ompi_communicator_t *comm, char *filename, + int amode, struct ompi_info_t *info, + ompi_file_t **fh); - /** - * Atomicly set a name on a file handle. - * - * @param file MPI_File handle to set the name on - * @param name NULL-terminated string to use - * - * @returns OMPI_SUCCESS Always. - * - * At most (MPI_MAX_OBJECT_NAME-1) characters will be copied over to - * the file name's name. This function is performed atomically -- a - * lock is used to ensure that there are not multiple writers to the - * name to ensure that we don't end up with an erroneous name (e.g., - * a name without a \0 at the end). After invoking this function, - * ompi_file_is_name_set() will return true. - */ - int ompi_file_set_name(ompi_file_t *file, char *name); +/** + * Atomicly set a name on a file handle. + * + * @param file MPI_File handle to set the name on + * @param name NULL-terminated string to use + * + * @returns OMPI_SUCCESS Always. + * + * At most (MPI_MAX_OBJECT_NAME-1) characters will be copied over to + * the file name's name. This function is performed atomically -- a + * lock is used to ensure that there are not multiple writers to the + * name to ensure that we don't end up with an erroneous name (e.g., + * a name without a \0 at the end). After invoking this function, + * ompi_file_is_name_set() will return true. + */ +int ompi_file_set_name(ompi_file_t *file, char *name); - /** - * Back-end to MPI_FILE_CLOSE: destroy an ompi_file_t handle and - * close the file. - * - * @param file Pointer to ompi_file_t - * - * @returns OMPI_SUCCESS Always. - * - * This is the preferred mechanism for freeing an ompi_file_t. - * Although the main action that it performs is OBJ_RELEASE(), it - * also does some additional handling for error checking, etc. - */ - int ompi_file_close(ompi_file_t **file); +/** + * Back-end to MPI_FILE_CLOSE: destroy an ompi_file_t handle and + * close the file. + * + * @param file Pointer to ompi_file_t + * + * @returns OMPI_SUCCESS Always. + * + * This is the preferred mechanism for freeing an ompi_file_t. + * Although the main action that it performs is OBJ_RELEASE(), it + * also does some additional handling for error checking, etc. + */ +int ompi_file_close(ompi_file_t **file); - /** - * Tear down MPI_File handling. - * - * @retval OMPI_SUCCESS Always. - * - * Invoked during ompi_mpi_finalize(). - */ - int ompi_file_finalize(void); +/** + * Tear down MPI_File handling. + * + * @retval OMPI_SUCCESS Always. + * + * Invoked during ompi_mpi_finalize(). + */ +int ompi_file_finalize(void); - - /** * Check to see if an MPI_File handle is valid. * @@ -202,7 +196,6 @@ 0 != (file->f_flags & OMPI_FILE_ISCLOSED)); } -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS + #endif /* OMPI_FILE_H */ Index: ompi/runtime/ompi_cr.c =================================================================== --- ompi/runtime/ompi_cr.c (revision 16968) +++ ompi/runtime/ompi_cr.c (working copy) @@ -2,7 +2,7 @@ * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2007 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -108,10 +108,10 @@ memset(&modules, 0, sizeof(mca_coll_base_module_1_1_0_t*) * NUM_COLLECTIVES); - max = ompi_pointer_array_get_size(&ompi_mpi_communicators); + max = opal_pointer_array_get_size(&ompi_mpi_communicators); for (i = 0 ; i < max ; ++i) { ompi_communicator_t *comm = - (ompi_communicator_t *)ompi_pointer_array_get_item(&ompi_mpi_communicators, i); + (ompi_communicator_t *)opal_pointer_array_get_item(&ompi_mpi_communicators, i); if (NULL == comm) continue; SIGNAL(comm, modules, highest_module, msg, ret, allgather); Index: ompi/mpi/c/group_f2c.c =================================================================== --- ompi/mpi/c/group_f2c.c (revision 16968) +++ ompi/mpi/c/group_f2c.c (working copy) @@ -2,7 +2,7 @@ * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2006 The University of Tennessee and The University + * Copyright (c) 2004-2007 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -50,9 +50,9 @@ if (group_index < 0 || group_index >= - ompi_pointer_array_get_size(ompi_group_f_to_c_table)) { + opal_pointer_array_get_size(&ompi_group_f_to_c_table)) { return NULL; } - return (MPI_Group)ompi_pointer_array_get_item(ompi_group_f_to_c_table, group_index); + return (MPI_Group)opal_pointer_array_get_item(&ompi_group_f_to_c_table, group_index); } Index: ompi/mpi/c/win_f2c.c =================================================================== --- ompi/mpi/c/win_f2c.c (revision 16968) +++ ompi/mpi/c/win_f2c.c (working copy) @@ -2,7 +2,7 @@ * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2006 The University of Tennessee and The University + * Copyright (c) 2004-2007 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -48,9 +48,9 @@ return an invalid C handle. */ if ( 0 > o_index || - o_index >= ompi_pointer_array_get_size(&ompi_mpi_windows)) { + o_index >= opal_pointer_array_get_size(&ompi_mpi_windows)) { return NULL; } - return (MPI_Win)ompi_pointer_array_get_item(&ompi_mpi_windows, o_index); + return (MPI_Win)opal_pointer_array_get_item(&ompi_mpi_windows, o_index); } Index: ompi/mpi/c/type_f2c.c =================================================================== --- ompi/mpi/c/type_f2c.c (revision 16968) +++ ompi/mpi/c/type_f2c.c (working copy) @@ -2,7 +2,7 @@ * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2006 The University of Tennessee and The University + * Copyright (c) 2004-2007 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -49,10 +49,10 @@ if (datatype_index < 0 || datatype_index >= - ompi_pointer_array_get_size(ompi_datatype_f_to_c_table)) { + opal_pointer_array_get_size(&ompi_datatype_f_to_c_table)) { return NULL; } - return (MPI_Datatype)ompi_pointer_array_get_item(ompi_datatype_f_to_c_table, datatype_index); + return (MPI_Datatype)opal_pointer_array_get_item(&ompi_datatype_f_to_c_table, datatype_index); } Index: ompi/mpi/c/comm_f2c.c =================================================================== --- ompi/mpi/c/comm_f2c.c (revision 16968) +++ ompi/mpi/c/comm_f2c.c (working copy) @@ -2,7 +2,7 @@ * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2006 The University of Tennessee and The University + * Copyright (c) 2004-2007 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -48,9 +48,9 @@ return an invalid C handle. */ if ( 0 > o_index || - o_index >= ompi_pointer_array_get_size(&ompi_mpi_communicators)) { + o_index >= opal_pointer_array_get_size(&ompi_mpi_communicators)) { return NULL; } - return (MPI_Comm)ompi_pointer_array_get_item(&ompi_mpi_communicators, o_index); + return (MPI_Comm)opal_pointer_array_get_item(&ompi_mpi_communicators, o_index); } Index: ompi/mpi/c/errhandler_f2c.c =================================================================== --- ompi/mpi/c/errhandler_f2c.c (revision 16968) +++ ompi/mpi/c/errhandler_f2c.c (working copy) @@ -2,7 +2,7 @@ * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2006 The University of Tennessee and The University + * Copyright (c) 2004-2007 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -51,10 +51,10 @@ if (eh_index < 0 || eh_index >= - ompi_pointer_array_get_size(ompi_errhandler_f_to_c_table)) { + opal_pointer_array_get_size(&ompi_errhandler_f_to_c_table)) { return NULL; } - return (MPI_Errhandler)ompi_pointer_array_get_item(ompi_errhandler_f_to_c_table, + return (MPI_Errhandler)opal_pointer_array_get_item(&ompi_errhandler_f_to_c_table, eh_index); } Index: ompi/mpi/c/file_f2c.c =================================================================== --- ompi/mpi/c/file_f2c.c (revision 16968) +++ ompi/mpi/c/file_f2c.c (working copy) @@ -2,7 +2,7 @@ * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2006 The University of Tennessee and The University + * Copyright (c) 2004-2007 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -50,9 +50,9 @@ if (file_index < 0 || file_index >= - ompi_pointer_array_get_size(&ompi_file_f_to_c_table)) { + opal_pointer_array_get_size(&ompi_file_f_to_c_table)) { return NULL; } - return (MPI_File)ompi_pointer_array_get_item(&ompi_file_f_to_c_table, file_index); + return (MPI_File)opal_pointer_array_get_item(&ompi_file_f_to_c_table, file_index); } Index: ompi/mpi/c/request_c2f.c =================================================================== --- ompi/mpi/c/request_c2f.c (revision 16968) +++ ompi/mpi/c/request_c2f.c (working copy) @@ -2,7 +2,7 @@ * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2007 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -61,7 +61,7 @@ if (MPI_UNDEFINED == request->req_f_to_c_index) { request->req_f_to_c_index = - ompi_pointer_array_add(&ompi_request_f_to_c_table, request); + opal_pointer_array_add(&ompi_request_f_to_c_table, request); } return OMPI_INT_2_FINT(request->req_f_to_c_index) ; Index: ompi/mpi/c/op_f2c.c =================================================================== --- ompi/mpi/c/op_f2c.c (revision 16968) +++ ompi/mpi/c/op_f2c.c (working copy) @@ -2,7 +2,7 @@ * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2006 The University of Tennessee and The University + * Copyright (c) 2004-2007 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -51,9 +51,9 @@ if (op_index < 0 || op_index >= - ompi_pointer_array_get_size(ompi_op_f_to_c_table)) { + opal_pointer_array_get_size(ompi_op_f_to_c_table)) { return NULL; } - return (MPI_Op)ompi_pointer_array_get_item(ompi_op_f_to_c_table, op_index); + return (MPI_Op)opal_pointer_array_get_item(ompi_op_f_to_c_table, op_index); } Index: ompi/mpi/c/info_f2c.c =================================================================== --- ompi/mpi/c/info_f2c.c (revision 16968) +++ ompi/mpi/c/info_f2c.c (working copy) @@ -2,7 +2,7 @@ * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2006 The University of Tennessee and The University + * Copyright (c) 2004-2007 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -58,9 +58,9 @@ if (info_index < 0 || info_index >= - ompi_pointer_array_get_size(&ompi_info_f_to_c_table)) { + opal_pointer_array_get_size(&ompi_info_f_to_c_table)) { return NULL; } - return (MPI_Info)ompi_pointer_array_get_item(&ompi_info_f_to_c_table, info_index); + return (MPI_Info)opal_pointer_array_get_item(&ompi_info_f_to_c_table, info_index); } Index: ompi/mpi/c/request_f2c.c =================================================================== --- ompi/mpi/c/request_f2c.c (revision 16968) +++ ompi/mpi/c/request_f2c.c (working copy) @@ -2,7 +2,7 @@ * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2006 The University of Tennessee and The University + * Copyright (c) 2004-2007 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -49,10 +49,10 @@ if (request_index < 0 || request_index >= - ompi_pointer_array_get_size(&ompi_request_f_to_c_table)) { + opal_pointer_array_get_size(&ompi_request_f_to_c_table)) { return NULL; } - return (MPI_Request)ompi_pointer_array_get_item(&ompi_request_f_to_c_table, + return (MPI_Request)opal_pointer_array_get_item(&ompi_request_f_to_c_table, request_index); } Index: ompi/errhandler/errcode-internal.h =================================================================== --- ompi/errhandler/errcode-internal.h (revision 16968) +++ ompi/errhandler/errcode-internal.h (working copy) @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2007 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -25,12 +25,12 @@ #include "mpi.h" #include "ompi/constants.h" #include "opal/class/opal_object.h" -#include "ompi/class/ompi_pointer_array.h" +#include "opal/class/opal_pointer_array.h" #define OMPI_MAX_ERROR_STRING 64 -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif + +BEGIN_C_DECLS + /** * Back-end type for MPI error codes */ @@ -43,7 +43,7 @@ }; typedef struct ompi_errcode_intern_t ompi_errcode_intern_t; -OMPI_DECLSPEC extern ompi_pointer_array_t ompi_errcodes_intern; +OMPI_DECLSPEC extern opal_pointer_array_t ompi_errcodes_intern; OMPI_DECLSPEC extern int ompi_errcode_intern_lastused; /** @@ -64,7 +64,7 @@ /* Otherwise, it's an internal OMPI code and we need to translate it */ for ( __i=0; __icode == errcode ) { __ret = __errc->mpi_code; break; @@ -73,30 +73,25 @@ return __ret; } - - - /** - * Initialize the error codes - * - * @returns OMPI_SUCCESS Upon success - * @returns OMPI_ERROR Otherwise - * - * Invoked from ompi_mpi_init(); sets up all static MPI error codes, - */ - int ompi_errcode_intern_init(void); +/** + * Initialize the error codes + * + * @returns OMPI_SUCCESS Upon success + * @returns OMPI_ERROR Otherwise + * + * Invoked from ompi_mpi_init(); sets up all static MPI error codes, + */ +int ompi_errcode_intern_init(void); - /** - * Finalize the error codes. - * - * @returns OMPI_SUCCESS Always - * - * Invokes from ompi_mpi_finalize(); tears down the error code array. - */ - int ompi_errcode_intern_finalize(void); +/** + * Finalize the error codes. + * + * @returns OMPI_SUCCESS Always + * + * Invokes from ompi_mpi_finalize(); tears down the error code array. + */ +int ompi_errcode_intern_finalize(void); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS - #endif /* OMPI_ERRCODE_INTERNAL_H */ Index: ompi/errhandler/errcode.c =================================================================== --- ompi/errhandler/errcode.c (revision 16968) +++ ompi/errhandler/errcode.c (working copy) @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2007 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -27,7 +27,7 @@ #include "ompi/constants.h" /* Table holding all error codes */ -ompi_pointer_array_t ompi_mpi_errcodes; +opal_pointer_array_t ompi_mpi_errcodes; int ompi_mpi_errcode_lastused=0; int ompi_mpi_errcode_lastpredefined=0; @@ -92,346 +92,84 @@ OBJ_CLASS_INSTANCE(ompi_mpi_errcode_t,opal_object_t,ompi_mpi_errcode_construct, ompi_mpi_errcode_destruct); +#define CONSTRUCT_ERRCODE(VAR, ERRCODE, TXT ) \ +do { \ + OBJ_CONSTRUCT(&(VAR), ompi_mpi_errcode_t); \ + (VAR).code = (ERRCODE); \ + (VAR).cls = (ERRCODE); \ + strncpy((VAR).errstring, (TXT), MPI_MAX_ERROR_STRING); \ + opal_pointer_array_set_item(&ompi_mpi_errcodes, (ERRCODE), &(VAR)); \ +} while (0) + int ompi_mpi_errcode_init (void) { /* Initialize the pointer array, which will hold the references to the error objects */ - OBJ_CONSTRUCT(&ompi_mpi_errcodes, ompi_pointer_array_t); + OBJ_CONSTRUCT(&ompi_mpi_errcodes, opal_pointer_array_t); + if( OPAL_SUCCESS != opal_pointer_array_init(&ompi_mpi_errcodes, 0, + OMPI_FORTRAN_HANDLE_MAX, 64) ) { + return OMPI_ERROR; + } /* Initialize now each predefined error code and register it in the pointer-array. */ - OBJ_CONSTRUCT(&ompi_success, ompi_mpi_errcode_t); - ompi_success.code = MPI_SUCCESS; - ompi_success.cls = MPI_SUCCESS; - strncpy(ompi_success.errstring, "MPI_SUCCESS: no errors", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_SUCCESS, &ompi_success); + CONSTRUCT_ERRCODE( ompi_success, MPI_SUCCESS, "MPI_SUCCESS: no errors" ); + CONSTRUCT_ERRCODE( ompi_err_buffer, MPI_ERR_BUFFER, "MPI_ERR_BUFFER: invalid buffer pointer"); + CONSTRUCT_ERRCODE( ompi_err_count, MPI_ERR_COUNT, "MPI_ERR_COUNT: invalid count argument" ); + CONSTRUCT_ERRCODE( ompi_err_type, MPI_ERR_TYPE, "MPI_ERR_TYPE: invalid datatype" ); + CONSTRUCT_ERRCODE( ompi_err_tag, MPI_ERR_TAG, "MPI_ERR_TAG: invalid tag" ); + CONSTRUCT_ERRCODE( ompi_err_comm, MPI_ERR_COMM, "MPI_ERR_COMM: invalid communicator" ); + CONSTRUCT_ERRCODE( ompi_err_rank, MPI_ERR_RANK, "MPI_ERR_RANK: invalid rank" ); + CONSTRUCT_ERRCODE( ompi_err_request, MPI_ERR_REQUEST, "MPI_ERR_REQUEST: invalid request" ); + CONSTRUCT_ERRCODE( ompi_err_root, MPI_ERR_ROOT, "MPI_ERR_ROOT: invalid root" ); + CONSTRUCT_ERRCODE( ompi_err_group, MPI_ERR_GROUP, "MPI_ERR_GROUP: invalid group" ); + CONSTRUCT_ERRCODE( ompi_err_op, MPI_ERR_OP, "MPI_ERR_OP: invalid reduce operation" ); + CONSTRUCT_ERRCODE( ompi_err_topology, MPI_ERR_TOPOLOGY, "MPI_ERR_TOPOLOGY: invalid communicator topology" ); + CONSTRUCT_ERRCODE( ompi_err_dims, MPI_ERR_DIMS, "MPI_ERR_DIMS: invalid topology dimension" ); + CONSTRUCT_ERRCODE( ompi_err_arg, MPI_ERR_ARG, "MPI_ERR_ARG: invalid argument of some other kind" ); + CONSTRUCT_ERRCODE( ompi_err_unknown, MPI_ERR_UNKNOWN, "MPI_ERR_UNKNOWN: unknown error" ); + CONSTRUCT_ERRCODE( ompi_err_truncate, MPI_ERR_TRUNCATE, "MPI_ERR_TRUNCATE: message truncated" ); + CONSTRUCT_ERRCODE( ompi_err_other, MPI_ERR_OTHER, "MPI_ERR_OTHER: known error not in list" ); + CONSTRUCT_ERRCODE( ompi_err_intern, MPI_ERR_INTERN, "MPI_ERR_INTERN: internal error" ); + CONSTRUCT_ERRCODE( ompi_err_in_status, MPI_ERR_IN_STATUS, "MPI_ERR_IN_STATUS: error code in status" ); + CONSTRUCT_ERRCODE( ompi_err_pending, MPI_ERR_PENDING, "MPI_ERR_PENDING: pending request" ); + CONSTRUCT_ERRCODE( ompi_err_access, MPI_ERR_ACCESS, "MPI_ERR_ACCESS: invalid access mode" ); + CONSTRUCT_ERRCODE( ompi_err_amode, MPI_ERR_AMODE, "MPI_ERR_AMODE: invalid amode argument" ); + CONSTRUCT_ERRCODE( ompi_err_assert, MPI_ERR_ASSERT, "MPI_ERR_ASSERT: invalid assert argument" ); + CONSTRUCT_ERRCODE( ompi_err_bad_file, MPI_ERR_BAD_FILE, "MPI_ERR_BAD_FILE: bad file" ); + CONSTRUCT_ERRCODE( ompi_err_base, MPI_ERR_BASE, "MPI_ERR_BASE: invalid base" ); + CONSTRUCT_ERRCODE( ompi_err_conversion, MPI_ERR_CONVERSION, "MPI_ERR_CONVERSION: error in data conversion" ); + CONSTRUCT_ERRCODE( ompi_err_disp, MPI_ERR_DISP, "MPI_ERR_DISP: invalid displacement" ); + CONSTRUCT_ERRCODE( ompi_err_dup_datarep, MPI_ERR_DUP_DATAREP, "MPI_ERR_DUP_DATAREP: error while duplicating data representation" ); + CONSTRUCT_ERRCODE( ompi_err_file_exists, MPI_ERR_FILE_EXISTS, "MPI_ERR_FILE_EXISTS: file exists alreay" ); + CONSTRUCT_ERRCODE( ompi_err_file_in_use, MPI_ERR_FILE_IN_USE, "MPI_ERR_FILE_IN_USE: file already in use" ); + CONSTRUCT_ERRCODE( ompi_err_file, MPI_ERR_FILE, "MPI_ERR_FILE: invalid file" ); + CONSTRUCT_ERRCODE( ompi_err_info_key, MPI_ERR_INFO_KEY, "MPI_ERR_INFO_KEY: invalid key argument for info object" ); + CONSTRUCT_ERRCODE( ompi_err_info_nokey, MPI_ERR_INFO_NOKEY, "MPI_ERR_INFO_NOKEY: unknown key for given info object" ); + CONSTRUCT_ERRCODE( ompi_err_info_value, MPI_ERR_INFO_VALUE, "MPI_ERR_INFO_VALUE: invalid value argument for info object" ); + CONSTRUCT_ERRCODE( ompi_err_info, MPI_ERR_INFO, "MPI_ERR_INFO: invalid info object" ); + CONSTRUCT_ERRCODE( ompi_err_io, MPI_ERR_IO, "MPI_ERR_IO: input/output error" ); + CONSTRUCT_ERRCODE( ompi_err_keyval, MPI_ERR_KEYVAL, "MPI_ERR_KEYVAL: invalid key value" ); + CONSTRUCT_ERRCODE( ompi_err_locktype, MPI_ERR_LOCKTYPE, "MPI_ERR_LOCKTYPE: invalid lock" ); + CONSTRUCT_ERRCODE( ompi_err_name, MPI_ERR_NAME, "MPI_ERR_NAME: invalid name argument" ); + CONSTRUCT_ERRCODE( ompi_err_no_mem, MPI_ERR_NO_MEM, "MPI_ERR_NO_MEM: out of memory" ); + CONSTRUCT_ERRCODE( ompi_err_not_same, MPI_ERR_NOT_SAME, "MPI_ERR_NOT_SAME: objects are not identical"); + CONSTRUCT_ERRCODE( ompi_err_no_space, MPI_ERR_NO_SPACE, "MPI_ERR_NO_SPACE: no space left on device" ); + CONSTRUCT_ERRCODE( ompi_err_no_such_file, MPI_ERR_NO_SUCH_FILE, "MPI_ERR_NO_SUCH_FILE: no such file or directory" ); + CONSTRUCT_ERRCODE( ompi_err_port, MPI_ERR_PORT, "MPI_ERR_PORT: MPI_ERR_PORT: invalid port" ); + CONSTRUCT_ERRCODE( ompi_err_quota, MPI_ERR_QUOTA, "MPI_ERR_QUOTA: out of quota" ); + CONSTRUCT_ERRCODE( ompi_err_read_only, MPI_ERR_READ_ONLY, "MPI_ERR_READ_ONLY: file is read only" ); + CONSTRUCT_ERRCODE( ompi_err_rma_conflict, MPI_ERR_RMA_CONFLICT, "MPI_ERR_RMA_CONFLICT: rma conflict during operation" ); + CONSTRUCT_ERRCODE( ompi_err_rma_sync, MPI_ERR_RMA_SYNC, "MPI_ERR_RMA_SYNC: error while executing rma sync" ); + CONSTRUCT_ERRCODE( ompi_err_service, MPI_ERR_SERVICE, "MPI_ERR_SERVICE: unknown service name" ); + CONSTRUCT_ERRCODE( ompi_err_size, MPI_ERR_SIZE, "MPI_ERR_SIZE: invalid size" ); + CONSTRUCT_ERRCODE( ompi_err_spawn, MPI_ERR_SPAWN, "MPI_ERR_SPAWN: could not spawn processes" ); + CONSTRUCT_ERRCODE( ompi_err_unsupported_datarep, MPI_ERR_UNSUPPORTED_DATAREP, "MPI_ERR_UNSUPPORTED_DATAREP: requested data representation not supported" ); + CONSTRUCT_ERRCODE( ompi_err_unsupported_operation, MPI_ERR_UNSUPPORTED_OPERATION, "MPI_ERR_UNSUPPORTED_OPERATION: requested operation not suppported" ); + CONSTRUCT_ERRCODE( ompi_err_win, MPI_ERR_WIN, "MPI_ERR_WIN:invalid window" ); - OBJ_CONSTRUCT(&ompi_err_buffer, ompi_mpi_errcode_t); - ompi_err_buffer.code = MPI_ERR_BUFFER; - ompi_err_buffer.cls = MPI_ERR_BUFFER; - strncpy(ompi_err_buffer.errstring, "MPI_ERR_BUFFER: invalid buffer pointer", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_BUFFER, &ompi_err_buffer); - - OBJ_CONSTRUCT(&ompi_err_count, ompi_mpi_errcode_t); - ompi_err_count.code = MPI_ERR_COUNT; - ompi_err_count.cls = MPI_ERR_COUNT; - strncpy(ompi_err_count.errstring, "MPI_ERR_COUNT: invalid count argument", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_COUNT, &ompi_err_count); - - OBJ_CONSTRUCT(&ompi_err_type, ompi_mpi_errcode_t); - ompi_err_type.code = MPI_ERR_TYPE; - ompi_err_type.cls = MPI_ERR_TYPE; - strncpy(ompi_err_type.errstring, "MPI_ERR_TYPE: invalid datatype", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_TYPE, &ompi_err_type); - - OBJ_CONSTRUCT(&ompi_err_tag, ompi_mpi_errcode_t); - ompi_err_tag.code = MPI_ERR_TAG; - ompi_err_tag.cls = MPI_ERR_TAG; - strncpy(ompi_err_tag.errstring, "MPI_ERR_TAG: invalid tag", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_TAG, &ompi_err_tag); - - OBJ_CONSTRUCT(&ompi_err_comm, ompi_mpi_errcode_t); - ompi_err_comm.code = MPI_ERR_COMM; - ompi_err_comm.cls = MPI_ERR_COMM; - strncpy(ompi_err_comm.errstring, "MPI_ERR_COMM: invalid communicator", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_COMM, &ompi_err_comm); - - OBJ_CONSTRUCT(&ompi_err_rank, ompi_mpi_errcode_t); - ompi_err_rank.code = MPI_ERR_RANK; - ompi_err_rank.cls = MPI_ERR_RANK; - strncpy(ompi_err_rank.errstring, "MPI_ERR_RANK: invalid rank", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_RANK, &ompi_err_rank); - - OBJ_CONSTRUCT(&ompi_err_request, ompi_mpi_errcode_t); - ompi_err_request.code = MPI_ERR_REQUEST; - ompi_err_request.cls = MPI_ERR_REQUEST; - strncpy(ompi_err_request.errstring, "MPI_ERR_REQUEST: invalid request", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_REQUEST, &ompi_err_request); - - OBJ_CONSTRUCT(&ompi_err_root, ompi_mpi_errcode_t); - ompi_err_root.code = MPI_ERR_ROOT; - ompi_err_root.cls = MPI_ERR_ROOT; - strncpy(ompi_err_root.errstring, "MPI_ERR_ROOT: invalid root", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_ROOT, &ompi_err_root); - - OBJ_CONSTRUCT(&ompi_err_group, ompi_mpi_errcode_t); - ompi_err_group.code = MPI_ERR_GROUP; - ompi_err_group.cls = MPI_ERR_GROUP; - strncpy(ompi_err_group.errstring, "MPI_ERR_GROUP: invalid group", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_GROUP, &ompi_err_group); - - OBJ_CONSTRUCT(&ompi_err_op, ompi_mpi_errcode_t); - ompi_err_op.code = MPI_ERR_OP; - ompi_err_op.cls = MPI_ERR_OP; - strncpy(ompi_err_op.errstring, "MPI_ERR_OP: invalid reduce operation", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_OP, &ompi_err_op); - - OBJ_CONSTRUCT(&ompi_err_topology, ompi_mpi_errcode_t); - ompi_err_topology.code = MPI_ERR_TOPOLOGY; - ompi_err_topology.cls = MPI_ERR_TOPOLOGY; - strncpy(ompi_err_topology.errstring, "MPI_ERR_TOPOLOGY: invalid communicator topology", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_TOPOLOGY, &ompi_err_topology); - - OBJ_CONSTRUCT(&ompi_err_dims, ompi_mpi_errcode_t); - ompi_err_dims.code = MPI_ERR_DIMS; - ompi_err_dims.cls = MPI_ERR_DIMS; - strncpy(ompi_err_dims.errstring, "MPI_ERR_DIMS: invalid topology dimension", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_DIMS, &ompi_err_dims); - - OBJ_CONSTRUCT(&ompi_err_arg, ompi_mpi_errcode_t); - ompi_err_arg.code = MPI_ERR_ARG; - ompi_err_arg.cls = MPI_ERR_ARG; - strncpy(ompi_err_arg.errstring, "MPI_ERR_ARG: invalid argument of some other kind", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_ARG, &ompi_err_arg); - - OBJ_CONSTRUCT(&ompi_err_unknown, ompi_mpi_errcode_t); - ompi_err_unknown.code = MPI_ERR_UNKNOWN; - ompi_err_unknown.cls = MPI_ERR_UNKNOWN; - strncpy(ompi_err_unknown.errstring, "MPI_ERR_UNKNOWN: unknown error", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_UNKNOWN, &ompi_err_unknown); - - OBJ_CONSTRUCT(&ompi_err_truncate, ompi_mpi_errcode_t); - ompi_err_truncate.code = MPI_ERR_TRUNCATE; - ompi_err_truncate.cls = MPI_ERR_TRUNCATE; - strncpy(ompi_err_truncate.errstring, "MPI_ERR_TRUNCATE: message truncated", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_TRUNCATE, &ompi_err_truncate); - - OBJ_CONSTRUCT(&ompi_err_other, ompi_mpi_errcode_t); - ompi_err_other.code = MPI_ERR_OTHER; - ompi_err_other.cls = MPI_ERR_OTHER; - strncpy(ompi_err_other.errstring, "MPI_ERR_OTHER: known error not in list", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_OTHER, &ompi_err_other); - - OBJ_CONSTRUCT(&ompi_err_intern, ompi_mpi_errcode_t); - ompi_err_intern.code = MPI_ERR_INTERN; - ompi_err_intern.cls = MPI_ERR_INTERN; - strncpy(ompi_err_intern.errstring, "MPI_ERR_INTERN: internal error", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_INTERN, &ompi_err_intern); - - OBJ_CONSTRUCT(&ompi_err_in_status, ompi_mpi_errcode_t); - ompi_err_in_status.code = MPI_ERR_IN_STATUS; - ompi_err_in_status.cls = MPI_ERR_IN_STATUS; - strncpy(ompi_err_in_status.errstring, "MPI_ERR_IN_STATUS: error code in status", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_IN_STATUS, &ompi_err_in_status); - - OBJ_CONSTRUCT(&ompi_err_pending, ompi_mpi_errcode_t); - ompi_err_pending.code = MPI_ERR_PENDING; - ompi_err_pending.cls = MPI_ERR_PENDING; - strncpy(ompi_err_pending.errstring, "MPI_ERR_PENDING: pending request", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_PENDING, &ompi_err_pending); - - OBJ_CONSTRUCT(&ompi_err_access, ompi_mpi_errcode_t); - ompi_err_access.code = MPI_ERR_ACCESS; - ompi_err_access.cls = MPI_ERR_ACCESS; - strncpy(ompi_err_access.errstring, "MPI_ERR_ACCESS: invalid access mode", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_ACCESS, &ompi_err_access); - - OBJ_CONSTRUCT(&ompi_err_amode, ompi_mpi_errcode_t); - ompi_err_amode.code = MPI_ERR_AMODE; - ompi_err_amode.cls = MPI_ERR_AMODE; - strncpy(ompi_err_amode.errstring, "MPI_ERR_AMODE: invalid amode argument", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_AMODE, &ompi_err_amode); - - OBJ_CONSTRUCT(&ompi_err_assert, ompi_mpi_errcode_t); - ompi_err_assert.code = MPI_ERR_ASSERT; - ompi_err_assert.cls = MPI_ERR_ASSERT; - strncpy(ompi_err_assert.errstring, "MPI_ERR_ASSERT: invalid assert argument", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_ASSERT, &ompi_err_assert); - - OBJ_CONSTRUCT(&ompi_err_bad_file, ompi_mpi_errcode_t); - ompi_err_bad_file.code = MPI_ERR_BAD_FILE; - ompi_err_bad_file.cls = MPI_ERR_BAD_FILE; - strncpy(ompi_err_bad_file.errstring, "MPI_ERR_BAD_FILE: bad file", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_BAD_FILE, &ompi_err_bad_file); - - OBJ_CONSTRUCT(&ompi_err_base, ompi_mpi_errcode_t); - ompi_err_base.code = MPI_ERR_BASE; - ompi_err_base.cls = MPI_ERR_BASE; - strncpy(ompi_err_base.errstring, "MPI_ERR_BASE: invalid base", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_BASE, &ompi_err_base); - - OBJ_CONSTRUCT(&ompi_err_conversion, ompi_mpi_errcode_t); - ompi_err_conversion.code = MPI_ERR_CONVERSION; - ompi_err_conversion.cls = MPI_ERR_CONVERSION; - strncpy(ompi_err_conversion.errstring, "MPI_ERR_CONVERSION: error in data conversion", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_CONVERSION, &ompi_err_conversion); - - OBJ_CONSTRUCT(&ompi_err_disp, ompi_mpi_errcode_t); - ompi_err_disp.code = MPI_ERR_DISP; - ompi_err_disp.cls = MPI_ERR_DISP; - strncpy(ompi_err_disp.errstring, "MPI_ERR_DISP: invalid displacement", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_DISP, &ompi_err_disp); - - OBJ_CONSTRUCT(&ompi_err_dup_datarep, ompi_mpi_errcode_t); - ompi_err_dup_datarep.code = MPI_ERR_DUP_DATAREP; - ompi_err_dup_datarep.cls = MPI_ERR_DUP_DATAREP; - strncpy(ompi_err_dup_datarep.errstring, - "MPI_ERR_DUP_DATAREP: error while duplicating data representation", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_DUP_DATAREP, &ompi_err_dup_datarep); - - OBJ_CONSTRUCT(&ompi_err_file_exists, ompi_mpi_errcode_t); - ompi_err_file_exists.code = MPI_ERR_FILE_EXISTS; - ompi_err_file_exists.cls = MPI_ERR_FILE_EXISTS; - strncpy(ompi_err_file_exists.errstring, "MPI_ERR_FILE_EXISTS: file exists alreay", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_FILE_EXISTS, &ompi_err_file_exists); - - OBJ_CONSTRUCT(&ompi_err_file_in_use, ompi_mpi_errcode_t); - ompi_err_file_in_use.code = MPI_ERR_FILE_IN_USE; - ompi_err_file_in_use.cls = MPI_ERR_FILE_IN_USE; - strncpy(ompi_err_file_in_use.errstring, "MPI_ERR_FILE_IN_USE: file already in use", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_FILE_IN_USE, &ompi_err_file_in_use); - - OBJ_CONSTRUCT(&ompi_err_file, ompi_mpi_errcode_t); - ompi_err_file.code = MPI_ERR_FILE; - ompi_err_file.cls = MPI_ERR_FILE; - strncpy(ompi_err_file.errstring, "MPI_ERR_FILE: invalid file", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_FILE, &ompi_err_file); - - OBJ_CONSTRUCT(&ompi_err_info_key, ompi_mpi_errcode_t); - ompi_err_info_key.code = MPI_ERR_INFO_KEY; - ompi_err_info_key.cls = MPI_ERR_INFO_KEY; - strncpy(ompi_err_info_key.errstring, "MPI_ERR_INFO_KEY: invalid key argument for info object", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_INFO_KEY, &ompi_err_info_key); - - OBJ_CONSTRUCT(&ompi_err_info_nokey, ompi_mpi_errcode_t); - ompi_err_info_nokey.code = MPI_ERR_INFO_NOKEY; - ompi_err_info_nokey.cls = MPI_ERR_INFO_NOKEY; - strncpy(ompi_err_info_nokey.errstring, "MPI_ERR_INFO_NOKEY: unknown key for given info object", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_INFO_NOKEY, &ompi_err_info_nokey); - - OBJ_CONSTRUCT(&ompi_err_info_value, ompi_mpi_errcode_t); - ompi_err_info_value.code = MPI_ERR_INFO_VALUE; - ompi_err_info_value.cls = MPI_ERR_INFO_VALUE; - strncpy(ompi_err_info_value.errstring, - "MPI_ERR_INFO_VALUE: invalid value argument for info object", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_INFO_VALUE, &ompi_err_info_value); - - OBJ_CONSTRUCT(&ompi_err_info, ompi_mpi_errcode_t); - ompi_err_info.code = MPI_ERR_INFO; - ompi_err_info.cls = MPI_ERR_INFO; - strncpy(ompi_err_info.errstring, "MPI_ERR_INFO: invalid info object", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_INFO, &ompi_err_info); - - OBJ_CONSTRUCT(&ompi_err_io, ompi_mpi_errcode_t); - ompi_err_io.code = MPI_ERR_IO; - ompi_err_io.cls = MPI_ERR_IO; - strncpy(ompi_err_io.errstring, "MPI_ERR_IO: input/output error", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_IO, &ompi_err_io); - - OBJ_CONSTRUCT(&ompi_err_keyval, ompi_mpi_errcode_t); - ompi_err_keyval.code = MPI_ERR_KEYVAL; - ompi_err_keyval.cls = MPI_ERR_KEYVAL; - strncpy(ompi_err_keyval.errstring, "MPI_ERR_KEYVAL: invalid key value", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_KEYVAL, &ompi_err_keyval); - - OBJ_CONSTRUCT(&ompi_err_locktype, ompi_mpi_errcode_t); - ompi_err_locktype.code = MPI_ERR_LOCKTYPE; - ompi_err_locktype.cls = MPI_ERR_LOCKTYPE; - strncpy(ompi_err_locktype.errstring, "MPI_ERR_LOCKTYPE: invalid lock", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_LOCKTYPE, &ompi_err_locktype); - - OBJ_CONSTRUCT(&ompi_err_name, ompi_mpi_errcode_t); - ompi_err_name.code = MPI_ERR_NAME; - ompi_err_name.cls = MPI_ERR_NAME; - strncpy(ompi_err_name.errstring, "MPI_ERR_NAME: invalid name argument", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_NAME, &ompi_err_name); - - OBJ_CONSTRUCT(&ompi_err_no_mem, ompi_mpi_errcode_t); - ompi_err_no_mem.code = MPI_ERR_NO_MEM; - ompi_err_no_mem.cls = MPI_ERR_NO_MEM; - strncpy(ompi_err_no_mem.errstring, "MPI_ERR_NO_MEM: out of memory", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_NO_MEM, &ompi_err_no_mem); - - OBJ_CONSTRUCT(&ompi_err_not_same, ompi_mpi_errcode_t); - ompi_err_not_same.code = MPI_ERR_NOT_SAME; - ompi_err_not_same.cls = MPI_ERR_NOT_SAME; - strcpy(ompi_err_not_same.errstring, "MPI_ERR_NOT_SAME: objects are not identical"); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_NOT_SAME, &ompi_err_not_same); - - OBJ_CONSTRUCT(&ompi_err_no_space, ompi_mpi_errcode_t); - ompi_err_no_space.code = MPI_ERR_NO_SPACE; - ompi_err_no_space.cls = MPI_ERR_NO_SPACE; - strncpy(ompi_err_no_space.errstring, "MPI_ERR_NO_SPACE: no space left on device", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_NO_SPACE, &ompi_err_no_space); - - OBJ_CONSTRUCT(&ompi_err_no_such_file, ompi_mpi_errcode_t); - ompi_err_no_such_file.code = MPI_ERR_NO_SUCH_FILE; - ompi_err_no_such_file.cls = MPI_ERR_NO_SUCH_FILE; - strncpy(ompi_err_no_such_file.errstring, "MPI_ERR_NO_SUCH_FILE: no such file or directory", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_NO_SUCH_FILE, &ompi_err_no_such_file); - - OBJ_CONSTRUCT(&ompi_err_port, ompi_mpi_errcode_t); - ompi_err_port.code = MPI_ERR_PORT; - ompi_err_port.cls = MPI_ERR_PORT; - strncpy(ompi_err_port.errstring, "MPI_ERR_PORT: MPI_ERR_PORT: invalid port", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_PORT, &ompi_err_port); - - OBJ_CONSTRUCT(&ompi_err_quota, ompi_mpi_errcode_t); - ompi_err_quota.code = MPI_ERR_QUOTA; - ompi_err_quota.cls = MPI_ERR_QUOTA; - strncpy(ompi_err_quota.errstring, "MPI_ERR_QUOTA: out of quota", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_QUOTA, &ompi_err_quota); - - OBJ_CONSTRUCT(&ompi_err_read_only, ompi_mpi_errcode_t); - ompi_err_read_only.code = MPI_ERR_READ_ONLY; - ompi_err_read_only.cls = MPI_ERR_READ_ONLY; - strncpy(ompi_err_read_only.errstring, "MPI_ERR_READ_ONLY: file is read only", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_READ_ONLY, &ompi_err_read_only); - - OBJ_CONSTRUCT(&ompi_err_rma_conflict, ompi_mpi_errcode_t); - ompi_err_rma_conflict.code = MPI_ERR_RMA_CONFLICT; - ompi_err_rma_conflict.cls = MPI_ERR_RMA_CONFLICT; - strncpy(ompi_err_rma_conflict.errstring, "MPI_ERR_RMA_CONFLICT: rma conflict during operation", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_RMA_CONFLICT, &ompi_err_rma_conflict); - - OBJ_CONSTRUCT(&ompi_err_rma_sync, ompi_mpi_errcode_t); - ompi_err_rma_sync.code = MPI_ERR_RMA_SYNC; - ompi_err_rma_sync.cls = MPI_ERR_RMA_SYNC; - strncpy(ompi_err_rma_sync.errstring, "MPI_ERR_RMA_SYNC: error while executing rma sync", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_RMA_SYNC, &ompi_err_rma_sync); - - OBJ_CONSTRUCT(&ompi_err_service, ompi_mpi_errcode_t); - ompi_err_service.code = MPI_ERR_SERVICE; - ompi_err_service.cls = MPI_ERR_SERVICE; - strncpy(ompi_err_service.errstring, "MPI_ERR_SERVICE: unknown service name", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_SERVICE, &ompi_err_service); - - OBJ_CONSTRUCT(&ompi_err_size, ompi_mpi_errcode_t); - ompi_err_size.code = MPI_ERR_SIZE; - ompi_err_size.cls = MPI_ERR_SIZE; - strncpy(ompi_err_size.errstring, "MPI_ERR_SIZE: invalid size", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_SIZE, &ompi_err_size); - - OBJ_CONSTRUCT(&ompi_err_spawn, ompi_mpi_errcode_t); - ompi_err_spawn.code = MPI_ERR_SPAWN; - ompi_err_spawn.cls = MPI_ERR_SPAWN; - strncpy(ompi_err_spawn.errstring, "MPI_ERR_SPAWN: could not spawn processes", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_SPAWN, &ompi_err_spawn); - - OBJ_CONSTRUCT(&ompi_err_unsupported_datarep, ompi_mpi_errcode_t); - ompi_err_unsupported_datarep.code = MPI_ERR_UNSUPPORTED_DATAREP; - ompi_err_unsupported_datarep.cls = MPI_ERR_UNSUPPORTED_DATAREP; - strncpy(ompi_err_unsupported_datarep.errstring, - "MPI_ERR_UNSUPPORTED_DATAREP: requested data representation not supported", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_UNSUPPORTED_DATAREP, - &ompi_err_unsupported_datarep); - - OBJ_CONSTRUCT(&ompi_err_unsupported_operation, ompi_mpi_errcode_t); - ompi_err_unsupported_operation.code = MPI_ERR_UNSUPPORTED_OPERATION; - ompi_err_unsupported_operation.cls = MPI_ERR_UNSUPPORTED_OPERATION; - strncpy(ompi_err_unsupported_operation.errstring, - "MPI_ERR_UNSUPPORTED_OPERATION: requested operation not suppported", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_UNSUPPORTED_OPERATION, - &ompi_err_unsupported_operation); - - OBJ_CONSTRUCT(&ompi_err_win, ompi_mpi_errcode_t); - ompi_err_win.code = MPI_ERR_WIN; - ompi_err_win.cls = MPI_ERR_WIN; - strncpy(ompi_err_win.errstring, "MPI_ERR_WIN:invalid window", MPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, MPI_ERR_WIN, &ompi_err_win); - - ompi_mpi_errcode_lastused=MPI_ERR_WIN; - ompi_mpi_errcode_lastpredefined=MPI_ERR_WIN; + ompi_mpi_errcode_lastused = MPI_ERR_WIN; + ompi_mpi_errcode_lastpredefined = MPI_ERR_WIN; return OMPI_SUCCESS; } @@ -445,7 +183,7 @@ * there are some user defined error-codes, which * we have to free. */ - errc = (ompi_mpi_errcode_t *)ompi_pointer_array_get_item(&ompi_mpi_errcodes, i); + errc = (ompi_mpi_errcode_t *)opal_pointer_array_get_item(&ompi_mpi_errcodes, i); OBJ_RELEASE (errc); } @@ -515,7 +253,7 @@ newerrcode = OBJ_NEW(ompi_mpi_errcode_t); newerrcode->code = (ompi_mpi_errcode_lastused+1); newerrcode->cls = errclass; - ompi_pointer_array_set_item(&ompi_mpi_errcodes, newerrcode->code, newerrcode); + opal_pointer_array_set_item(&ompi_mpi_errcodes, newerrcode->code, newerrcode); ompi_mpi_errcode_lastused++; return newerrcode->code; @@ -527,7 +265,7 @@ newerrcode = OBJ_NEW(ompi_mpi_errcode_t); newerrcode->cls = ( ompi_mpi_errcode_lastused+1); - ompi_pointer_array_set_item(&ompi_mpi_errcodes, newerrcode->cls, newerrcode); + opal_pointer_array_set_item(&ompi_mpi_errcodes, newerrcode->cls, newerrcode); ompi_mpi_errcode_lastused++; return newerrcode->cls; @@ -537,7 +275,7 @@ { ompi_mpi_errcode_t *errcodep; - errcodep = (ompi_mpi_errcode_t *)ompi_pointer_array_get_item(&ompi_mpi_errcodes, errnum); + errcodep = (ompi_mpi_errcode_t *)opal_pointer_array_get_item(&ompi_mpi_errcodes, errnum); if ( NULL == errcodep ) { return OMPI_ERROR; } @@ -560,6 +298,6 @@ static void ompi_mpi_errcode_destruct(ompi_mpi_errcode_t *errcode) { - ompi_pointer_array_set_item(&ompi_mpi_errcodes, errcode->code, NULL); + opal_pointer_array_set_item(&ompi_mpi_errcodes, errcode->code, NULL); return; } Index: ompi/errhandler/errhandler.c =================================================================== --- ompi/errhandler/errhandler.c (revision 16968) +++ ompi/errhandler/errhandler.c (working copy) @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2007 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -23,13 +23,13 @@ #include "ompi/file/file.h" #include "ompi/errhandler/errhandler.h" #include "ompi/errhandler/errhandler_predefined.h" -#include "ompi/class/ompi_pointer_array.h" +#include "opal/class/opal_pointer_array.h" /* * Table for Fortran <-> C errhandler handle conversion */ -ompi_pointer_array_t *ompi_errhandler_f_to_c_table; +opal_pointer_array_t ompi_errhandler_f_to_c_table; /* @@ -68,8 +68,9 @@ { /* initialize ompi_errhandler_f_to_c_table */ - ompi_errhandler_f_to_c_table = OBJ_NEW(ompi_pointer_array_t); - if (NULL == ompi_errhandler_f_to_c_table){ + OBJ_CONSTRUCT( &ompi_errhandler_f_to_c_table, opal_pointer_array_t); + if( OPAL_SUCCESS != opal_pointer_array_init(&ompi_errhandler_f_to_c_table, 0, + OMPI_FORTRAN_HANDLE_MAX, 64) ) { return OMPI_ERROR; } @@ -166,7 +167,7 @@ decremented and they will not naturally get to 0 during FINALIZE. Hence, we RELEASE on the intrinsics until they are freed. */ - OBJ_RELEASE(ompi_errhandler_f_to_c_table); + OBJ_DESTRUCT(&ompi_errhandler_f_to_c_table); /* All done */ @@ -237,7 +238,7 @@ /* assign entry in fortran <-> c translation array */ - ret_val = ompi_pointer_array_add(ompi_errhandler_f_to_c_table, + ret_val = opal_pointer_array_add(&ompi_errhandler_f_to_c_table, new_errhandler); new_errhandler->eh_f_to_c_index = ret_val; @@ -260,10 +261,10 @@ /* reset the ompi_errhandler_f_to_c_table entry - make sure that the entry is in the table */ - if (NULL!= ompi_pointer_array_get_item(ompi_errhandler_f_to_c_table, + if (NULL!= opal_pointer_array_get_item(&ompi_errhandler_f_to_c_table, errhandler->eh_f_to_c_index)) { - ompi_pointer_array_set_item(ompi_errhandler_f_to_c_table, - errhandler->eh_f_to_c_index, NULL); + opal_pointer_array_set_item(&ompi_errhandler_f_to_c_table, + errhandler->eh_f_to_c_index, NULL); } /* Reset the static state if we're releasing one of the Index: ompi/errhandler/errcode.h =================================================================== --- ompi/errhandler/errcode.h (revision 16968) +++ ompi/errhandler/errcode.h (working copy) @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2007 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -26,11 +26,9 @@ #include "mpi.h" #include "opal/class/opal_object.h" -#include "ompi/class/ompi_pointer_array.h" +#include "opal/class/opal_pointer_array.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS /** * Back-end type for MPI error codes. @@ -48,7 +46,7 @@ }; typedef struct ompi_mpi_errcode_t ompi_mpi_errcode_t; -OMPI_DECLSPEC extern ompi_pointer_array_t ompi_mpi_errcodes; +OMPI_DECLSPEC extern opal_pointer_array_t ompi_mpi_errcodes; OMPI_DECLSPEC extern int ompi_mpi_errcode_lastused; OMPI_DECLSPEC extern int ompi_mpi_errcode_lastpredefined; @@ -72,7 +70,7 @@ { ompi_mpi_errcode_t *err; - err = (ompi_mpi_errcode_t *)ompi_pointer_array_get_item(&ompi_mpi_errcodes, errcode); + err = (ompi_mpi_errcode_t *)opal_pointer_array_get_item(&ompi_mpi_errcodes, errcode); /* If we get a bogus errcode, return MPI_ERR_UNKNOWN */ if (NULL != err) { if ( err->code != MPI_UNDEFINED ) { @@ -100,7 +98,7 @@ return true; } - err = (ompi_mpi_errcode_t *)ompi_pointer_array_get_item(&ompi_mpi_errcodes, errnum); + err = (ompi_mpi_errcode_t *)opal_pointer_array_get_item(&ompi_mpi_errcodes, errnum); if (NULL != err) { if ( MPI_UNDEFINED == err->code) { /* Distinction between error class and error code is that for the @@ -120,7 +118,7 @@ { ompi_mpi_errcode_t *err; - err = (ompi_mpi_errcode_t *)ompi_pointer_array_get_item(&ompi_mpi_errcodes, errnum); + err = (ompi_mpi_errcode_t *)opal_pointer_array_get_item(&ompi_mpi_errcodes, errnum); /* If we get a bogus errcode, return a string indicating that this truly should not happen */ if (NULL != err) { @@ -131,62 +129,59 @@ } - /** - * Initialize the error codes - * - * @returns OMPI_SUCCESS Upon success - * @returns OMPI_ERROR Otherwise - * - * Invoked from ompi_mpi_init(); sets up all static MPI error codes, - */ - int ompi_mpi_errcode_init(void); +/** + * Initialize the error codes + * + * @returns OMPI_SUCCESS Upon success + * @returns OMPI_ERROR Otherwise + * + * Invoked from ompi_mpi_init(); sets up all static MPI error codes, + */ +int ompi_mpi_errcode_init(void); - /** - * Finalize the error codes. - * - * @returns OMPI_SUCCESS Always - * - * Invokes from ompi_mpi_finalize(); tears down the error code array. - */ - int ompi_mpi_errcode_finalize(void); +/** + * Finalize the error codes. + * + * @returns OMPI_SUCCESS Always + * + * Invokes from ompi_mpi_finalize(); tears down the error code array. + */ +int ompi_mpi_errcode_finalize(void); - /** - * Add an error code - * - * @param: error class to which this new error code belongs to - * - * @returns the new error code on SUCCESS (>0) - * @returns OMPI_ERROR otherwise - * - */ - int ompi_mpi_errcode_add (int errclass); +/** + * Add an error code + * + * @param: error class to which this new error code belongs to + * + * @returns the new error code on SUCCESS (>0) + * @returns OMPI_ERROR otherwise + * + */ +int ompi_mpi_errcode_add (int errclass); - /** - * Add an error class - * - * @param: none - * - * @returns the new error class on SUCCESS (>0) - * @returns OMPI_ERROR otherwise - * - */ - int ompi_mpi_errclass_add (void); +/** + * Add an error class + * + * @param: none + * + * @returns the new error class on SUCCESS (>0) + * @returns OMPI_ERROR otherwise + * + */ +int ompi_mpi_errclass_add (void); - /** - * Add an error string to an error code - * - * @param: error code for which the string is defined - * @param: error string to add - * @param: length of the string - * - * @returns OMPI_SUCCESS on success - * @returns OMPI_ERROR on error - */ - int ompi_mpi_errnum_add_string (int errnum, char* string, int len); +/** + * Add an error string to an error code + * + * @param: error code for which the string is defined + * @param: error string to add + * @param: length of the string + * + * @returns OMPI_SUCCESS on success + * @returns OMPI_ERROR on error + */ +int ompi_mpi_errnum_add_string (int errnum, char* string, int len); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS - #endif /* OMPI_MPI_ERRCODE_H */ Index: ompi/errhandler/errhandler.h =================================================================== --- ompi/errhandler/errhandler.h (revision 16968) +++ ompi/errhandler/errhandler.h (working copy) @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2007 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -25,14 +25,13 @@ #include "mpi.h" #include "opal/prefetch.h" #include "opal/class/opal_object.h" -#include "ompi/class/ompi_pointer_array.h" +#include "opal/class/opal_pointer_array.h" #include "ompi/runtime/mpiruntime.h" #include "ompi/errhandler/errhandler_predefined.h" #include "ompi/errhandler/errcode-internal.h" -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif +BEGIN_C_DECLS + /* * These must correspond to the fortran handle indices */ @@ -117,7 +116,7 @@ /** * Table for Fortran <-> C errhandler handle conversion */ -OMPI_DECLSPEC extern ompi_pointer_array_t *ompi_errhandler_f_to_c_table; +OMPI_DECLSPEC extern opal_pointer_array_t ompi_errhandler_f_to_c_table; /** @@ -329,8 +328,7 @@ return false; } -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS + #endif /* OMPI_ERRHANDLER_H */ Index: ompi/errhandler/errcode-internal.c =================================================================== --- ompi/errhandler/errcode-internal.c (revision 16968) +++ ompi/errhandler/errcode-internal.c (working copy) @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2007 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -25,7 +25,7 @@ #include "ompi/errhandler/errcode-internal.h" /* Table holding all error codes */ -ompi_pointer_array_t ompi_errcodes_intern; +opal_pointer_array_t ompi_errcodes_intern; int ompi_errcode_intern_lastused=0; static ompi_errcode_intern_t ompi_success_intern; @@ -58,7 +58,11 @@ int pos=0; /* Initialize the pointer array, which will hold the references to the error objects */ - OBJ_CONSTRUCT(&ompi_errcodes_intern, ompi_pointer_array_t); + OBJ_CONSTRUCT(&ompi_errcodes_intern, opal_pointer_array_t); + if( OPAL_SUCCESS != opal_pointer_array_init(&ompi_errcodes_intern, + 0, OMPI_FORTRAN_HANDLE_MAX, 64) ) { + return OMPI_ERROR; + } /* Initialize now each predefined error code and register it in the pointer-array. */ @@ -67,7 +71,7 @@ ompi_success_intern.mpi_code = MPI_SUCCESS; ompi_success_intern.index = pos++; strncpy(ompi_success_intern.errstring, "OMPI_SUCCESS", OMPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_errcodes_intern, ompi_success_intern.index, + opal_pointer_array_set_item(&ompi_errcodes_intern, ompi_success_intern.index, &ompi_success_intern); OBJ_CONSTRUCT(&ompi_error, ompi_errcode_intern_t); @@ -75,7 +79,7 @@ ompi_error.mpi_code = MPI_ERR_OTHER; ompi_error.index = pos++; strncpy(ompi_error.errstring, "OMPI_ERROR", OMPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_errcodes_intern, ompi_error.index, + opal_pointer_array_set_item(&ompi_errcodes_intern, ompi_error.index, &ompi_error); OBJ_CONSTRUCT(&ompi_err_out_of_resource, ompi_errcode_intern_t); @@ -83,7 +87,7 @@ ompi_err_out_of_resource.mpi_code = MPI_ERR_INTERN; ompi_err_out_of_resource.index = pos++; strncpy(ompi_err_out_of_resource.errstring, "OMPI_ERR_OUT_OF_RESOURCE", OMPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_errcodes_intern, ompi_err_out_of_resource.index, + opal_pointer_array_set_item(&ompi_errcodes_intern, ompi_err_out_of_resource.index, &ompi_err_out_of_resource); OBJ_CONSTRUCT(&ompi_err_temp_out_of_resource, ompi_errcode_intern_t); @@ -91,7 +95,7 @@ ompi_err_temp_out_of_resource.mpi_code = MPI_ERR_INTERN; ompi_err_temp_out_of_resource.index = pos++; strncpy(ompi_err_temp_out_of_resource.errstring, "MPI_ERR_TEMP_OUT_OF_RESOURCE", OMPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_errcodes_intern, ompi_err_temp_out_of_resource.index, + opal_pointer_array_set_item(&ompi_errcodes_intern, ompi_err_temp_out_of_resource.index, &ompi_err_temp_out_of_resource); OBJ_CONSTRUCT(&ompi_err_resource_busy, ompi_errcode_intern_t); @@ -99,7 +103,7 @@ ompi_err_resource_busy.mpi_code = MPI_ERR_INTERN; ompi_err_resource_busy.index = pos++; strncpy(ompi_err_resource_busy.errstring, "OMPI_ERR_RESOURCE_BUSY", OMPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_errcodes_intern, ompi_err_resource_busy.index, + opal_pointer_array_set_item(&ompi_errcodes_intern, ompi_err_resource_busy.index, &ompi_err_resource_busy); OBJ_CONSTRUCT(&ompi_err_bad_param, ompi_errcode_intern_t); @@ -107,7 +111,7 @@ ompi_err_bad_param.mpi_code = MPI_ERR_ARG; ompi_err_bad_param.index = pos++; strncpy(ompi_err_bad_param.errstring, "OMPI_ERR_BAD_PARAM", OMPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_errcodes_intern, ompi_err_bad_param.index, + opal_pointer_array_set_item(&ompi_errcodes_intern, ompi_err_bad_param.index, &ompi_err_bad_param); OBJ_CONSTRUCT(&ompi_err_recv_less_than_posted, ompi_errcode_intern_t); @@ -115,7 +119,7 @@ ompi_err_recv_less_than_posted.mpi_code = MPI_SUCCESS; ompi_err_recv_less_than_posted.index = pos++; strncpy(ompi_err_recv_less_than_posted.errstring, "OMPI_ERR_RECV_LESS_THAN_POSTED", OMPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_errcodes_intern, ompi_err_recv_less_than_posted.index, + opal_pointer_array_set_item(&ompi_errcodes_intern, ompi_err_recv_less_than_posted.index, &ompi_err_recv_less_than_posted); OBJ_CONSTRUCT(&ompi_err_recv_more_than_posted, ompi_errcode_intern_t); @@ -123,7 +127,7 @@ ompi_err_recv_more_than_posted.mpi_code = MPI_ERR_TRUNCATE; ompi_err_recv_more_than_posted.index = pos++; strncpy(ompi_err_recv_more_than_posted.errstring, "OMPI_ERR_RECV_MORE_THAN_POSTED", OMPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_errcodes_intern, ompi_err_recv_more_than_posted.index, + opal_pointer_array_set_item(&ompi_errcodes_intern, ompi_err_recv_more_than_posted.index, &ompi_err_recv_more_than_posted); OBJ_CONSTRUCT(&ompi_err_no_match_yet, ompi_errcode_intern_t); @@ -131,7 +135,7 @@ ompi_err_no_match_yet.mpi_code = MPI_ERR_PENDING; ompi_err_no_match_yet.index = pos++; strncpy(ompi_err_no_match_yet.errstring, "OMPI_ERR_NO_MATCH_YET", OMPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_errcodes_intern, ompi_err_no_match_yet.index, + opal_pointer_array_set_item(&ompi_errcodes_intern, ompi_err_no_match_yet.index, &ompi_err_no_match_yet); OBJ_CONSTRUCT(&ompi_err_fatal, ompi_errcode_intern_t); @@ -139,7 +143,7 @@ ompi_err_fatal.mpi_code = MPI_ERR_INTERN; ompi_err_fatal.index = pos++; strncpy(ompi_err_fatal.errstring, "OMPI_ERR_FATAL", OMPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_errcodes_intern, ompi_err_fatal.index, + opal_pointer_array_set_item(&ompi_errcodes_intern, ompi_err_fatal.index, &ompi_err_fatal); OBJ_CONSTRUCT(&ompi_err_not_implemented, ompi_errcode_intern_t); @@ -147,7 +151,7 @@ ompi_err_not_implemented.mpi_code = MPI_ERR_INTERN; ompi_err_not_implemented.index = pos++; strncpy(ompi_err_not_implemented.errstring, "OMPI_ERR_NOT_IMPLEMENTED", OMPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_errcodes_intern, ompi_err_not_implemented.index, + opal_pointer_array_set_item(&ompi_errcodes_intern, ompi_err_not_implemented.index, &ompi_err_not_implemented); OBJ_CONSTRUCT(&ompi_err_not_supported, ompi_errcode_intern_t); @@ -155,7 +159,7 @@ ompi_err_not_supported.mpi_code = MPI_ERR_INTERN; ompi_err_not_supported.index = pos++; strncpy(ompi_err_not_supported.errstring, "OMPI_ERR_NOT_SUPPORTED", OMPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_errcodes_intern, ompi_err_not_supported.index, + opal_pointer_array_set_item(&ompi_errcodes_intern, ompi_err_not_supported.index, &ompi_err_not_supported); OBJ_CONSTRUCT(&ompi_err_interupted, ompi_errcode_intern_t); @@ -163,7 +167,7 @@ ompi_err_interupted.mpi_code = MPI_ERR_INTERN; ompi_err_interupted.index = pos++; strncpy(ompi_err_interupted.errstring, "OMPI_ERR_INTERUPTED", OMPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_errcodes_intern, ompi_err_interupted.index, + opal_pointer_array_set_item(&ompi_errcodes_intern, ompi_err_interupted.index, &ompi_err_interupted); OBJ_CONSTRUCT(&ompi_err_would_block, ompi_errcode_intern_t); @@ -171,7 +175,7 @@ ompi_err_would_block.mpi_code = MPI_ERR_INTERN; ompi_err_would_block.index = pos++; strncpy(ompi_err_would_block.errstring, "OMPI_ERR_WOULD_BLOCK", OMPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_errcodes_intern, ompi_err_would_block.index, + opal_pointer_array_set_item(&ompi_errcodes_intern, ompi_err_would_block.index, &ompi_err_would_block); OBJ_CONSTRUCT(&ompi_err_in_errno, ompi_errcode_intern_t); @@ -179,7 +183,7 @@ ompi_err_in_errno.mpi_code = MPI_ERR_INTERN; ompi_err_in_errno.index = pos++; strncpy(ompi_err_in_errno.errstring, "OMPI_ERR_IN_ERRNO", OMPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_errcodes_intern, ompi_err_in_errno.index, + opal_pointer_array_set_item(&ompi_errcodes_intern, ompi_err_in_errno.index, &ompi_err_in_errno); OBJ_CONSTRUCT(&ompi_err_unreach, ompi_errcode_intern_t); @@ -187,7 +191,7 @@ ompi_err_unreach.mpi_code = MPI_ERR_INTERN; ompi_err_unreach.index = pos++; strncpy(ompi_err_unreach.errstring, "OMPI_ERR_UNREACH", OMPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_errcodes_intern, ompi_err_unreach.index, + opal_pointer_array_set_item(&ompi_errcodes_intern, ompi_err_unreach.index, &ompi_err_unreach); OBJ_CONSTRUCT(&ompi_err_not_found, ompi_errcode_intern_t); @@ -195,7 +199,7 @@ ompi_err_not_found.mpi_code = MPI_ERR_INTERN; ompi_err_not_found.index = pos++; strncpy(ompi_err_not_found.errstring, "OMPI_ERR_NOT_FOUND", OMPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_errcodes_intern, ompi_err_not_found.index, + opal_pointer_array_set_item(&ompi_errcodes_intern, ompi_err_not_found.index, &ompi_err_not_found); OBJ_CONSTRUCT(&ompi_err_buffer, ompi_errcode_intern_t); @@ -203,7 +207,7 @@ ompi_err_buffer.mpi_code = MPI_ERR_BUFFER; ompi_err_buffer.index = pos++; strncpy(ompi_err_buffer.errstring, "OMPI_ERR_BUFFER", OMPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_errcodes_intern, ompi_err_buffer.index, + opal_pointer_array_set_item(&ompi_errcodes_intern, ompi_err_buffer.index, &ompi_err_buffer); OBJ_CONSTRUCT(&ompi_err_request, ompi_errcode_intern_t); @@ -211,7 +215,7 @@ ompi_err_request.mpi_code = MPI_ERR_REQUEST; ompi_err_request.index = pos++; strncpy(ompi_err_request.errstring, "OMPI_ERR_REQUEST", OMPI_MAX_ERROR_STRING); - ompi_pointer_array_set_item(&ompi_errcodes_intern, ompi_err_request.index, + opal_pointer_array_set_item(&ompi_errcodes_intern, ompi_err_request.index, &ompi_err_request); ompi_errcode_intern_lastused=pos; @@ -256,6 +260,6 @@ static void ompi_errcode_intern_destruct(ompi_errcode_intern_t *errcode) { - ompi_pointer_array_set_item(&ompi_errcodes_intern, errcode->index, NULL); + opal_pointer_array_set_item(&ompi_errcodes_intern, errcode->index, NULL); return; } Index: ompi/request/request.c =================================================================== --- ompi/request/request.c (revision 16968) +++ ompi/request/request.c (working copy) @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2006 The University of Tennessee and The University + * Copyright (c) 2004-2007 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2007 High Performance Computing Center Stuttgart, @@ -24,7 +24,7 @@ #include "ompi/request/request_default.h" #include "ompi/constants.h" -ompi_pointer_array_t ompi_request_f_to_c_table; +opal_pointer_array_t ompi_request_f_to_c_table; size_t ompi_request_waiting = 0; size_t ompi_request_completed = 0; opal_mutex_t ompi_request_lock; @@ -46,8 +46,8 @@ static void ompi_request_construct(ompi_request_t* req) { OMPI_REQUEST_INIT(req, false); - req->req_free = NULL; - req->req_cancel = NULL; + req->req_free = NULL; + req->req_cancel = NULL; req->req_f_to_c_index = MPI_UNDEFINED; req->req_mpi_object.comm = (struct ompi_communicator_t*) NULL; } @@ -93,11 +93,15 @@ int ompi_request_init(void) { - OBJ_CONSTRUCT(&ompi_request_f_to_c_table, ompi_pointer_array_t); OBJ_CONSTRUCT(&ompi_request_lock, opal_mutex_t); OBJ_CONSTRUCT(&ompi_request_cond, opal_condition_t); OBJ_CONSTRUCT(&ompi_request_null, ompi_request_t); + OBJ_CONSTRUCT(&ompi_request_f_to_c_table, opal_pointer_array_t); + if( OPAL_SUCCESS != opal_pointer_array_init(&ompi_request_f_to_c_table, + 0, OMPI_FORTRAN_HANDLE_MAX, 64) ) { + return OMPI_ERROR; + } ompi_request_null.req_type = OMPI_REQUEST_NULL; ompi_request_null.req_status.MPI_SOURCE = MPI_PROC_NULL; ompi_request_null.req_status.MPI_TAG = MPI_ANY_TAG; @@ -109,7 +113,7 @@ ompi_request_null.req_state = OMPI_REQUEST_INACTIVE; ompi_request_null.req_persistent = false; ompi_request_null.req_f_to_c_index = - ompi_pointer_array_add(&ompi_request_f_to_c_table, &ompi_request_null); + opal_pointer_array_add(&ompi_request_f_to_c_table, &ompi_request_null); ompi_request_null.req_free = ompi_request_null_free; ompi_request_null.req_cancel = ompi_request_null_cancel; ompi_request_null.req_mpi_object.comm = &ompi_mpi_comm_world; @@ -141,7 +145,7 @@ ompi_request_empty.req_state = OMPI_REQUEST_ACTIVE; ompi_request_empty.req_persistent = false; ompi_request_empty.req_f_to_c_index = - ompi_pointer_array_add(&ompi_request_f_to_c_table, &ompi_request_empty); + opal_pointer_array_add(&ompi_request_f_to_c_table, &ompi_request_empty); ompi_request_empty.req_free = ompi_request_empty_free; ompi_request_empty.req_cancel = ompi_request_null_cancel; ompi_request_empty.req_mpi_object.comm = &ompi_mpi_comm_world; Index: ompi/request/request.h =================================================================== --- ompi/request/request.h (revision 16968) +++ ompi/request/request.h (working copy) @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2006 The University of Tennessee and The University + * Copyright (c) 2004-2007 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -27,7 +27,7 @@ #include "mpi.h" #include "ompi/class/ompi_free_list.h" -#include "ompi/class/ompi_pointer_array.h" +#include "opal/class/opal_pointer_array.h" #include "opal/threads/condition.h" BEGIN_C_DECLS @@ -105,16 +105,16 @@ * Main top-level request struct definition */ struct ompi_request_t { - ompi_free_list_item_t super; /**< Base type */ - ompi_request_type_t req_type; /**< Enum indicating the type of the request */ - ompi_status_public_t req_status; /**< Completion status */ - volatile bool req_complete; /**< Flag indicating wether request has completed */ - volatile ompi_request_state_t req_state; /**< enum indicate state of the request */ - bool req_persistent; /**< flag indicating if the this is a persistent request */ - int req_f_to_c_index; /**< Index in Fortran <-> C translation array */ - ompi_request_free_fn_t req_free; /**< Called by free */ - ompi_request_cancel_fn_t req_cancel; /**< Optional function to cancel the request */ - ompi_mpi_object_t req_mpi_object; /**< Pointer to MPI object that created this request */ + ompi_free_list_item_t super; /**< Base type */ + ompi_request_type_t req_type; /**< Enum indicating the type of the request */ + ompi_status_public_t req_status; /**< Completion status */ + volatile bool req_complete; /**< Flag indicating wether request has completed */ + volatile ompi_request_state_t req_state; /**< enum indicate state of the request */ + bool req_persistent; /**< flag indicating if the this is a persistent request */ + int req_f_to_c_index; /**< Index in Fortran <-> C translation array */ + ompi_request_free_fn_t req_free; /**< Called by free */ + ompi_request_cancel_fn_t req_cancel; /**< Optional function to cancel the request */ + ompi_mpi_object_t req_mpi_object; /**< Pointer to MPI object that created this request */ }; /** @@ -155,7 +155,7 @@ do { \ (request)->req_state = OMPI_REQUEST_INVALID; \ if (MPI_UNDEFINED != (request)->req_f_to_c_index) { \ - ompi_pointer_array_set_item(&ompi_request_f_to_c_table, \ + opal_pointer_array_set_item(&ompi_request_f_to_c_table, \ (request)->req_f_to_c_index, NULL); \ (request)->req_f_to_c_index = MPI_UNDEFINED; \ } \ @@ -297,7 +297,7 @@ /** * Globals used for tracking requests and request completion. */ -OMPI_DECLSPEC extern ompi_pointer_array_t ompi_request_f_to_c_table; +OMPI_DECLSPEC extern opal_pointer_array_t ompi_request_f_to_c_table; OMPI_DECLSPEC extern size_t ompi_request_waiting; OMPI_DECLSPEC extern size_t ompi_request_completed; OMPI_DECLSPEC extern int32_t ompi_request_poll; Index: ompi/info/info.h =================================================================== --- ompi/info/info.h (revision 16968) +++ ompi/info/info.h (working copy) @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2006 The University of Tennessee and The University + * Copyright (c) 2004-2007 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -24,7 +24,7 @@ #include "mpi.h" #include "opal/util/strncpy.h" #include "opal/class/opal_list.h" -#include "ompi/class/ompi_pointer_array.h" +#include "opal/class/opal_pointer_array.h" #include "opal/threads/mutex.h" @@ -69,183 +69,179 @@ */ typedef struct ompi_info_entry_t ompi_info_entry_t; -#if defined(c_plusplus) || defined(__cplusplus) -extern "C" { -#endif - /** - * Table for Fortran <-> C translation table - */ - extern ompi_pointer_array_t ompi_info_f_to_c_table; +BEGIN_C_DECLS - /** - * Global instance for MPI_INFO_NULL - */ - OMPI_DECLSPEC extern ompi_info_t ompi_mpi_info_null; +/** + * Table for Fortran <-> C translation table + */ +extern opal_pointer_array_t ompi_info_f_to_c_table; - /** - * \internal - * Some declarations needed to use OBJ_NEW and OBJ_DESTRUCT macros - */ - OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_info_t); +/** + * Global instance for MPI_INFO_NULL + */ +OMPI_DECLSPEC extern ompi_info_t ompi_mpi_info_null; - /** - * \internal - * Some declarations needed to use OBJ_NEW and OBJ_DESTRUCT macros - */ - OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_info_entry_t); +/** + * \internal + * Some declarations needed to use OBJ_NEW and OBJ_DESTRUCT macros + */ +OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_info_t); - /** - * This function is invoked during ompi_mpi_init() and sets up - * MPI_Info handling. - */ - int ompi_info_init(void); +/** + * \internal + * Some declarations needed to use OBJ_NEW and OBJ_DESTRUCT macros + */ +OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_info_entry_t); - /** - * This functions is called during ompi_mpi_finalize() and shuts - * down MPI_Info handling. - */ - int ompi_info_finalize(void); +/** + * This function is invoked during ompi_mpi_init() and sets up + * MPI_Info handling. + */ +int ompi_info_init(void); - /** - * ompi_info_dup - Duplicate an 'MPI_Info' object - * - * @param info source info object (handle) - * @param newinfo pointer to the new info object (handle) - * - * @retval MPI_SUCCESS upon success - * @retval MPI_ERR_NO_MEM if out of memory - * - * Not only will the (key, value) pairs be duplicated, the order - * of keys will be the same in 'newinfo' as it is in 'info'. When - * an info object is no longer being used, it should be freed with - * 'MPI_Info_free'. - */ - int ompi_info_dup (ompi_info_t *info, ompi_info_t **newinfo); +/** + * This functions is called during ompi_mpi_finalize() and shuts + * down MPI_Info handling. + */ +int ompi_info_finalize(void); - /* - * Set a new key,value pair on info. - * - * @param info pointer to ompi_info_t object - * @param key pointer to the new key object - * @param value pointer to the new value object - * - * @retval MPI_SUCCESS upon success - * @retval MPI_ERR_NO_MEM if out of memory - */ - int ompi_info_set (ompi_info_t *info, char *key, char *value); +/** + * ompi_info_dup - Duplicate an 'MPI_Info' object + * + * @param info source info object (handle) + * @param newinfo pointer to the new info object (handle) + * + * @retval MPI_SUCCESS upon success + * @retval MPI_ERR_NO_MEM if out of memory + * + * Not only will the (key, value) pairs be duplicated, the order + * of keys will be the same in 'newinfo' as it is in 'info'. When + * an info object is no longer being used, it should be freed with + * 'MPI_Info_free'. + */ +int ompi_info_dup (ompi_info_t *info, ompi_info_t **newinfo); - /** - * ompi_info_free - Free an 'MPI_Info' object. - * - * @param info pointer to info (ompi_info_t *) object to be freed (handle) - * - * @retval MPI_SUCCESS - * @retval MPI_ERR_ARG - * - * Upon successful completion, 'info' will be set to - * 'MPI_INFO_NULL'. Free the info handle and all of its keys and - * values. - */ - int ompi_info_free (ompi_info_t **info); +/* + * Set a new key,value pair on info. + * + * @param info pointer to ompi_info_t object + * @param key pointer to the new key object + * @param value pointer to the new value object + * + * @retval MPI_SUCCESS upon success + * @retval MPI_ERR_NO_MEM if out of memory + */ +int ompi_info_set (ompi_info_t *info, char *key, char *value); - /** - * Get a (key, value) pair from an 'MPI_Info' object - * - * @param info Pointer to ompi_info_t object - * @param key null-terminated character string of the index key - * @param valuelen maximum length of 'value' (integer) - * @param value null-terminated character string of the value - * @param flag true (1) if 'key' defined on 'info', false (0) if not - * (logical) - * - * @retval MPI_SUCCESS - * - * In C and C++, 'valuelen' should be one less than the allocated - * space to allow for for the null terminator. - */ - int ompi_info_get (ompi_info_t *info, char *key, int valuelen, - char *value, int *flag); +/** + * ompi_info_free - Free an 'MPI_Info' object. + * + * @param info pointer to info (ompi_info_t *) object to be freed (handle) + * + * @retval MPI_SUCCESS + * @retval MPI_ERR_ARG + * + * Upon successful completion, 'info' will be set to + * 'MPI_INFO_NULL'. Free the info handle and all of its keys and + * values. + */ +int ompi_info_free (ompi_info_t **info); - /** - * Delete a (key,value) pair from "info" - * - * @param info ompi_info_t pointer on which we need to operate - * @param key The key portion of the (key,value) pair that - * needs to be deleted - * - * @retval MPI_SUCCESS - * @retval MPI_ERR_NOKEY - */ - int ompi_info_delete (ompi_info_t *info, char *key); +/** + * Get a (key, value) pair from an 'MPI_Info' object + * + * @param info Pointer to ompi_info_t object + * @param key null-terminated character string of the index key + * @param valuelen maximum length of 'value' (integer) + * @param value null-terminated character string of the value + * @param flag true (1) if 'key' defined on 'info', false (0) if not + * (logical) + * + * @retval MPI_SUCCESS + * + * In C and C++, 'valuelen' should be one less than the allocated + * space to allow for for the null terminator. + */ +int ompi_info_get (ompi_info_t *info, char *key, int valuelen, + char *value, int *flag); - /** - * @param info - ompi_info_t pointer object (handle) - * @param key - null-terminated character string of the index key - * @param valuelen - length of the value associated with 'key' (integer) - * @param flag - true (1) if 'key' defined on 'info', false (0) if not - * (logical) - * - * @retval MPI_SUCCESS - * @retval MPI_ERR_ARG - * @retval MPI_ERR_INFO_KEY - * - * The length returned in C and C++ does not include the end-of-string - * character. If the 'key' is not found on 'info', 'valuelen' is left - * alone. - */ - OMPI_DECLSPEC int ompi_info_get_valuelen (ompi_info_t *info, char *key, int *valuelen, +/** + * Delete a (key,value) pair from "info" + * + * @param info ompi_info_t pointer on which we need to operate + * @param key The key portion of the (key,value) pair that + * needs to be deleted + * + * @retval MPI_SUCCESS + * @retval MPI_ERR_NOKEY + */ +int ompi_info_delete (ompi_info_t *info, char *key); + +/** + * @param info - ompi_info_t pointer object (handle) + * @param key - null-terminated character string of the index key + * @param valuelen - length of the value associated with 'key' (integer) + * @param flag - true (1) if 'key' defined on 'info', false (0) if not + * (logical) + * + * @retval MPI_SUCCESS + * @retval MPI_ERR_ARG + * @retval MPI_ERR_INFO_KEY + * + * The length returned in C and C++ does not include the end-of-string + * character. If the 'key' is not found on 'info', 'valuelen' is left + * alone. + */ +OMPI_DECLSPEC int ompi_info_get_valuelen (ompi_info_t *info, char *key, int *valuelen, int *flag); - /** - * ompi_info_get_nthkey - Get a key indexed by integer from an 'MPI_Info' o - * - * @param info Pointer to ompi_info_t object - * @param n index of key to retrieve (integer) - * @param key character string of at least 'MPI_MAX_INFO_KEY' characters - * - * @retval MPI_SUCCESS - * @retval MPI_ERR_ARG - */ - int ompi_info_get_nthkey (ompi_info_t *info, int n, char *key); +/** + * ompi_info_get_nthkey - Get a key indexed by integer from an 'MPI_Info' o + * + * @param info Pointer to ompi_info_t object + * @param n index of key to retrieve (integer) + * @param key character string of at least 'MPI_MAX_INFO_KEY' characters + * + * @retval MPI_SUCCESS + * @retval MPI_ERR_ARG + */ +int ompi_info_get_nthkey (ompi_info_t *info, int n, char *key); - int ompi_info_value_to_int(char *value, int *interp); +int ompi_info_value_to_int(char *value, int *interp); - /** - * Convert value string to boolean - * - * Convert value string \c value into a boolean, using the - * interpretation rules specified in MPI-2 Section 4.10. The - * strings "true", "false", and integer numbers can be converted - * into booleans. All others will return \c OMPI_ERR_BAD_PARAM - * - * @param value Value string for info key to interpret - * @param interp returned interpretation of the value key - * - * @retval OMPI_SUCCESS string was successfully interpreted - * @retval OMPI_ERR_BAD_PARAM string was not able to be interpreted - */ - int ompi_info_value_to_bool(char *value, bool *interp); +/** + * Convert value string to boolean + * + * Convert value string \c value into a boolean, using the + * interpretation rules specified in MPI-2 Section 4.10. The + * strings "true", "false", and integer numbers can be converted + * into booleans. All others will return \c OMPI_ERR_BAD_PARAM + * + * @param value Value string for info key to interpret + * @param interp returned interpretation of the value key + * + * @retval OMPI_SUCCESS string was successfully interpreted + * @retval OMPI_ERR_BAD_PARAM string was not able to be interpreted + */ +int ompi_info_value_to_bool(char *value, bool *interp); - /** - * Convert value string to integer - * - * Convert value string \c value into a integer, using the - * interpretation rules specified in MPI-2 Section 4.10. - * All others will return \c OMPI_ERR_BAD_PARAM - * - * @param value Value string for info key to interpret - * @param interp returned interpretation of the value key - * - * @retval OMPI_SUCCESS string was successfully interpreted - * @retval OMPI_ERR_BAD_PARAM string was not able to be interpreted - */ - int ompi_info_value_to_bool(char *value, bool *interp); +/** + * Convert value string to integer + * + * Convert value string \c value into a integer, using the + * interpretation rules specified in MPI-2 Section 4.10. + * All others will return \c OMPI_ERR_BAD_PARAM + * + * @param value Value string for info key to interpret + * @param interp returned interpretation of the value key + * + * @retval OMPI_SUCCESS string was successfully interpreted + * @retval OMPI_ERR_BAD_PARAM string was not able to be interpreted + */ +int ompi_info_value_to_bool(char *value, bool *interp); -#if defined(c_plusplus) || defined(__cplusplus) -} -#endif +END_C_DECLS - /** * Return whether this info has been freed already or not. * @@ -281,5 +277,4 @@ return MPI_SUCCESS; } - #endif /* OMPI_INFO_H */ Index: ompi/info/info.c =================================================================== --- ompi/info/info.c (revision 16968) +++ ompi/info/info.c (working copy) @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2007 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -68,9 +68,8 @@ /* * The global fortran <-> C translation table */ -ompi_pointer_array_t ompi_info_f_to_c_table; +opal_pointer_array_t ompi_info_f_to_c_table; - /* * This function is called during ompi_init and initializes the * fortran to C translation table. @@ -79,7 +78,11 @@ { /* initialize table */ - OBJ_CONSTRUCT(&ompi_info_f_to_c_table, ompi_pointer_array_t); + OBJ_CONSTRUCT(&ompi_info_f_to_c_table, opal_pointer_array_t); + if( OPAL_SUCCESS != opal_pointer_array_init(&ompi_info_f_to_c_table, 0, + OMPI_FORTRAN_HANDLE_MAX, 64) ) { + return OMPI_ERROR; + } /* Create MPI_INFO_NULL */ @@ -303,14 +306,14 @@ don't want to call OBJ_RELEASE on it. */ OBJ_DESTRUCT(&ompi_mpi_info_null); - ompi_pointer_array_set_item(&ompi_info_f_to_c_table, 0, NULL); + opal_pointer_array_set_item(&ompi_info_f_to_c_table, 0, NULL); /* Go through the f2c table and see if anything is left. Free them all. */ - max = ompi_pointer_array_get_size(&ompi_info_f_to_c_table); + max = opal_pointer_array_get_size(&ompi_info_f_to_c_table); for (i = 0; i < max; ++i) { - info = (ompi_info_t *)ompi_pointer_array_get_item(&ompi_info_f_to_c_table, i); + info = (ompi_info_t *)opal_pointer_array_get_item(&ompi_info_f_to_c_table, i); /* If the info was freed but still exists because the user told us to never free handles, then do an OBJ_RELEASE it @@ -319,7 +322,7 @@ if (NULL != info && ompi_debug_no_free_handles && info->i_freed) { OBJ_RELEASE(info); - info = (ompi_info_t *)ompi_pointer_array_get_item(&ompi_info_f_to_c_table, i); + info = (ompi_info_t *)opal_pointer_array_get_item(&ompi_info_f_to_c_table, i); } /* If it still exists here and was never freed, then it's an @@ -369,7 +372,7 @@ */ static void info_constructor(ompi_info_t *info) { - info->i_f_to_c_index = ompi_pointer_array_add(&ompi_info_f_to_c_table, + info->i_f_to_c_index = opal_pointer_array_add(&ompi_info_f_to_c_table, info); info->i_lock = OBJ_NEW(opal_mutex_t); info->i_freed = false; @@ -406,9 +409,9 @@ entry is in the table */ if (MPI_UNDEFINED != info->i_f_to_c_index && - NULL != ompi_pointer_array_get_item(&ompi_info_f_to_c_table, + NULL != opal_pointer_array_get_item(&ompi_info_f_to_c_table, info->i_f_to_c_index)){ - ompi_pointer_array_set_item(&ompi_info_f_to_c_table, + opal_pointer_array_set_item(&ompi_info_f_to_c_table, info->i_f_to_c_index, NULL); } Index: ompi/group/group_init.c =================================================================== --- ompi/group/group_init.c (revision 16968) +++ ompi/group/group_init.c (working copy) @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2006 The University of Tennessee and The University + * Copyright (c) 2004-2007 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -35,7 +35,7 @@ /* * Table for Fortran <-> C group handle conversion */ -ompi_pointer_array_t *ompi_group_f_to_c_table; +opal_pointer_array_t ompi_group_f_to_c_table; /* * Predefined group objects @@ -243,7 +243,7 @@ either). */ /* assign entry in fortran <-> c translation array */ - ret_val = ompi_pointer_array_add(ompi_group_f_to_c_table, new_group); + ret_val = opal_pointer_array_add(&ompi_group_f_to_c_table, new_group); new_group->grp_f_to_c_index = ret_val; new_group->grp_flags = 0; @@ -289,9 +289,9 @@ /* reset the ompi_group_f_to_c_table entry - make sure that the * entry is in the table */ - if (NULL != ompi_pointer_array_get_item(ompi_group_f_to_c_table, + if (NULL != opal_pointer_array_get_item(&ompi_group_f_to_c_table, group->grp_f_to_c_index)) { - ompi_pointer_array_set_item(ompi_group_f_to_c_table, + opal_pointer_array_set_item(&ompi_group_f_to_c_table, group->grp_f_to_c_index, NULL); } @@ -306,7 +306,11 @@ int ompi_group_init(void) { /* initialize ompi_group_f_to_c_table */ - ompi_group_f_to_c_table = OBJ_NEW(ompi_pointer_array_t); + OBJ_CONSTRUCT( &ompi_group_f_to_c_table, opal_pointer_array_t); + if( OPAL_SUCCESS != opal_pointer_array_init(&ompi_group_f_to_c_table, 0, + OMPI_FORTRAN_HANDLE_MAX, 64) ) { + return OMPI_ERROR; + } /* add MPI_GROUP_NULL to table */ OBJ_CONSTRUCT(&ompi_mpi_group_null, ompi_group_t); @@ -339,7 +343,7 @@ ompi_mpi_group_null.grp_flags = 0; OBJ_DESTRUCT(&ompi_mpi_group_empty); - OBJ_RELEASE(ompi_group_f_to_c_table); + OBJ_DESTRUCT(&ompi_group_f_to_c_table); return OMPI_SUCCESS; } Index: ompi/group/group.h =================================================================== --- ompi/group/group.h (revision 16968) +++ ompi/group/group.h (working copy) @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2007 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -29,7 +29,7 @@ #include "opal/util/output.h" #include "mpi.h" -#include "ompi/class/ompi_pointer_array.h" +#include "opal/class/opal_pointer_array.h" #if defined(c_plusplus) || defined(__cplusplus) extern "C" { #endif @@ -120,7 +120,7 @@ /** * Table for Fortran <-> C group handle conversion */ -OMPI_DECLSPEC extern struct ompi_pointer_array_t *ompi_group_f_to_c_table; +OMPI_DECLSPEC extern struct opal_pointer_array_t ompi_group_f_to_c_table; OMPI_DECLSPEC extern ompi_group_t ompi_mpi_group_null; Index: ompi/win/win.h =================================================================== --- ompi/win/win.h (revision 16968) +++ ompi/win/win.h (working copy) @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2007 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -48,7 +48,7 @@ #define OMPI_WIN_STARTED 0x00000040 #define OMPI_WIN_LOCK_ACCESS 0x00000080 -OMPI_DECLSPEC extern ompi_pointer_array_t ompi_mpi_windows; +OMPI_DECLSPEC extern opal_pointer_array_t ompi_mpi_windows; struct ompi_win_t { opal_object_t w_base; Index: ompi/win/win.c =================================================================== --- ompi/win/win.c (revision 16968) +++ ompi/win/win.c (working copy) @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2007 The University of Tennessee and The University * of Tennessee Research Foundation. All rights * reserved. * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, @@ -33,7 +33,7 @@ * Table for Fortran <-> C communicator handle conversion. Note that * these are not necessarily global. */ -ompi_pointer_array_t ompi_mpi_windows; +opal_pointer_array_t ompi_mpi_windows; ompi_win_t ompi_mpi_win_null; @@ -47,7 +47,11 @@ ompi_win_init(void) { /* setup window Fortran array */ - OBJ_CONSTRUCT(&ompi_mpi_windows, ompi_pointer_array_t); + OBJ_CONSTRUCT(&ompi_mpi_windows, opal_pointer_array_t); + if( OPAL_SUCCESS != opal_pointer_array_init(&ompi_mpi_windows, 0, + OMPI_FORTRAN_HANDLE_MAX, 64) ) { + return OMPI_ERROR; + } /* Setup MPI_WIN_NULL */ OBJ_CONSTRUCT(&ompi_mpi_win_null, ompi_win_t); @@ -55,7 +59,7 @@ ompi_mpi_win_null.w_group = &ompi_mpi_group_null; OBJ_RETAIN(&ompi_mpi_group_null); ompi_win_set_name(&ompi_mpi_win_null, "MPI_WIN_NULL"); - ompi_pointer_array_set_item(&ompi_mpi_windows, 0, &ompi_mpi_win_null); + opal_pointer_array_set_item(&ompi_mpi_windows, 0, &ompi_mpi_win_null); return OMPI_SUCCESS; } @@ -126,7 +130,7 @@ } /* fill in Fortran index */ - win->w_f_to_c_index = ompi_pointer_array_add(&ompi_mpi_windows, win); + win->w_f_to_c_index = opal_pointer_array_add(&ompi_mpi_windows, win); if (-1 == win->w_f_to_c_index) { ompi_win_free(win); return OMPI_ERR_OUT_OF_RESOURCE; @@ -144,7 +148,7 @@ int ret = win->w_osc_module->osc_free(win); if (-1 != win->w_f_to_c_index) { - ompi_pointer_array_set_item(&ompi_mpi_windows, + opal_pointer_array_set_item(&ompi_mpi_windows, win->w_f_to_c_index, NULL); } Index: ompi/communicator/comm_init.c =================================================================== --- ompi/communicator/comm_init.c (revision 16968) +++ ompi/communicator/comm_init.c (working copy) @@ -2,7 +2,7 @@ * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana * University Research and Technology * Corporation. All rights reserved. - * Copyright (c) 2004-2005 The University of Tennessee and The University + * Copyright (c) 2004-2007 The University