1
1

Replace the ompi_pointer_array with opal_pointer_array. The next step

(sometimes after the merge with the ORTE branch), the opal_pointer_array
will became the only pointer_array implementation (the orte_pointer_array
will be removed).

This commit was SVN r17007.
Этот коммит содержится в:
George Bosilca 2007-12-21 06:02:00 +00:00
родитель a1b0914037
Коммит 906e8bf1d1
81 изменённых файлов: 1145 добавлений и 1035 удалений

Просмотреть файл

@ -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,14 +24,12 @@ headers += \
class/ompi_fifo.h \
class/ompi_free_list.h \
class/ompi_bitmap.h \
class/ompi_pointer_array.h \
class/ompi_rb_tree.h \
class/ompi_rb_tree.h \
class/ompi_seq_tracker.h
libmpi_la_SOURCES += \
class/ompi_bitmap.c \
class/ompi_free_list.c \
class/ompi_pointer_array.c \
class/ompi_rb_tree.c \
class/ompi_rb_tree.c \
class/ompi_seq_tracker.c

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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,
@ -40,7 +41,6 @@
* ORTE implementations. As of this writing:
*
* - ompi_bitmap and orte_bitmap
* - ompi_pointer_array and orte_pointer_array
* - opal_value_array and orte_value_array
*
* Short version:

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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 +28,7 @@
#include "ompi/communicator/communicator.h"
#include "ompi/proc/proc.h"
#include "ompi/constants.h"
#include "ompi/class/ompi_pointer_array.h"
#include "opal/class/opal_pointer_array.h"
#include "opal/class/opal_list.h"
#include "ompi/mca/pml/pml.h"
#include "ompi/mca/coll/base/base.h"
@ -181,7 +182,7 @@ int ompi_comm_nextcid ( ompi_communicator_t* newcomm,
for (i=start; i < mca_pml.pml_max_contextid ; i++) {
flag=ompi_pointer_array_test_and_set_item(&ompi_mpi_communicators,
flag=opal_pointer_array_test_and_set_item(&ompi_mpi_communicators,
i, comm);
if (true == flag) {
nextlocal_cid = i;
@ -195,10 +196,10 @@ int ompi_comm_nextcid ( ompi_communicator_t* newcomm,
response = 1; /* fine with me */
}
else {
ompi_pointer_array_set_item(&ompi_mpi_communicators,
opal_pointer_array_set_item(&ompi_mpi_communicators,
nextlocal_cid, NULL);
flag = ompi_pointer_array_test_and_set_item(&ompi_mpi_communicators,
flag = opal_pointer_array_test_and_set_item(&ompi_mpi_communicators,
nextcid, comm );
if (true == flag) {
response = 1; /* works as well */
@ -217,7 +218,7 @@ int ompi_comm_nextcid ( ompi_communicator_t* newcomm,
else if ( 0 == glresponse ) {
if ( 1 == response ) {
/* we could use that, but other don't agree */
ompi_pointer_array_set_item(&ompi_mpi_communicators,
opal_pointer_array_set_item(&ompi_mpi_communicators,
nextcid, NULL);
}
start = nextcid+1; /* that's where we can start the next round */
@ -227,7 +228,7 @@ int ompi_comm_nextcid ( ompi_communicator_t* newcomm,
/* set the according values to the newcomm */
newcomm->c_contextid = nextcid;
newcomm->c_f_to_c_index = newcomm->c_contextid;
ompi_pointer_array_set_item (&ompi_mpi_communicators, nextcid, newcomm);
opal_pointer_array_set_item (&ompi_mpi_communicators, nextcid, newcomm);
/* for synchronization purposes, avoids receiving fragments for
a communicator id, which might not yet been known. For single-threaded
@ -273,7 +274,7 @@ int ompi_comm_nextcid ( ompi_communicator_t* newcomm,
MPI_UNDEFINED != comm->c_id_start_index &&
block > comm->c_id_available - comm->c_id_start_index) {
nextcid = comm->c_id_available;
flag=ompi_pointer_array_test_and_set_item (&ompi_mpi_communicators,
flag=opal_pointer_array_test_and_set_item (&ompi_mpi_communicators,
nextcid, comm);
}
/**
@ -295,7 +296,7 @@ int ompi_comm_nextcid ( ompi_communicator_t* newcomm,
/* set the according values to the newcomm */
newcomm->c_contextid = nextcid;
newcomm->c_f_to_c_index = newcomm->c_contextid;
ompi_pointer_array_set_item (&ompi_mpi_communicators, nextcid, newcomm);
opal_pointer_array_set_item (&ompi_mpi_communicators, nextcid, newcomm);
return (MPI_SUCCESS);

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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,
@ -863,9 +864,9 @@ int ompi_comm_dyn_finalize (void)
return OMPI_ERR_OUT_OF_RESOURCE;
}
max = ompi_pointer_array_get_size(&ompi_mpi_communicators);
max = opal_pointer_array_get_size(&ompi_mpi_communicators);
for ( i=3; i<max; i++ ) {
comm = (ompi_communicator_t*)ompi_pointer_array_get_item(&ompi_mpi_communicators,i);
comm = (ompi_communicator_t*)opal_pointer_array_get_item(&ompi_mpi_communicators,i);
if ( OMPI_COMM_IS_DYNAMIC(comm)) {
objs[j++]=ompi_comm_disconnect_init(comm);
}

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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,
@ -39,7 +40,7 @@
** on cid.
**
*/
ompi_pointer_array_t ompi_mpi_communicators;
opal_pointer_array_t ompi_mpi_communicators;
ompi_communicator_t ompi_mpi_comm_world;
ompi_communicator_t ompi_mpi_comm_self;
@ -66,8 +67,11 @@ int ompi_comm_init(void)
size_t size;
/* Setup communicator array */
OBJ_CONSTRUCT(&ompi_mpi_communicators, ompi_pointer_array_t);
OBJ_CONSTRUCT(&ompi_mpi_communicators, opal_pointer_array_t);
if( OPAL_SUCCESS != opal_pointer_array_init(&ompi_mpi_communicators, 0,
OMPI_FORTRAN_HANDLE_MAX, 64) ) {
return OMPI_ERROR;
}
/* Setup MPI_COMM_WORLD */
OBJ_CONSTRUCT(&ompi_mpi_comm_world, ompi_communicator_t);
@ -91,7 +95,7 @@ int ompi_comm_init(void)
ompi_mpi_comm_world.error_handler = &ompi_mpi_errors_are_fatal;
OBJ_RETAIN( &ompi_mpi_errors_are_fatal );
OMPI_COMM_SET_PML_ADDED(&ompi_mpi_comm_world);
ompi_pointer_array_set_item (&ompi_mpi_communicators, 0, &ompi_mpi_comm_world);
opal_pointer_array_set_item (&ompi_mpi_communicators, 0, &ompi_mpi_comm_world);
strncpy (ompi_mpi_comm_world.c_name, "MPI_COMM_WORLD",
strlen("MPI_COMM_WORLD")+1 );
@ -124,7 +128,7 @@ int ompi_comm_init(void)
ompi_mpi_comm_self.error_handler = &ompi_mpi_errors_are_fatal;
OBJ_RETAIN( &ompi_mpi_errors_are_fatal );
OMPI_COMM_SET_PML_ADDED(&ompi_mpi_comm_self);
ompi_pointer_array_set_item (&ompi_mpi_communicators, 1, &ompi_mpi_comm_self);
opal_pointer_array_set_item (&ompi_mpi_communicators, 1, &ompi_mpi_comm_self);
strncpy(ompi_mpi_comm_self.c_name,"MPI_COMM_SELF",strlen("MPI_COMM_SELF")+1);
ompi_mpi_comm_self.c_flags |= OMPI_COMM_NAMEISSET;
@ -148,7 +152,7 @@ int ompi_comm_init(void)
ompi_mpi_comm_null.error_handler = &ompi_mpi_errors_are_fatal;
OBJ_RETAIN( &ompi_mpi_errors_are_fatal );
ompi_pointer_array_set_item (&ompi_mpi_communicators, 2, &ompi_mpi_comm_null);
opal_pointer_array_set_item (&ompi_mpi_communicators, 2, &ompi_mpi_comm_null);
strncpy(ompi_mpi_comm_null.c_name,"MPI_COMM_NULL",strlen("MPI_COMM_NULL")+1);
ompi_mpi_comm_null.c_flags |= OMPI_COMM_NAMEISSET;
@ -240,13 +244,13 @@ int ompi_comm_finalize(void)
OBJ_DESTRUCT( &ompi_mpi_comm_null );
/* Check whether we have some communicators left */
max = ompi_pointer_array_get_size(&ompi_mpi_communicators);
max = opal_pointer_array_get_size(&ompi_mpi_communicators);
for ( i=3; i<max; i++ ) {
comm = (ompi_communicator_t *)ompi_pointer_array_get_item(&ompi_mpi_communicators, i);
comm = (ompi_communicator_t *)opal_pointer_array_get_item(&ompi_mpi_communicators, i);
if ( NULL != comm ) {
/* Communicator has not been freed before finalize */
OBJ_RELEASE(comm);
comm=(ompi_communicator_t *)ompi_pointer_array_get_item(&ompi_mpi_communicators, i);
comm=(ompi_communicator_t *)opal_pointer_array_get_item(&ompi_mpi_communicators, i);
if ( NULL != comm ) {
/* Still here ? */
if ( ompi_debug_show_handle_leaks && !(OMPI_COMM_IS_FREED(comm)) ){
@ -411,9 +415,9 @@ static void ompi_comm_destruct(ompi_communicator_t* comm)
/* reset the ompi_comm_f_to_c_table entry */
if ( MPI_UNDEFINED != comm->c_f_to_c_index &&
NULL != ompi_pointer_array_get_item(&ompi_mpi_communicators,
NULL != opal_pointer_array_get_item(&ompi_mpi_communicators,
comm->c_f_to_c_index )) {
ompi_pointer_array_set_item ( &ompi_mpi_communicators,
opal_pointer_array_set_item ( &ompi_mpi_communicators,
comm->c_f_to_c_index, NULL);
}

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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,
@ -89,7 +90,7 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_communicator_t);
#define OMPI_COMM_BLOCK_WORLD 16
#define OMPI_COMM_BLOCK_OTHERS 8
OMPI_DECLSPEC extern ompi_pointer_array_t ompi_mpi_communicators;
OMPI_DECLSPEC extern opal_pointer_array_t ompi_mpi_communicators;
struct ompi_communicator_t {
opal_object_t c_base;
@ -231,7 +232,7 @@ struct ompi_communicator_t {
static inline ompi_communicator_t *ompi_comm_lookup(uint32_t cid)
{
/* array of pointers to communicators, indexed by context ID */
return (ompi_communicator_t*)ompi_pointer_array_get_item(&ompi_mpi_communicators, cid);
return (ompi_communicator_t*)opal_pointer_array_get_item(&ompi_mpi_communicators, cid);
}
static inline struct ompi_proc_t* ompi_comm_peer_lookup(ompi_communicator_t* comm, int peer_id)

Просмотреть файл

@ -3,7 +3,7 @@
* Copyright (c) 2004-2006 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-2006 High Performance Computing Center Stuttgart,
@ -42,12 +42,12 @@
#include "ompi/constants.h"
#include "opal/class/opal_object.h"
#include "opal/class/opal_hash_table.h"
#include "ompi/class/ompi_pointer_array.h"
#include "opal/class/opal_pointer_array.h"
#include "mpi.h"
BEGIN_C_DECLS
extern ompi_pointer_array_t *ompi_datatype_f_to_c_table;
extern struct opal_pointer_array_t ompi_datatype_f_to_c_table;
/* if there are more basic datatypes than the number of bytes in the int type
* the bdt_used field of the data description struct should be changed to long.

Просмотреть файл

@ -3,7 +3,7 @@
* Copyright (c) 2004-2006 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-2006 High Performance Computing Center Stuttgart,
@ -22,6 +22,7 @@
#include "ompi/datatype/datatype_internal.h"
#include "limits.h"
#include "ompi/attribute/attribute.h"
#include "opal/class/opal_pointer_array.h"
static void __get_free_dt_struct( ompi_datatype_t* pData )
{
@ -45,7 +46,7 @@ static void __get_free_dt_struct( ompi_datatype_t* pData )
pData->true_ub = LONG_MIN;
pData->lb = LONG_MAX;
pData->ub = LONG_MIN;
pData->d_f_to_c_index = ompi_pointer_array_add(ompi_datatype_f_to_c_table, pData);
pData->d_f_to_c_index = opal_pointer_array_add(&ompi_datatype_f_to_c_table, pData);
pData->d_keyhash = NULL;
pData->name[0] = '\0';
pData->packed_description = NULL;
@ -80,8 +81,8 @@ static void __destroy_ddt_struct( ompi_datatype_t* datatype )
free( datatype->packed_description );
datatype->packed_description = NULL;
}
if( NULL != ompi_pointer_array_get_item(ompi_datatype_f_to_c_table, datatype->d_f_to_c_index) ){
ompi_pointer_array_set_item( ompi_datatype_f_to_c_table, datatype->d_f_to_c_index, NULL );
if( NULL != opal_pointer_array_get_item(&ompi_datatype_f_to_c_table, datatype->d_f_to_c_index) ){
opal_pointer_array_set_item( &ompi_datatype_f_to_c_table, datatype->d_f_to_c_index, NULL );
}
/* any pending attributes ? */
if (NULL != datatype->d_keyhash) {

Просмотреть файл

@ -3,7 +3,7 @@
* Copyright (c) 2004-2006 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-2006 High Performance Computing Center Stuttgart,
@ -37,7 +37,7 @@ ompi_ddt_match_size( int size, uint16_t datakind, uint16_t datalang )
for( i = 0; i < ompi_ddt_number_of_predefined_data; i++ ) {
datatype = (ompi_datatype_t*)ompi_pointer_array_get_item(ompi_datatype_f_to_c_table, i);
datatype = (ompi_datatype_t*)opal_pointer_array_get_item(&ompi_datatype_f_to_c_table, i);
if( (datatype->flags & DT_FLAG_DATA_LANGUAGE) != datalang )
continue;

Просмотреть файл

@ -283,7 +283,7 @@ const ompi_datatype_t* ompi_ddt_basicDatatypes[DT_MAX_PREDEFINED] = {
&ompi_mpi_unavailable
};
ompi_pointer_array_t *ompi_datatype_f_to_c_table = NULL;
opal_pointer_array_t ompi_datatype_f_to_c_table;
size_t ompi_ddt_local_sizes[DT_MAX_PREDEFINED];
@ -430,8 +430,9 @@ int32_t ompi_ddt_init( void )
}
/* Create the f2c translation table */
ompi_datatype_f_to_c_table = OBJ_NEW(ompi_pointer_array_t);
if (NULL == ompi_datatype_f_to_c_table) {
OBJ_CONSTRUCT(&ompi_datatype_f_to_c_table, opal_pointer_array_t);
if( OPAL_SUCCESS != opal_pointer_array_init(&ompi_datatype_f_to_c_table,
0, OMPI_FORTRAN_HANDLE_MAX, 64)) {
return OMPI_ERROR;
}
/* All temporary datatypes created on the following statement will get registered
@ -647,12 +648,12 @@ int32_t ompi_ddt_init( void )
/* This macro makes everything significantly easier to read below.
All hail the moog! :-) */
#define MOOG(name) \
{ \
ompi_mpi_##name.d_f_to_c_index = \
ompi_pointer_array_add(ompi_datatype_f_to_c_table, &ompi_mpi_##name); \
#define MOOG(name) \
{ \
ompi_mpi_##name.d_f_to_c_index = \
opal_pointer_array_add(&ompi_datatype_f_to_c_table, &ompi_mpi_##name); \
if( ompi_ddt_number_of_predefined_data < (ompi_mpi_##name).d_f_to_c_index ) \
ompi_ddt_number_of_predefined_data = (ompi_mpi_##name).d_f_to_c_index; \
ompi_ddt_number_of_predefined_data = (ompi_mpi_##name).d_f_to_c_index; \
}
/*
@ -723,7 +724,7 @@ int32_t ompi_ddt_init( void )
MOOG(cxx_ldblcplex);
for( i = 0; i < ompi_mpi_cxx_ldblcplex.d_f_to_c_index; i++ ) {
ompi_datatype_t* datatype = (ompi_datatype_t*)ompi_pointer_array_get_item( ompi_datatype_f_to_c_table, i );
ompi_datatype_t* datatype = (ompi_datatype_t*)opal_pointer_array_get_item(&ompi_datatype_f_to_c_table, i );
if( (datatype->ub - datatype->lb) == (ptrdiff_t)datatype->size ) {
datatype->flags |= DT_FLAG_NO_GAPS;
@ -752,7 +753,7 @@ int32_t ompi_ddt_finalize( void )
}
/* Get rid of the Fortran2C translation table */
OBJ_RELEASE(ompi_datatype_f_to_c_table);
OBJ_DESTRUCT(&ompi_datatype_f_to_c_table);
#if defined(VERBOSE)
if( ompi_ddt_dfd != -1 )

Просмотреть файл

@ -628,16 +628,16 @@ int mqs_image_has_queues (mqs_image *image, char **message)
* And now let's look at the communicator and group structures.
*/
{
mqs_type* qh_type = mqs_find_type( image, "ompi_pointer_array_t", mqs_lang_c );
mqs_type* qh_type = mqs_find_type( image, "opal_pointer_array_t", mqs_lang_c );
if( !qh_type ) {
missing_in_action = "ompi_pointer_array_t";
missing_in_action = "opal_pointer_array_t";
goto type_missing;
}
i_info->ompi_pointer_array_t.size = mqs_sizeof(qh_type);
i_info->ompi_pointer_array_t.offset.lowest_free = mqs_field_offset(qh_type, "lowest_free");
i_info->ompi_pointer_array_t.offset.number_free = mqs_field_offset(qh_type, "number_free");
i_info->ompi_pointer_array_t.offset.size = mqs_field_offset(qh_type, "size");
i_info->ompi_pointer_array_t.offset.addr = mqs_field_offset(qh_type, "addr");
i_info->opal_pointer_array_t.size = mqs_sizeof(qh_type);
i_info->opal_pointer_array_t.offset.lowest_free = mqs_field_offset(qh_type, "lowest_free");
i_info->opal_pointer_array_t.offset.number_free = mqs_field_offset(qh_type, "number_free");
i_info->opal_pointer_array_t.offset.size = mqs_field_offset(qh_type, "size");
i_info->opal_pointer_array_t.offset.addr = mqs_field_offset(qh_type, "addr");
}
{
mqs_type* qh_type = mqs_find_type( image, "ompi_communicator_t", mqs_lang_c );
@ -824,10 +824,10 @@ static int communicators_changed (mqs_process *proc)
mqs_tword_t lowest_free; /* the lowest free communicator */
lowest_free = fetch_int( proc,
p_info->commlist_base + i_info->ompi_pointer_array_t.offset.lowest_free,
p_info->commlist_base + i_info->opal_pointer_array_t.offset.lowest_free,
p_info );
number_free = fetch_int( proc,
p_info->commlist_base + i_info->ompi_pointer_array_t.offset.number_free,
p_info->commlist_base + i_info->opal_pointer_array_t.offset.number_free,
p_info );
if( (lowest_free != p_info->comm_lowest_free) ||
(number_free != p_info->comm_number_free) ) {
@ -889,20 +889,20 @@ static int rebuild_communicator_list (mqs_process *proc)
DEBUG(VERBOSE_COMM,("rebuild_communicator_list called "
"(commlist_base %llx, array offset %ld array size %d)\n",
(long long)p_info->commlist_base,
(long)i_info->ompi_pointer_array_t.offset.addr,
i_info->ompi_pointer_array_t.size));
(long)i_info->opal_pointer_array_t.offset.addr,
i_info->opal_pointer_array_t.size));
/**
* Start by getting the number of registered communicators in the
* global communicator array.
*/
comm_size = fetch_int( proc,
p_info->commlist_base + i_info->ompi_pointer_array_t.offset.size,
p_info->commlist_base + i_info->opal_pointer_array_t.offset.size,
p_info );
lowest_free = fetch_int( proc,
p_info->commlist_base + i_info->ompi_pointer_array_t.offset.lowest_free,
p_info->commlist_base + i_info->opal_pointer_array_t.offset.lowest_free,
p_info );
number_free = fetch_int( proc,
p_info->commlist_base + i_info->ompi_pointer_array_t.offset.number_free,
p_info->commlist_base + i_info->opal_pointer_array_t.offset.number_free,
p_info );
p_info->comm_lowest_free = lowest_free;
p_info->comm_number_free = number_free;
@ -923,7 +923,7 @@ static int rebuild_communicator_list (mqs_process *proc)
/* Now get the pointer to the array of pointers to communicators */
comm_addr_base =
fetch_pointer( proc,
p_info->commlist_base + i_info->ompi_pointer_array_t.offset.addr,
p_info->commlist_base + i_info->opal_pointer_array_t.offset.addr,
p_info );
DEBUG(VERBOSE_COMM,("Array of communicators starting at 0x%llx (sizeof(mqs_taddr_t*) = %d)\n",
(long long)comm_addr_base, (int)sizeof(mqs_taddr_t)));

Просмотреть файл

@ -139,7 +139,7 @@ typedef struct
int size;
int addr;
} offset;
} ompi_pointer_array_t;
} opal_pointer_array_t;
struct {
int size;
struct {

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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,
@ -41,7 +42,7 @@
#include "ompi/mca/pml/base/pml_base_request.h"
#include "ompi/mca/pml/base/pml_base_sendreq.h"
#include "ompi/mca/pml/base/pml_base_recvreq.h"
#include "ompi/class/ompi_pointer_array.h"
#include "opal/class/opal_pointer_array.h"
#include "ompi/communicator/communicator.h"
#include "ompi/group/group.h"
#include "ompi/datatype/datatype.h"
@ -88,7 +89,7 @@ OMPI_DECLSPEC ompi_request_t* ompi_request_t_type_inclusion = NULL;
OMPI_DECLSPEC mca_pml_base_request_t* mca_pml_base_request_t_type_inclusion = NULL;
OMPI_DECLSPEC mca_pml_base_send_request_t* mca_pml_base_send_request_t_type_inclusion = NULL;
OMPI_DECLSPEC mca_pml_base_recv_request_t* mca_pml_base_recv_request_t_type_inclusion = NULL;
OMPI_DECLSPEC ompi_pointer_array_t* ompi_pointer_array_t_type_inclusion = NULL;
OMPI_DECLSPEC opal_pointer_array_t* opal_pointer_array_t_type_inclusion = NULL;
OMPI_DECLSPEC ompi_communicator_t* ompi_communicator_t_type_inclusion = NULL;
OMPI_DECLSPEC ompi_group_t* ompi_group_t_type_inclusion = NULL;
OMPI_DECLSPEC ompi_status_public_t* ompi_status_public_t_type_inclusion = NULL;

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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 +26,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 +59,11 @@ int ompi_errcode_intern_init (void)
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 +72,7 @@ int ompi_errcode_intern_init (void)
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 +80,7 @@ int ompi_errcode_intern_init (void)
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 +88,7 @@ int ompi_errcode_intern_init (void)
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 +96,7 @@ int ompi_errcode_intern_init (void)
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 +104,7 @@ int ompi_errcode_intern_init (void)
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 +112,7 @@ int ompi_errcode_intern_init (void)
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 +120,7 @@ int ompi_errcode_intern_init (void)
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 +128,7 @@ int ompi_errcode_intern_init (void)
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 +136,7 @@ int ompi_errcode_intern_init (void)
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 +144,7 @@ int ompi_errcode_intern_init (void)
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 +152,7 @@ int ompi_errcode_intern_init (void)
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 +160,7 @@ int ompi_errcode_intern_init (void)
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 +168,7 @@ int ompi_errcode_intern_init (void)
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 +176,7 @@ int ompi_errcode_intern_init (void)
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 +184,7 @@ int ompi_errcode_intern_init (void)
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 +192,7 @@ int ompi_errcode_intern_init (void)
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 +200,7 @@ int ompi_errcode_intern_init (void)
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 +208,7 @@ int ompi_errcode_intern_init (void)
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 +216,7 @@ int ompi_errcode_intern_init (void)
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 +261,6 @@ static void ompi_errcode_intern_construct(ompi_errcode_intern_t *errcode)
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;
}

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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 +26,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 +44,7 @@ struct ompi_errcode_intern_t {
};
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 +65,7 @@ static inline int ompi_errcode_get_mpi_code(int errcode)
/* Otherwise, it's an internal OMPI code and we need to translate
it */
for ( __i=0; __i<ompi_errcode_intern_lastused; __i++) {
__errc = (ompi_errcode_intern_t *)ompi_pointer_array_get_item(&ompi_errcodes_intern, __i);
__errc = (ompi_errcode_intern_t *)opal_pointer_array_get_item(&ompi_errcodes_intern, __i);
if ( __errc->code == errcode ) {
__ret = __errc->mpi_code;
break;
@ -73,30 +74,25 @@ static inline int ompi_errcode_get_mpi_code(int errcode)
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 */

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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 +28,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;
@ -96,324 +97,328 @@ 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);
opal_pointer_array_set_item(&ompi_mpi_errcodes, MPI_SUCCESS, &ompi_success);
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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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);
opal_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,
opal_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);
@ -421,14 +426,14 @@ int ompi_mpi_errcode_init (void)
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,
opal_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);
opal_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;
@ -445,7 +450,7 @@ int ompi_mpi_errcode_finalize(void)
* 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 +520,7 @@ int ompi_mpi_errcode_add(int errclass )
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 +532,7 @@ int ompi_mpi_errclass_add(void)
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 +542,7 @@ int ompi_mpi_errnum_add_string(int errnum, char *errstring, int len)
{
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 +565,6 @@ static void ompi_mpi_errcode_construct(ompi_mpi_errcode_t *errcode)
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;
}

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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 +27,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 +47,7 @@ struct ompi_mpi_errcode_t {
};
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 +71,7 @@ static inline int ompi_mpi_errcode_get_class (int errcode)
{
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 +99,7 @@ static inline int ompi_mpi_errnum_is_class ( int errnum )
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 +119,7 @@ static inline char* ompi_mpi_errnum_get_string (int errnum)
{
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 +130,59 @@ static inline char* ompi_mpi_errnum_get_string (int errnum)
}
/**
* 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 */

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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 +24,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 +69,9 @@ int ompi_errhandler_init(void)
{
/* 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 +168,7 @@ int ompi_errhandler_finalize(void)
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 +239,7 @@ static void ompi_errhandler_construct(ompi_errhandler_t *new_errhandler)
/* 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 +262,10 @@ static void ompi_errhandler_destruct(ompi_errhandler_t *errhandler)
/* 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

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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 +26,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 +117,7 @@ OMPI_DECLSPEC extern ompi_errhandler_t ompi_mpi_errors_throw_exceptions;
/**
* 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 +329,7 @@ static inline bool ompi_errhandler_is_intrinsic(ompi_errhandler_t *errhandler)
return false;
}
#if defined(c_plusplus) || defined(__cplusplus)
}
#endif
END_C_DECLS
#endif /* OMPI_ERRHANDLER_H */

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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 +29,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 +60,11 @@ int ompi_file_init(void)
{
/* 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 +73,7 @@ int ompi_file_init(void)
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 +164,14 @@ int ompi_file_finalize(void)
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 +181,7 @@ int ompi_file_finalize(void)
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 +228,7 @@ static void file_constructor(ompi_file_t *file)
/* 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 +318,9 @@ static void file_destructor(ompi_file_t *file)
/* 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);
}
}

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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 +32,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 +106,79 @@ OMPI_DECLSPEC extern ompi_file_t ompi_mpi_file_null;
/**
* 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 +197,6 @@ static inline bool ompi_file_invalid(ompi_file_t *file)
0 != (file->f_flags & OMPI_FILE_ISCLOSED));
}
#if defined(c_plusplus) || defined(__cplusplus)
}
#endif
END_C_DECLS
#endif /* OMPI_FILE_H */

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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 +30,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 +121,7 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_group_t);
/**
* 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;

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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 +36,7 @@ OBJ_CLASS_INSTANCE(ompi_group_t,
/*
* 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 +244,7 @@ static void ompi_group_construct(ompi_group_t *new_group)
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 +290,9 @@ static void ompi_group_destruct(ompi_group_t *group)
/* 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 +307,11 @@ static void ompi_group_destruct(ompi_group_t *group)
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 +344,7 @@ int ompi_group_finalize(void)
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;
}

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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,8 +69,7 @@ OBJ_CLASS_INSTANCE(ompi_info_entry_t,
/*
* 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
@ -79,7 +79,11 @@ int ompi_info_init(void)
{
/* 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 +307,14 @@ int ompi_info_finalize(void)
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 +323,7 @@ int ompi_info_finalize(void)
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 +373,7 @@ int ompi_info_finalize(void)
*/
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 +410,9 @@ static void info_destructor(ompi_info_t *info)
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);
}

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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 +25,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,182 +70,178 @@ struct ompi_info_entry_t {
*/
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);
#if defined(c_plusplus) || defined(__cplusplus)
}
#endif
/**
* 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);
END_C_DECLS
/**
* Return whether this info has been freed already or not.
@ -281,5 +278,4 @@ ompi_info_get_nkeys(ompi_info_t *info, int *nkeys)
return MPI_SUCCESS;
}
#endif /* OMPI_INFO_H */

Просмотреть файл

@ -1,3 +1,4 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* Copyright (c) 2004-2007 The University of Tennessee and The University
* of Tennessee Research Foundation. All rights
@ -25,7 +26,6 @@
/* Open MPI includes */
#include "ompi/class/ompi_free_list.h"
#include "ompi/class/ompi_bitmap.h"
#include "orte/class/orte_pointer_array.h"
#include "opal/event/event.h"
#include "ompi/mca/pml/pml.h"
#include "ompi/mca/btl/btl.h"

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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,
@ -250,8 +251,12 @@ int mca_btl_openib_add_procs(
continue;
}
orte_pointer_array_add((orte_std_cntr_t*)&endpoint->index,
openib_btl->hca->endpoints, (void*)endpoint);
endpoint->index = opal_pointer_array_add(openib_btl->hca->endpoints, (void*)endpoint);
if( 0 > endpoint->index ) {
OBJ_RELEASE(endpoint);
OPAL_THREAD_UNLOCK(&ib_proc->proc_lock);
continue;
}
ompi_bitmap_set_bit(reachable, i);
OPAL_THREAD_UNLOCK(&ib_proc->proc_lock);
@ -426,10 +431,10 @@ int mca_btl_openib_del_procs(struct mca_btl_base_module_t* btl,
for (i=0 ; i < (int) nprocs ; i++) {
mca_btl_base_endpoint_t* del_endpoint = peers[i];
for(ep_index=0;
ep_index < orte_pointer_array_get_size(openib_btl->hca->endpoints);
ep_index < opal_pointer_array_get_size(openib_btl->hca->endpoints);
ep_index++) {
endpoint =
orte_pointer_array_get_item(openib_btl->hca->endpoints,
opal_pointer_array_get_item(openib_btl->hca->endpoints,
ep_index);
if(!endpoint || endpoint->endpoint_btl != openib_btl) {
continue;
@ -437,7 +442,7 @@ int mca_btl_openib_del_procs(struct mca_btl_base_module_t* btl,
if (endpoint == del_endpoint) {
BTL_VERBOSE(("in del_procs %d, setting another endpoint to null\n",
ep_index));
orte_pointer_array_set_item(openib_btl->hca->endpoints,
opal_pointer_array_set_item(openib_btl->hca->endpoints,
ep_index, NULL);
assert(((opal_object_t*)endpoint)->obj_reference_count == 1);
OBJ_RELEASE(endpoint);
@ -975,9 +980,9 @@ int mca_btl_openib_finalize(struct mca_btl_base_module_t* btl)
/* Release eager RDMAs */
for(rdma_index=0;
rdma_index < orte_pointer_array_get_size(openib_btl->eager_rdma_buffers);
rdma_index < opal_pointer_array_get_size(openib_btl->eager_rdma_buffers);
rdma_index++) {
endpoint=orte_pointer_array_get_item(openib_btl->eager_rdma_buffers,rdma_index);
endpoint=opal_pointer_array_get_item(openib_btl->eager_rdma_buffers,rdma_index);
if(!endpoint) {
continue;
}
@ -985,9 +990,9 @@ int mca_btl_openib_finalize(struct mca_btl_base_module_t* btl)
}
/* Release all QPs */
for(ep_index=0;
ep_index < orte_pointer_array_get_size(openib_btl->hca->endpoints);
ep_index < opal_pointer_array_get_size(openib_btl->hca->endpoints);
ep_index++) {
endpoint=orte_pointer_array_get_item(openib_btl->hca->endpoints,
endpoint=opal_pointer_array_get_item(openib_btl->hca->endpoints,
ep_index);
if(!endpoint) {
BTL_VERBOSE(("In finalize, got another null endpoint\n"));

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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-2007 High Performance Computing Center Stuttgart,
@ -34,7 +35,7 @@
/* Open MPI includes */
#include "ompi/class/ompi_free_list.h"
#include "ompi/class/ompi_bitmap.h"
#include "orte/class/orte_pointer_array.h"
#include "opal/class/opal_pointer_array.h"
#include "opal/event/event.h"
#include "ompi/mca/pml/pml.h"
#include "ompi/mca/btl/btl.h"
@ -103,7 +104,7 @@ struct mca_btl_openib_component_t {
struct mca_btl_openib_module_t **openib_btls;
/**< array of available BTLs */
ompi_pointer_array_t hcas; /**< array of available hcas */
opal_pointer_array_t hcas; /**< array of available hcas */
int hcas_count;
int ib_free_list_num;
@ -260,7 +261,7 @@ struct mca_btl_openib_hca_t {
/* Whether this HCA supports eager RDMA */
uint8_t use_eager_rdma;
uint8_t btls; /** < number of btls using this HCA */
orte_pointer_array_t *endpoints;
opal_pointer_array_t *endpoints;
#if OMPI_HAVE_THREADS
volatile bool got_fatal_event;
#endif
@ -324,7 +325,7 @@ struct mca_btl_openib_module_t {
size_t ib_inline_max; /**< max size of inline send*/
size_t eager_rdma_frag_size; /**< length of eager frag */
orte_pointer_array_t *eager_rdma_buffers; /**< RDMA buffers to poll */
opal_pointer_array_t *eager_rdma_buffers; /**< RDMA buffers to poll */
volatile int32_t eager_rdma_buffers_count; /**< number of RDMA buffers */
mca_btl_base_module_error_cb_fn_t error_cb; /**< error handler */

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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,
@ -138,7 +139,7 @@ int btl_openib_component_open(void)
/* initialize state */
mca_btl_openib_component.ib_num_btls = 0;
mca_btl_openib_component.openib_btls = NULL;
OBJ_CONSTRUCT(&mca_btl_openib_component.hcas, ompi_pointer_array_t);
OBJ_CONSTRUCT(&mca_btl_openib_component.hcas, opal_pointer_array_t);
mca_btl_openib_component.hcas_count = 0;
/* initialize objects */
@ -726,8 +727,9 @@ static int init_one_hca(opal_list_t *btl_list, struct ibv_device* ib_dev)
hca->progress = false;
#endif
#endif
orte_pointer_array_init(&hca->endpoints, 10, INT_MAX, 10);
ompi_pointer_array_add(&mca_btl_openib_component.hcas, hca);
hca->endpoints = OBJ_NEW(opal_pointer_array_t);
opal_pointer_array_init(hca->endpoints, 10, INT_MAX, 10);
opal_pointer_array_add(&mca_btl_openib_component.hcas, hca);
mca_btl_openib_component.hcas_count++;
return OMPI_SUCCESS;
}
@ -908,7 +910,8 @@ static int finish_btl_init(mca_btl_openib_module_t *openib_btl)
}
}
orte_pointer_array_init(&openib_btl->eager_rdma_buffers,
opanib_btl->eager_rdma_buffers = OBJ_NEW(opal_pointer_array_t);
opal_pointer_array_init(openib_btl->eager_rdma_buffers,
mca_btl_openib_component.max_eager_rdma,
mca_btl_openib_component.max_eager_rdma,
0);
@ -1530,7 +1533,7 @@ static int btl_openib_component_progress(void)
for(j = 0; j < c; j++) {
endpoint =
orte_pointer_array_get_item(openib_btl->eager_rdma_buffers, j);
opal_pointer_array_get_item(openib_btl->eager_rdma_buffers, j);
if(!endpoint) /* shouldn't happen */
continue;
@ -1580,7 +1583,7 @@ static int btl_openib_component_progress(void)
for(i = 0; i < mca_btl_openib_component.hcas_count; i++) {
mca_btl_openib_hca_t *hca =
ompi_pointer_array_get_item(&mca_btl_openib_component.hcas, i);
opal_pointer_array_get_item(&mca_btl_openib_component.hcas, i);
count += btl_openib_module_progress(hca);
}
@ -1676,7 +1679,7 @@ static int btl_openib_module_progress(mca_btl_openib_hca_t* hca)
case IBV_WC_RECV:
if(wc.wc_flags & IBV_WC_WITH_IMM) {
endpoint = (mca_btl_openib_endpoint_t*)
orte_pointer_array_get_item(hca->endpoints, wc.imm_data);
opal_pointer_array_get_item(hca->endpoints, wc.imm_data);
frag->endpoint = endpoint;
openib_btl = endpoint->endpoint_btl;
}

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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,
@ -785,7 +786,6 @@ void mca_btl_openib_endpoint_connect_eager_rdma(
char *buf;
mca_btl_openib_recv_frag_t *headers_buf;
int i;
orte_std_cntr_t index;
/* Set local rdma pointer to 1 temporarily so other threads will not try
* to enter the function */
@ -854,8 +854,7 @@ void mca_btl_openib_endpoint_connect_eager_rdma(
* at init time */
OBJ_RETAIN(endpoint);
assert(((opal_object_t*)endpoint)->obj_reference_count == 2);
orte_pointer_array_add(&index, openib_btl->eager_rdma_buffers,
endpoint);
opal_pointer_array_add(openib_btl->eager_rdma_buffers, endpoint);
/* from this point progress function starts to poll new buffer */
OPAL_THREAD_ADD32(&openib_btl->eager_rdma_buffers_count, 1);
return;

Просмотреть файл

@ -1,3 +1,4 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
* University Research and Technology
@ -356,7 +357,8 @@ mca_btl_udapl_init(DAT_NAME_PTR ia_name, mca_btl_udapl_module_t* btl)
NULL);
/* initialize eager rdma buffer info */
orte_pointer_array_init(&btl->udapl_eager_rdma_endpoints,
btl->udapl_eager_rdma_endpoints = OBJ_NEW(opal_pointer_array_t);
opal_pointer_array_init(btl->udapl_eager_rdma_endpoints,
mca_btl_udapl_component.udapl_max_eager_rdma_peers,
mca_btl_udapl_component.udapl_max_eager_rdma_peers,
0);
@ -393,7 +395,7 @@ int mca_btl_udapl_finalize(struct mca_btl_base_module_t* base_btl)
*/
for (i=0; i < udapl_btl->udapl_eager_rdma_endpoint_count; i++) {
mca_btl_udapl_endpoint_t* endpoint =
orte_pointer_array_get_item(udapl_btl->udapl_eager_rdma_endpoints,
opal_pointer_array_get_item(udapl_btl->udapl_eager_rdma_endpoints,
i);
OBJ_DESTRUCT(endpoint);

Просмотреть файл

@ -1,3 +1,4 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
* University Research and Technology
@ -30,7 +31,7 @@
#include <dat/udat.h>
/* Open MPI includes */
#include "orte/class/orte_pointer_array.h"
#include "opal/class/opal_pointer_array.h"
#include "ompi/class/ompi_free_list.h"
#include "ompi/class/ompi_bitmap.h"
#include "opal/event/event.h"
@ -131,7 +132,7 @@ struct mca_btl_udapl_module_t {
* endpoints in
* udapl_eager_rdma_endpoints
*/
orte_pointer_array_t *udapl_eager_rdma_endpoints; /* array of endpoints
opal_pointer_array_t *udapl_eager_rdma_endpoints; /* array of endpoints
* with eager rdma
* connections
*/

Просмотреть файл

@ -1,3 +1,4 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
* University Research and Technology
@ -1076,7 +1077,7 @@ int mca_btl_udapl_component_progress()
mca_btl_udapl_frag_t *local_rdma_frag;
endpoint =
orte_pointer_array_get_item(btl->udapl_eager_rdma_endpoints, j);
opal_pointer_array_get_item(btl->udapl_eager_rdma_endpoints, j);
OPAL_THREAD_LOCK(&endpoint->endpoint_eager_rdma_local.lock);

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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,
@ -32,7 +33,7 @@
#include "orte/mca/rml/rml.h"
#include "orte/mca/errmgr/errmgr.h"
#include "orte/dss/dss.h"
#include "orte/class/orte_pointer_array.h"
#include "opal/class/opal_pointer_array.h"
#include "ompi/class/ompi_free_list.h"
#include "ompi/mca/mpool/rdma/mpool_rdma.h"
#include "ompi/mca/btl/base/btl_base_error.h"
@ -1158,8 +1159,9 @@ void mca_btl_udapl_endpoint_connect_eager_rdma(
}
OPAL_THREAD_LOCK(&udapl_btl->udapl_eager_rdma_lock);
if(orte_pointer_array_add (&endpoint->endpoint_eager_rdma_index,
udapl_btl->udapl_eager_rdma_endpoints, endpoint) < 0)
endpoint->endpoint_eager_rdma_index =
opal_pointer_array_add(udapl_btl->udapl_eager_rdma_endpoints, endpoint);
if( 0 > endpoint->endpoint_eager_rdma_index )
goto cleanup;
/* record first fragment location */
@ -1175,7 +1177,7 @@ void mca_btl_udapl_endpoint_connect_eager_rdma(
udapl_btl->udapl_eager_rdma_endpoint_count--;
endpoint->endpoint_eager_rdma_local.base.pval = NULL;
orte_pointer_array_set_item(udapl_btl->udapl_eager_rdma_endpoints,
opal_pointer_array_set_item(udapl_btl->udapl_eager_rdma_endpoints,
endpoint->endpoint_eager_rdma_index, NULL);
cleanup:

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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,
@ -38,7 +39,6 @@
#include "ompi/mca/pml/pml.h"
#include "ompi/mca/btl/btl.h"
/* Local functions and data */
#define HIER_MAXPROTOCOL 7
static int mca_coll_hierarch_max_protocol=HIER_MAXPROTOCOL;
@ -57,9 +57,8 @@ static void mca_coll_hierarch_dump_struct ( mca_coll_hierarch_module_t *c);
* this module to indicate what level of thread support it provides.
*/
int mca_coll_hierarch_init_query(bool allow_hierarch_user_threads,
bool have_hidden_user_threads)
bool have_hidden_user_threads)
{
/* Don't ask. All done */
return OMPI_SUCCESS;
}
@ -151,7 +150,7 @@ mca_coll_hierarch_comm_query(struct ompi_communicator_t *comm, int *priority )
* walk through the list of registered protocols, and check which one
* is feasable.
* Later we start with level=0, and introduce the multi-cell check
*/
*/
if ( ignore_sm ) {
mca_coll_hierarch_max_protocol = HIER_MAXPROTOCOL - 1;
}
@ -181,7 +180,7 @@ mca_coll_hierarch_comm_query(struct ompi_communicator_t *comm, int *priority )
if ( mca_coll_hierarch_verbose_param ) {
printf("%s:%d: nobody talks with %s. Continuing to next level.\n",
comm->c_name, rank, hier_prot[level]);
}
}
continue;
}
else if ( maxncount == (size-1) ) {
@ -211,8 +210,8 @@ mca_coll_hierarch_comm_query(struct ompi_communicator_t *comm, int *priority )
return NULL;
}
hierarch_module->hier_level = level;
return &(hierarch_module->super);
hierarch_module->hier_level = level;
return &(hierarch_module->super);
}
}
@ -260,7 +259,7 @@ int mca_coll_hierarch_module_enable (mca_coll_base_module_1_1_0_t *module,
information about local leader and the according subcommunicators
*/
llead = (struct mca_coll_hierarch_llead_t * ) malloc (
sizeof(struct mca_coll_hierarch_llead_t));
sizeof(struct mca_coll_hierarch_llead_t));
if ( NULL == llead ) {
goto exit;
}
@ -284,11 +283,11 @@ int mca_coll_hierarch_module_enable (mca_coll_base_module_1_1_0_t *module,
llead->llcomm = llcomm;
/* Store it now on the data structure */
OBJ_CONSTRUCT(&(hierarch_module->hier_llead), ompi_pointer_array_t);
ompi_pointer_array_add ( &(hierarch_module->hier_llead), llead);
OBJ_CONSTRUCT(&(hierarch_module->hier_llead), opal_pointer_array_t);
opal_pointer_array_add ( &(hierarch_module->hier_llead), llead);
if ( mca_coll_hierarch_verbose_param ) {
mca_coll_hierarch_dump_struct (hierarch_module);
mca_coll_hierarch_dump_struct (hierarch_module);
}
exit:
@ -412,9 +411,9 @@ int mca_coll_hierarch_get_llr ( mca_coll_hierarch_module_t *hierarch_module )
struct ompi_communicator_t* mca_coll_hierarch_get_llcomm (int root,
mca_coll_hierarch_module_t *hierarch_module,
int* llroot,
int* lroot)
mca_coll_hierarch_module_t *hierarch_module,
int* llroot,
int* lroot)
{
struct ompi_communicator_t *llcomm=NULL;
struct ompi_group_t *llgroup=NULL;
@ -428,12 +427,12 @@ struct ompi_communicator_t* mca_coll_hierarch_get_llcomm (int root,
hierarch_module->hier_num_colorarr,
hierarch_module->hier_colorarr );
num_llead = ompi_pointer_array_get_size ( &(hierarch_module->hier_llead) );
num_llead = opal_pointer_array_get_size ( &(hierarch_module->hier_llead) );
for ( found=0, i=0; i < num_llead; i++ ) {
llead = (struct mca_coll_hierarch_llead_t *) ompi_pointer_array_get_item (
&(hierarch_module->hier_llead), i );
llead = (struct mca_coll_hierarch_llead_t *) opal_pointer_array_get_item (
&(hierarch_module->hier_llead), i );
if ( NULL == llead ) {
continue;
continue;
}
if (llead->offset == offset ) {
@ -442,10 +441,10 @@ struct ompi_communicator_t* mca_coll_hierarch_get_llcomm (int root,
}
#if 0
else if () {
/* the offset of root = maxoffset of this color and
* the offset on llead is larger then offset of root.
* then we can also use this llead structure
*/
/* the offset of root = maxoffset of this color and
* the offset on llead is larger then offset of root.
* then we can also use this llead structure
*/
}
#endif
}
@ -453,7 +452,7 @@ struct ompi_communicator_t* mca_coll_hierarch_get_llcomm (int root,
if ( !found ) {
/* allocate a new llead element */
llead = (struct mca_coll_hierarch_llead_t *) malloc (
sizeof(struct mca_coll_hierarch_llead_t));
sizeof(struct mca_coll_hierarch_llead_t));
if ( NULL == llead ) {
return NULL;
}
@ -469,7 +468,7 @@ struct ompi_communicator_t* mca_coll_hierarch_get_llcomm (int root,
llead->llcomm = llcomm;
/* Store the new element on the hierarch_module struct */
ompi_pointer_array_add ( &(hierarch_module->hier_llead), llead);
opal_pointer_array_add ( &(hierarch_module->hier_llead), llead);
}
llcomm = llead->llcomm;
@ -552,7 +551,7 @@ mca_coll_hierarch_checkfor_component ( struct ompi_communicator_t *comm,
}
bml_endpoints = (struct mca_bml_base_endpoint_t **) malloc ( size *
sizeof(struct mca_bml_base_endpoint_t*));
sizeof(struct mca_bml_base_endpoint_t*));
if ( NULL == bml_endpoints ) {
return;
}
@ -588,7 +587,7 @@ mca_coll_hierarch_checkfor_component ( struct ompi_communicator_t *comm,
if (! strcmp (btl->btl_version.mca_component_name, component_name)){
counter++;
if (i<firstproc ) {
firstproc = i;
firstproc = i;
}
continue;
}
@ -634,13 +633,13 @@ static void mca_coll_hierarch_dump_struct ( mca_coll_hierarch_module_t *c)
rank, c->hier_comm->c_name, c->hier_comm->c_contextid);
printf("%d: No of llead communicators: %d No of lleaders: %d\n",
rank, ompi_pointer_array_get_size ( &(c->hier_llead)),
rank, opal_pointer_array_get_size ( &(c->hier_llead)),
c->hier_num_lleaders );
for ( i=0; i < ompi_pointer_array_get_size(&(c->hier_llead)); i++ ) {
current = (mca_coll_hierarch_llead_t*)ompi_pointer_array_get_item (&(c->hier_llead), i);
for ( i=0; i < opal_pointer_array_get_size(&(c->hier_llead)); i++ ) {
current = (mca_coll_hierarch_llead_t*)opal_pointer_array_get_item (&(c->hier_llead), i);
if ( current == NULL ) {
continue;
continue;
}
printf("%d: my_leader %d am_leader %d\n", rank,

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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,
@ -57,46 +58,44 @@ extern int mca_coll_hierarch_symmetric_param;
*/
struct mca_coll_hierarch_module_t {
struct mca_coll_base_module_1_1_0_t super;
struct mca_coll_base_module_1_1_0_t super;
struct ompi_communicator_t *hier_comm; /* link back to the attached comm */
struct ompi_communicator_t *hier_lcomm; /* low level communicator */
ompi_pointer_array_t hier_llead; /* local leader communicator structure */
int hier_num_lleaders; /* number of local leaders */
int hier_level; /* level in the hierarchy. For debugging*/
int hier_num_reqs; /* num. of requests */
ompi_request_t **hier_reqs; /* list of requests */
int hier_num_colorarr; /* size of the colorarr array */
int *hier_llr; /* color array compacted (1 entry per color).
Array of size hier_num_lleaders */
int *hier_max_offset; /* Number of processes for each color.
Array of size hier_num_lleaders */
int *hier_colorarr; /* array containing the color of all procs */
struct ompi_communicator_t *hier_comm; /* link back to the attached comm */
struct ompi_communicator_t *hier_lcomm; /* low level communicator */
opal_pointer_array_t hier_llead; /* local leader communicator structure */
int hier_num_lleaders; /* number of local leaders */
int hier_level; /* level in the hierarchy. For debugging*/
int hier_num_reqs; /* num. of requests */
ompi_request_t **hier_reqs; /* list of requests */
int hier_num_colorarr; /* size of the colorarr array */
int *hier_llr; /* color array compacted (1 entry per color).
Array of size hier_num_lleaders */
int *hier_max_offset; /* Number of processes for each color.
Array of size hier_num_lleaders */
int *hier_colorarr; /* array containing the color of all procs */
};
typedef struct mca_coll_hierarch_module_t mca_coll_hierarch_module_t;
OBJ_CLASS_DECLARATION(mca_coll_hierarch_module_t);
struct mca_coll_hierarch_llead_t {
struct ompi_communicator_t *llcomm; /* local leader communicator */
int *lleaders; /* list of local leaders, ranks in comm */
int my_lleader; /* rank of my lleader in lcomm */
int am_lleader; /* am I an lleader? */
int offset; /* Offset used for this llcomm */
};
struct mca_coll_hierarch_llead_t {
struct ompi_communicator_t *llcomm; /* local leader communicator */
int *lleaders; /* list of local leaders, ranks in comm */
int my_lleader; /* rank of my lleader in lcomm */
int am_lleader; /* am I an lleader? */
int offset; /* Offset used for this llcomm */
};
typedef struct mca_coll_hierarch_llead_t mca_coll_hierarch_llead_t;
static inline int mca_coll_hierarch_count_lleaders ( int size, int *carr)
{
/*
* Determine the number of local leaders. Please note, that any process
* with color = MPI_UNDEFINED will be counted as the head of a group of its own.
* Please note furthermore, that every process with color=MPI_UNDEFINED will be
* stored in this array on its own...
*/
/*
* Determine the number of local leaders. Please note, that any process
* with color = MPI_UNDEFINED will be counted as the head of a group of its own.
* Please note furthermore, that every process with color=MPI_UNDEFINED will be
* stored in this array on its own...
*/
int cnt, i, j, found;
int *llr=NULL;

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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,
@ -140,7 +141,6 @@ mca_coll_hierarch_module_construct(mca_coll_hierarch_module_t *module)
{
module->hier_lcomm = MPI_COMM_NULL;
module->hier_reqs = NULL;
/* module->hier_llead = (ompi_pointer_array_t ) NULL; */
module->hier_colorarr = NULL;
module->hier_llr = NULL;
@ -161,17 +161,17 @@ mca_coll_hierarch_module_destruct(mca_coll_hierarch_module_t *hierarch_module)
}
/* if ( NULL != hierarch_module->hier_llead ) { */
size = ompi_pointer_array_get_size ( &(hierarch_module->hier_llead));
size = opal_pointer_array_get_size ( &(hierarch_module->hier_llead));
for ( i=0; i<size; i++) {
current = (struct mca_coll_hierarch_llead_t *)ompi_pointer_array_get_item (
current = (struct mca_coll_hierarch_llead_t *)opal_pointer_array_get_item (
&(hierarch_module->hier_llead), i ) ;
if ( current->lleaders != NULL ) {
ompi_comm_free ( &(current->llcomm));
free ( current->lleaders );
ompi_comm_free ( &(current->llcomm));
free ( current->lleaders );
}
free ( current );
}
ompi_pointer_array_remove_all ( &(hierarch_module->hier_llead));
opal_pointer_array_remove_all ( &(hierarch_module->hier_llead));
OBJ_DESTRUCT (&(hierarch_module->hier_llead));
/* } */

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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 +29,7 @@
#include "mpool_base_mem_cb.h"
extern int mca_mpool_base_use_mem_hooks;
extern ompi_pointer_array_t mca_mpool_base_mem_cb_array;
extern opal_pointer_array_t mca_mpool_base_mem_cb_array;
int mca_mpool_base_close(void)
{

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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,
@ -40,7 +41,7 @@ extern int mca_mpool_base_disable_sbrk;
extern int mca_mpool_base_use_mem_hooks;
extern ompi_pointer_array_t mca_mpool_base_mem_cb_array;
extern opal_pointer_array_t mca_mpool_base_mem_cb_array;
mca_mpool_base_component_t* mca_mpool_base_component_lookup(const char* name)
{
@ -102,7 +103,7 @@ mca_mpool_base_module_t* mca_mpool_base_module_create(
if(mca_mpool_base_use_mem_hooks &&
0 != (OPAL_MEMORY_FREE_SUPPORT & opal_mem_hooks_support_level())) {
opal_mem_hooks_register_release(mca_mpool_base_mem_cb, NULL);
OBJ_CONSTRUCT(&mca_mpool_base_mem_cb_array, ompi_pointer_array_t);
OBJ_CONSTRUCT(&mca_mpool_base_mem_cb_array, opal_pointer_array_t);
}
#if MPOOL_BASE_CAN_DISABLE_SBRK

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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,
@ -25,7 +26,7 @@
#include "orte/util/proc_info.h"
#include "orte/mca/ns/ns_types.h"
ompi_pointer_array_t mca_mpool_base_mem_cb_array;
opal_pointer_array_t mca_mpool_base_mem_cb_array;
/*
* memory hook callback, called when memory is free'd out from under us

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/**
* 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,
@ -24,7 +25,6 @@
#include "opal/mca/mca.h"
#include "ompi/info/info.h"
#include "ompi/class/ompi_free_list.h"
#include "ompi/class/ompi_pointer_array.h"
#include "opal/mca/crs/crs.h"
#include "opal/mca/crs/base/base.h"

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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,
@ -358,17 +359,17 @@ int mca_mpool_rdma_release_memory(struct mca_mpool_base_module_t *mpool,
{
mca_mpool_rdma_module_t *mpool_rdma = (mca_mpool_rdma_module_t*)mpool;
mca_mpool_base_registration_t *reg;
ompi_pointer_array_t regs;
opal_pointer_array_t regs;
int reg_cnt, i, err = 0;
OBJ_CONSTRUCT(&regs, ompi_pointer_array_t);
OBJ_CONSTRUCT(&regs, opal_pointer_array_t);
OPAL_THREAD_LOCK(&mpool->rcache->lock);
reg_cnt = mpool->rcache->rcache_find_all(mpool->rcache, base, size, &regs);
for(i = 0; i < reg_cnt; i++) {
reg = (mca_mpool_base_registration_t*)
ompi_pointer_array_get_item(&regs, i);
opal_pointer_array_get_item(&regs, i);
if(0 == reg->ref_count) {
if(dereg_mem(mpool, reg) != OMPI_SUCCESS) {
@ -393,7 +394,7 @@ int mca_mpool_rdma_release_memory(struct mca_mpool_base_module_t *mpool,
}
}
OPAL_THREAD_UNLOCK(&mpool->rcache->lock);
ompi_pointer_array_remove_all(&regs);
opal_pointer_array_remove_all(&regs);
return err?OMPI_ERROR:OMPI_SUCCESS;
}
@ -402,7 +403,7 @@ void mca_mpool_rdma_finalize(struct mca_mpool_base_module_t *mpool)
{
mca_mpool_rdma_module_t *mpool_rdma = (mca_mpool_rdma_module_t*)mpool;
mca_mpool_base_registration_t *reg;
ompi_pointer_array_t regs;
opal_pointer_array_t regs;
int reg_cnt, i;
/* Statistic */
@ -415,14 +416,14 @@ void mca_mpool_rdma_finalize(struct mca_mpool_base_module_t *mpool)
mpool_rdma->stat_evicted);
}
OBJ_CONSTRUCT(&regs, ompi_pointer_array_t);
OBJ_CONSTRUCT(&regs, opal_pointer_array_t);
OPAL_THREAD_LOCK(&mpool->rcache->lock);
reg_cnt = mpool->rcache->rcache_find_all(mpool->rcache, 0, (size_t)-1, &regs);
for(i = 0; i < reg_cnt; i++) {
reg = (mca_mpool_base_registration_t*)
ompi_pointer_array_get_item(&regs, i);
opal_pointer_array_get_item(&regs, i);
if(reg->ref_count) {
reg->ref_count = 0; /* otherway dereg will fail on assert */
@ -443,5 +444,5 @@ void mca_mpool_rdma_finalize(struct mca_mpool_base_module_t *mpool)
OBJ_DESTRUCT(&mpool_rdma->mru_list);
OBJ_DESTRUCT(&mpool_rdma->reg_list);
OPAL_THREAD_UNLOCK(&mpool->rcache->lock);
ompi_pointer_array_remove_all(&regs);
opal_pointer_array_remove_all(&regs);
}

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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,
@ -23,15 +24,13 @@
#include "opal/mca/mca.h"
#include "ompi/mca/pml/pml.h"
#include "ompi/class/ompi_pointer_array.h"
#include "opal/class/opal_pointer_array.h"
/*
* Global functions for the PML
*/
#if defined(c_plusplus) || defined(__cplusplus)
extern "C" {
#endif
BEGIN_C_DECLS
/*
* This is the base priority for a PML wrapper component
@ -64,9 +63,8 @@ OMPI_DECLSPEC extern int mca_pml_base_output;
OMPI_DECLSPEC extern opal_list_t mca_pml_base_components_available;
OMPI_DECLSPEC extern mca_pml_base_component_t mca_pml_base_selected_component;
OMPI_DECLSPEC extern mca_pml_base_module_t mca_pml;
OMPI_DECLSPEC extern ompi_pointer_array_t mca_pml_base_pml;
OMPI_DECLSPEC extern opal_pointer_array_t mca_pml_base_pml;
END_C_DECLS
#if defined(c_plusplus) || defined(__cplusplus)
}
#endif
#endif /* MCA_PML_BASE_H */

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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-2007 High Performance Computing Center Stuttgart,
@ -75,7 +76,7 @@ mca_pml_base_module_t mca_pml = {
opal_list_t mca_pml_base_components_available;
mca_pml_base_component_t mca_pml_base_selected_component;
ompi_pointer_array_t mca_pml_base_pml;
opal_pointer_array_t mca_pml_base_pml;
/**
* Function for finding and opening either all MCA components, or the one
@ -123,10 +124,9 @@ int mca_pml_base_open(void)
* uses BTLs and any other PMLs that do not in the mca_pml_base_pml array.
*/
OBJ_CONSTRUCT(&mca_pml_base_pml, ompi_pointer_array_t);
OBJ_CONSTRUCT(&mca_pml_base_pml, opal_pointer_array_t);
#if MCA_pml_DIRECT_CALL
ompi_pointer_array_add(&mca_pml_base_pml,
opal_pointer_array_add(&mca_pml_base_pml,
stringify(MCA_pml_DIRECT_CALL_COMPONENT));
#else
{
@ -137,10 +137,10 @@ int mca_pml_base_open(void)
false, false, "", &default_pml);
if(0 == strlen(default_pml)){
ompi_pointer_array_add(&mca_pml_base_pml, strdup("ob1"));
ompi_pointer_array_add(&mca_pml_base_pml, strdup("cm"));
opal_pointer_array_add(&mca_pml_base_pml, strdup("ob1"));
opal_pointer_array_add(&mca_pml_base_pml, strdup("cm"));
} else {
ompi_pointer_array_add(&mca_pml_base_pml, strdup(default_pml));
opal_pointer_array_add(&mca_pml_base_pml, strdup(default_pml));
}
}
#if OPAL_ENABLE_FT == 1
@ -154,7 +154,7 @@ int mca_pml_base_open(void)
false, false,
NULL, &wrapper_pml);
if( NULL != wrapper_pml ) {
ompi_pointer_array_add(&mca_pml_base_pml, strdup(wrapper_pml));
opal_pointer_array_add(&mca_pml_base_pml, strdup(wrapper_pml));
}
#endif

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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,
@ -78,9 +79,9 @@ int mca_pml_base_select(bool enable_progress_threads,
/* if there is an include list - item must be in the list to be included */
found_pml = false;
for( i = 0; i < ompi_pointer_array_get_size(&mca_pml_base_pml); i++) {
for( i = 0; i < opal_pointer_array_get_size(&mca_pml_base_pml); i++) {
char * tmp_val = NULL;
tmp_val = (char *) ompi_pointer_array_get_item(&mca_pml_base_pml, i);
tmp_val = (char *) opal_pointer_array_get_item(&mca_pml_base_pml, i);
if( NULL == tmp_val) {
continue;
}
@ -92,7 +93,7 @@ int mca_pml_base_select(bool enable_progress_threads,
}
}
if(!found_pml && ompi_pointer_array_get_size(&mca_pml_base_pml)) {
if(!found_pml && opal_pointer_array_get_size(&mca_pml_base_pml)) {
opal_output_verbose( 10, mca_pml_base_output,
"select: component %s not in the include list",
component->pmlm_version.mca_component_name );
@ -158,9 +159,9 @@ int mca_pml_base_select(bool enable_progress_threads,
if( NULL == best_component ) {
opal_show_help("help-mca-base.txt", "find-available:none-found", true, "pml");
for( i = 0; i < ompi_pointer_array_get_size(&mca_pml_base_pml); i++) {
for( i = 0; i < opal_pointer_array_get_size(&mca_pml_base_pml); i++) {
char * tmp_val = NULL;
tmp_val = (char *) ompi_pointer_array_get_item(&mca_pml_base_pml, i);
tmp_val = (char *) opal_pointer_array_get_item(&mca_pml_base_pml, i);
if( NULL == tmp_val) {
continue;
}

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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,
@ -31,7 +32,6 @@
#include "ompi/mca/pml/base/pml_base_request.h"
#include "ompi/mca/pml/base/pml_base_bsend.h"
#include "ompi/mca/pml/base/pml_base_sendreq.h"
#include "ompi/class/ompi_pointer_array.h"
#include "ompi/mca/btl/btl.h"
#include "ompi/datatype/datatype.h"
#include "ompi/mca/crcp/crcp.h"

Просмотреть файл

@ -1,4 +1,4 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
* University Research and Technology
@ -117,7 +117,7 @@ int mca_pml_dr_enable(bool enable)
OBJ_CONSTRUCT(&mca_pml_dr.send_active, opal_list_t);
OBJ_CONSTRUCT(&mca_pml_dr.acks_pending, opal_list_t);
OBJ_CONSTRUCT(&mca_pml_dr.buffers, ompi_free_list_t);
OBJ_CONSTRUCT(&mca_pml_dr.endpoints, ompi_pointer_array_t);
OBJ_CONSTRUCT(&mca_pml_dr.endpoints, opal_pointer_array_t);
OBJ_CONSTRUCT(&mca_pml_dr.lock, opal_mutex_t);
mca_pml_dr.enabled = true;
@ -240,8 +240,7 @@ int mca_pml_dr_add_procs(ompi_proc_t** procs, size_t nprocs)
/* this won't work for comm spawn and other dynamic
processes, but will work for initial job start */
idx = ompi_pointer_array_add(&mca_pml_dr.endpoints,
(void*) endpoint);
idx = opal_pointer_array_add(&mca_pml_dr.endpoints, (void*) endpoint);
if(orte_ns.compare_fields(ORTE_NS_CMP_ALL,
orte_process_info.my_name,
&(endpoint->proc_ompi->proc_name)) == ORTE_EQUAL) {
@ -256,7 +255,7 @@ int mca_pml_dr_add_procs(ompi_proc_t** procs, size_t nprocs)
for(i = 0; i < nprocs; i++) {
mca_pml_dr_endpoint_t* ep = (mca_pml_dr_endpoint_t*)
ompi_pointer_array_get_item(&mca_pml_dr.endpoints, i);
opal_pointer_array_get_item(&mca_pml_dr.endpoints, i);
ep->src = mca_pml_dr.my_rank;
}
/* no longer need this */

Просмотреть файл

@ -1,3 +1,4 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana
* University Research and Technology
@ -30,7 +31,7 @@
#include "ompi/mca/pml/base/pml_base_request.h"
#include "ompi/mca/pml/base/pml_base_bsend.h"
#include "ompi/mca/pml/base/pml_base_sendreq.h"
#include "ompi/class/ompi_pointer_array.h"
#include "opal/class/opal_pointer_array.h"
#include "ompi/mca/btl/btl.h"
#include "ompi/datatype/datatype.h"
@ -72,7 +73,7 @@ struct mca_pml_dr_t {
ompi_free_list_t buffers;
/* endpoint pointer array */
ompi_pointer_array_t endpoints;
opal_pointer_array_t endpoints;
/* my 'global' rank */
int32_t my_rank;

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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,
@ -54,7 +55,7 @@ static void mca_pml_dr_comm_construct(mca_pml_dr_comm_t* comm)
{
OBJ_CONSTRUCT(&comm->wild_receives, opal_list_t);
OBJ_CONSTRUCT(&comm->matching_lock, opal_mutex_t);
OBJ_CONSTRUCT(&comm->sparse_procs, ompi_pointer_array_t);
OBJ_CONSTRUCT(&comm->sparse_procs, opal_pointer_array_t);
comm->recv_sequence = 0;
comm->procs = NULL;
comm->num_procs = 0;
@ -104,7 +105,7 @@ int mca_pml_dr_comm_init(mca_pml_dr_comm_t* dr_comm, ompi_communicator_t* ompi_c
ompi_proc = ompi_group_peer_lookup(ompi_comm->c_remote_group,i);
proc->ompi_proc = ompi_proc;
pml_ep = (mca_pml_dr_endpoint_t*) ompi_proc->proc_pml;
ompi_pointer_array_set_item(&dr_comm->sparse_procs,
opal_pointer_array_set_item(&dr_comm->sparse_procs,
pml_ep->dst, /* from our view this is the
peers source 'global rank' */
proc);

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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,
@ -63,7 +64,7 @@ struct mca_pml_comm_t {
#endif
opal_mutex_t matching_lock; /**< matching lock */
opal_list_t wild_receives; /**< queue of unmatched wild (source process not specified) receives */
ompi_pointer_array_t sparse_procs; /**< sparse array, allows lookup of comm_proc using a global rank */
opal_pointer_array_t sparse_procs; /**< sparse array, allows lookup of comm_proc using a global rank */
mca_pml_dr_comm_proc_t* procs;
size_t num_procs;
};

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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,
@ -51,7 +52,7 @@ do {
return; \
} \
} \
ep = (mca_pml_dr_endpoint_t*)ompi_pointer_array_get_item(&mca_pml_dr.endpoints, hdr->hdr_common.hdr_src); \
ep = (mca_pml_dr_endpoint_t*)opal_pointer_array_get_item(&mca_pml_dr.endpoints, hdr->hdr_common.hdr_src); \
assert(ep != NULL); \
if(ompi_seq_tracker_check_duplicate(&ep->seq_sends, hdr->hdr_common.hdr_vid)) { \
MCA_PML_DR_DEBUG(0, (0, "%s:%d: dropping duplicate ack, vfrag ID %d", \
@ -138,7 +139,7 @@ void mca_pml_dr_recv_frag_callback(
__FILE__, __LINE__, hdr->hdr_common.hdr_src, hdr->hdr_common.hdr_dst));
return;
}
ep = (mca_pml_dr_endpoint_t*)ompi_pointer_array_get_item(&mca_pml_dr.endpoints, hdr->hdr_common.hdr_src);
ep = (mca_pml_dr_endpoint_t*)opal_pointer_array_get_item(&mca_pml_dr.endpoints, hdr->hdr_common.hdr_src);
assert(ep != NULL);
if(ompi_seq_tracker_check_duplicate(&ep->seq_recvs, hdr->hdr_common.hdr_vid)) {
@ -158,8 +159,8 @@ void mca_pml_dr_recv_frag_callback(
return;
}
comm = (mca_pml_dr_comm_t*)ompi_comm->c_pml_comm;
assert(hdr->hdr_common.hdr_src < ompi_pointer_array_get_size(&comm->sparse_procs));
proc = (mca_pml_dr_comm_proc_t*)ompi_pointer_array_get_item(&comm->sparse_procs, hdr->hdr_common.hdr_src);
assert(hdr->hdr_common.hdr_src < opal_pointer_array_get_size(&comm->sparse_procs));
proc = (mca_pml_dr_comm_proc_t*)opal_pointer_array_get_item(&comm->sparse_procs, hdr->hdr_common.hdr_src);
assert(proc != NULL);
assert(ep == proc->pml_endpoint);
mca_pml_dr_recv_frag_match(comm,proc,btl,&hdr->hdr_match,segments,des->des_dst_cnt);
@ -188,7 +189,7 @@ void mca_pml_dr_recv_frag_callback(
__FILE__, __LINE__, hdr->hdr_common.hdr_src, hdr->hdr_common.hdr_dst));
return;
}
ep = (mca_pml_dr_endpoint_t*)ompi_pointer_array_get_item(&mca_pml_dr.endpoints, hdr->hdr_common.hdr_src);
ep = (mca_pml_dr_endpoint_t*)opal_pointer_array_get_item(&mca_pml_dr.endpoints, hdr->hdr_common.hdr_src);
assert(ep != NULL);
/* seq_recvs protected by matching lock */
@ -211,8 +212,8 @@ void mca_pml_dr_recv_frag_callback(
}
}
comm = (mca_pml_dr_comm_t*)ompi_comm->c_pml_comm;
assert(hdr->hdr_common.hdr_src < ompi_pointer_array_get_size(&comm->sparse_procs));
proc = (mca_pml_dr_comm_proc_t*)ompi_pointer_array_get_item(&comm->sparse_procs, hdr->hdr_common.hdr_src);
assert(hdr->hdr_common.hdr_src < opal_pointer_array_get_size(&comm->sparse_procs));
proc = (mca_pml_dr_comm_proc_t*)opal_pointer_array_get_item(&comm->sparse_procs, hdr->hdr_common.hdr_src);
assert(proc != NULL);
assert(ep == proc->pml_endpoint);
@ -243,8 +244,8 @@ void mca_pml_dr_recv_frag_callback(
orte_errmgr.abort();
}
comm = (mca_pml_dr_comm_t*)ompi_comm->c_pml_comm;
assert(hdr->hdr_common.hdr_src < ompi_pointer_array_get_size(&comm->sparse_procs));
proc = (mca_pml_dr_comm_proc_t*)ompi_pointer_array_get_item(&comm->sparse_procs, hdr->hdr_common.hdr_src);
assert(hdr->hdr_common.hdr_src < opal_pointer_array_get_size(&comm->sparse_procs));
proc = (mca_pml_dr_comm_proc_t*)opal_pointer_array_get_item(&comm->sparse_procs, hdr->hdr_common.hdr_src);
assert(proc != NULL);
assert(ep == proc->pml_endpoint);
mca_pml_dr_recv_frag_match(comm,proc,btl,&hdr->hdr_match,segments,des->des_dst_cnt);
@ -274,7 +275,7 @@ void mca_pml_dr_recv_frag_callback(
__FILE__, __LINE__, hdr->hdr_common.hdr_src, hdr->hdr_common.hdr_dst));
return;
}
ep = (mca_pml_dr_endpoint_t*)ompi_pointer_array_get_item(&mca_pml_dr.endpoints, hdr->hdr_common.hdr_src);
ep = (mca_pml_dr_endpoint_t*)opal_pointer_array_get_item(&mca_pml_dr.endpoints, hdr->hdr_common.hdr_src);
assert(ep != NULL);
/* seq_recvs protected by matching lock */
@ -292,8 +293,8 @@ void mca_pml_dr_recv_frag_callback(
orte_errmgr.abort();
}
comm = (mca_pml_dr_comm_t*)ompi_comm->c_pml_comm;
assert(hdr->hdr_common.hdr_src < ompi_pointer_array_get_size(&comm->sparse_procs));
proc = (mca_pml_dr_comm_proc_t*)ompi_pointer_array_get_item(&comm->sparse_procs, hdr->hdr_common.hdr_src);
assert(hdr->hdr_common.hdr_src < opal_pointer_array_get_size(&comm->sparse_procs));
proc = (mca_pml_dr_comm_proc_t*)opal_pointer_array_get_item(&comm->sparse_procs, hdr->hdr_common.hdr_src);
assert(proc != NULL);
assert(ep == proc->pml_endpoint);
@ -927,7 +928,7 @@ rematch:
* look only at "specific" receives, or "wild" receives,
* or if we need to traverse both sets at the same time.
*/
proc = (mca_pml_dr_comm_proc_t*)ompi_pointer_array_get_item(&comm->sparse_procs,
proc = (mca_pml_dr_comm_proc_t*)opal_pointer_array_get_item(&comm->sparse_procs,
hdr->hdr_common.hdr_src);
if (opal_list_get_size(&proc->specific_receives) == 0 ) {

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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,
@ -39,14 +40,12 @@ void mca_rcache_rb_module_init( mca_rcache_rb_module_t* rcache ) {
mca_rcache_rb_mru_init(rcache);
}
int mca_rcache_rb_find (
struct mca_rcache_base_module_t* rcache,
int mca_rcache_rb_find( struct mca_rcache_base_module_t* rcache,
void* addr,
size_t size,
ompi_pointer_array_t* regs,
uint32_t *cnt
){
opal_pointer_array_t* regs,
uint32_t *cnt )
{
int rc = OMPI_SUCCESS;
mca_rcache_rb_tree_item_t* tree_item = NULL;
void* base_addr;
@ -69,7 +68,7 @@ int mca_rcache_rb_find (
while(base_addr <= bound_addr) {
tree_item = mca_rcache_rb_tree_find( (mca_rcache_rb_module_t*) rcache, base_addr );
if(NULL != tree_item) {
ompi_pointer_array_add(regs, (void*) tree_item->reg);
opal_pointer_array_add(regs, (void*) tree_item->reg);
if( tree_item->reg->flags & MCA_MPOOL_FLAGS_CACHE ) {
rc = mca_rcache_rb_mru_touch((mca_rcache_rb_module_t*)rcache,
tree_item->reg);

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/**
* 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,
@ -21,6 +22,7 @@
*/
#ifndef MCA_RCACHE_RB_H
#define MCA_RCACHE_RB_H
#include "opal/mca/mca.h"
#include "ompi/info/info.h"
#include "opal/class/opal_list.h"
@ -42,31 +44,26 @@ typedef struct mca_rcache_rb_module_t mca_rcache_rb_module_t;
struct mca_rcache_rb_component_t {
mca_rcache_base_component_t super;
}; typedef struct mca_rcache_rb_component_t mca_rcache_rb_component_t;
};
typedef struct mca_rcache_rb_component_t mca_rcache_rb_component_t;
OMPI_MODULE_DECLSPEC extern mca_rcache_rb_component_t mca_rcache_rb_component;
void mca_rcache_rb_module_init( mca_rcache_rb_module_t* rcache );
int mca_rcache_rb_find (
mca_rcache_base_module_t* rcache,
int mca_rcache_rb_find( mca_rcache_base_module_t* rcache,
void* addr,
size_t size,
ompi_pointer_array_t* regs,
uint32_t *cnt
);
opal_pointer_array_t* regs,
uint32_t *cnt );
int mca_rcache_rb_insert (
struct mca_rcache_base_module_t* rcache,
int mca_rcache_rb_insert( struct mca_rcache_base_module_t* rcache,
mca_mpool_base_registration_t* registration,
uint32_t flags
);
uint32_t flags );
int mca_rcache_rb_delete (
struct mca_rcache_base_module_t* rcache,
int mca_rcache_rb_delete( struct mca_rcache_base_module_t* rcache,
mca_mpool_base_registration_t* registration,
uint32_t flags
);
uint32_t flags );
/**
@ -75,14 +72,7 @@ int mca_rcache_rb_delete (
void mca_rcache_rb_module_init( mca_rcache_rb_module_t* rcache );
void mca_rcache_rb_finalize(
struct mca_rcache_base_module_t*
);
void mca_rcache_rb_finalize( struct mca_rcache_base_module_t* );
#endif /* MCA_RCACHE_RB_H */

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/**
* 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,
@ -40,7 +41,7 @@ typedef int (*mca_rcache_base_module_find_fn_t) (
typedef int (*mca_rcache_base_module_find_all_fn_t)(
struct mca_rcache_base_module_t* rcache, void* addr, size_t size,
ompi_pointer_array_t *regs);
opal_pointer_array_t *regs);
typedef int (*mca_rcache_base_module_insert_fn_t)(
struct mca_rcache_base_module_t* rcache,

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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,
@ -61,7 +62,7 @@ int mca_rcache_vma_find(struct mca_rcache_base_module_t* rcache,
}
int mca_rcache_vma_find_all(struct mca_rcache_base_module_t* rcache,
void* addr, size_t size, ompi_pointer_array_t *regs)
void* addr, size_t size, opal_pointer_array_t *regs)
{
void *base_addr, *bound_addr;

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/**
* 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,
@ -53,7 +54,7 @@ int mca_rcache_vma_find(mca_rcache_base_module_t* rcache, void* addr,
size_t size, mca_mpool_base_registration_t **reg);
int mca_rcache_vma_find_all(mca_rcache_base_module_t* rcache, void* addr,
size_t size, ompi_pointer_array_t *regs);
size_t size, opal_pointer_array_t *regs);
int mca_rcache_vma_insert(struct mca_rcache_base_module_t* rcache,
mca_mpool_base_registration_t* registration, size_t limit);

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/**
* 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,
@ -285,12 +286,12 @@ mca_mpool_base_registration_t *mca_rcache_vma_tree_find(
return NULL;
}
static inline bool is_reg_in_array(ompi_pointer_array_t *regs, void *p)
static inline bool is_reg_in_array(opal_pointer_array_t *regs, void *p)
{
int i;
for(i = 0; i < ompi_pointer_array_get_size(regs); i++) {
if(ompi_pointer_array_get_item(regs, i) == p)
for(i = 0; i < opal_pointer_array_get_size(regs); i++) {
if(opal_pointer_array_get_item(regs, i) == p)
return true;
}
@ -299,7 +300,7 @@ static inline bool is_reg_in_array(ompi_pointer_array_t *regs, void *p)
int mca_rcache_vma_tree_find_all(
mca_rcache_vma_module_t *vma_rcache, unsigned char *base,
unsigned char *bound, ompi_pointer_array_t *regs)
unsigned char *bound, opal_pointer_array_t *regs)
{
int cnt = 0;
@ -330,7 +331,7 @@ int mca_rcache_vma_tree_find_all(
if(is_reg_in_array(regs, (void*)vma_item->reg)) {
continue;
}
ompi_pointer_array_add(regs, (void*)vma_item->reg);
opal_pointer_array_add(regs, (void*)vma_item->reg);
cnt++;
}

Просмотреть файл

@ -1,9 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/**
* 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,
@ -76,7 +76,7 @@ mca_mpool_base_registration_t* mca_rcache_vma_tree_find(
*/
int mca_rcache_vma_tree_find_all(
mca_rcache_vma_module_t *vma_rcache, unsigned char *base,
unsigned char *bound, ompi_pointer_array_t *regs);
unsigned char *bound, opal_pointer_array_t *regs);
/*
* insert an item in the vma tree

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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 +49,9 @@ MPI_Comm MPI_Comm_f2c(MPI_Fint comm)
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);
}

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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 +52,10 @@ MPI_Errhandler MPI_Errhandler_f2c(MPI_Fint errhandler_f)
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);
}

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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 +51,9 @@ MPI_File MPI_File_f2c(MPI_Fint file_f)
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);
}

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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 +51,9 @@ MPI_Group MPI_Group_f2c(MPI_Fint group_f)
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);
}

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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 +59,9 @@ MPI_Info MPI_Info_f2c(MPI_Fint info)
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);
}

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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 +52,9 @@ MPI_Op MPI_Op_f2c(MPI_Fint op_f)
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);
}

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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 +62,7 @@ MPI_Fint MPI_Request_c2f(MPI_Request request)
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) ;

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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 +50,10 @@ MPI_Request MPI_Request_f2c(MPI_Fint request)
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);
}

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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 +50,10 @@ MPI_Datatype MPI_Type_f2c(MPI_Fint datatype)
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);
}

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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 +49,9 @@ MPI_Win MPI_Win_f2c(MPI_Fint win)
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);
}

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* Copyright (c) 2004-2006 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-2007 High Performance Computing Center Stuttgart,
@ -22,14 +23,14 @@
#include "ompi/constants.h"
#include "ompi/op/op.h"
#include "ompi/op/op_predefined.h"
#include "ompi/class/ompi_pointer_array.h"
#include "opal/class/opal_pointer_array.h"
#include "ompi/datatype/datatype_internal.h"
/*
* Table for Fortran <-> C op handle conversion
*/
ompi_pointer_array_t *ompi_op_f_to_c_table;
opal_pointer_array_t *ompi_op_f_to_c_table;
/*
@ -606,7 +607,7 @@ int ompi_op_init(void)
/* initialize ompi_op_f_to_c_table */
ompi_op_f_to_c_table = OBJ_NEW(ompi_pointer_array_t);
ompi_op_f_to_c_table = OBJ_NEW(opal_pointer_array_t);
if (NULL == ompi_op_f_to_c_table){
return OMPI_ERROR;
}
@ -789,7 +790,7 @@ static void ompi_op_construct(ompi_op_t *new_op)
/* assign entry in fortran <-> c translation array */
ret_val = ompi_pointer_array_add(ompi_op_f_to_c_table, new_op);
ret_val = opal_pointer_array_add(ompi_op_f_to_c_table, new_op);
new_op->o_f_to_c_index = ret_val;
}
@ -802,9 +803,9 @@ static void ompi_op_destruct(ompi_op_t *op)
/* reset the ompi_op_f_to_c_table entry - make sure that the
entry is in the table */
if (NULL != ompi_pointer_array_get_item(ompi_op_f_to_c_table,
if (NULL != opal_pointer_array_get_item(ompi_op_f_to_c_table,
op->o_f_to_c_index)) {
ompi_pointer_array_set_item(ompi_op_f_to_c_table,
opal_pointer_array_set_item(ompi_op_f_to_c_table,
op->o_f_to_c_index, NULL);
}
}

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* Copyright (c) 2004-2006 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-2007 High Performance Computing Center Stuttgart,
@ -373,65 +374,65 @@ OMPI_DECLSPEC extern ompi_op_t ompi_mpi_op_replace;
/**
* Table for Fortran <-> C op handle conversion
*/
extern struct ompi_pointer_array_t *ompi_op_f_to_c_table;
extern struct opal_pointer_array_t *ompi_op_f_to_c_table;
/**
* Initialize the op interface.
*
* @returns OMPI_SUCCESS Upon success
* @returns OMPI_ERROR Otherwise
*
* Invoked from ompi_mpi_init(); sets up the op interface, creates
* the predefined MPI operations, and creates the corresopnding F2C
* translation table.
*/
int ompi_op_init(void);
/**
* Initialize the op interface.
*
* @returns OMPI_SUCCESS Upon success
* @returns OMPI_ERROR Otherwise
*
* Invoked from ompi_mpi_init(); sets up the op interface, creates
* the predefined MPI operations, and creates the corresopnding F2C
* translation table.
*/
int ompi_op_init(void);
/**
* Finalize the op interface.
*
* @returns OMPI_SUCCESS Always
*
* Invokes from ompi_mpi_finalize(); tears down the op interface, and
* destroys the F2C translation table.
*/
int ompi_op_finalize(void);
/**
* Finalize the op interface.
*
* @returns OMPI_SUCCESS Always
*
* Invokes from ompi_mpi_finalize(); tears down the op interface, and
* destroys the F2C translation table.
*/
int ompi_op_finalize(void);
/**
* Create a ompi_op_t
*
* @param commute Boolean indicating whether the operation is
* communative or not
* @param func Function pointer of the error handler
*
* @returns op Pointer to the ompi_op_t that will be
* created and returned
*
* This function is called as the back-end of all the MPI_OP_CREATE
* functions. It creates a new ompi_op_t object, initializes it to
* the correct object type, and sets the callback function on it.
*
* The type of the function pointer is (arbitrarily) the fortran
* function handler type. Since this function has to accept 2
* different function pointer types (lest we have 2 different
* functions to create errhandlers), the fortran one was picked
* arbitrarily. Note that (void*) is not sufficient because at
* least theoretically, a sizeof(void*) may not necessarily be the
* same as sizeof(void(*)).
*
* NOTE: It *always* sets the "fortran" flag to false. The Fortran
* wrapper for MPI_OP_CREATE is expected to reset this flag to true
* manually.
*/
ompi_op_t *ompi_op_create(bool commute, ompi_op_fortran_handler_fn_t *func);
/**
* Create a ompi_op_t
*
* @param commute Boolean indicating whether the operation is
* communative or not
* @param func Function pointer of the error handler
*
* @returns op Pointer to the ompi_op_t that will be
* created and returned
*
* This function is called as the back-end of all the MPI_OP_CREATE
* functions. It creates a new ompi_op_t object, initializes it to
* the correct object type, and sets the callback function on it.
*
* The type of the function pointer is (arbitrarily) the fortran
* function handler type. Since this function has to accept 2
* different function pointer types (lest we have 2 different
* functions to create errhandlers), the fortran one was picked
* arbitrarily. Note that (void*) is not sufficient because at
* least theoretically, a sizeof(void*) may not necessarily be the
* same as sizeof(void(*)).
*
* NOTE: It *always* sets the "fortran" flag to false. The Fortran
* wrapper for MPI_OP_CREATE is expected to reset this flag to true
* manually.
*/
ompi_op_t *ompi_op_create(bool commute, ompi_op_fortran_handler_fn_t *func);
/**
* Mark an MPI_Op as holding a C++ callback function, and cache
* that function in the MPI_Op. See a lenghty comment in
* ompi/mpi/cxx/op.c::ompi_mpi_cxx_op_intercept() for a full
* expalantion.
*/
OMPI_DECLSPEC void ompi_op_set_cxx_callback(ompi_op_t *op, MPI_User_function *fn);
/**
* Mark an MPI_Op as holding a C++ callback function, and cache
* that function in the MPI_Op. See a lenghty comment in
* ompi/mpi/cxx/op.c::ompi_mpi_cxx_op_intercept() for a full
* expalantion.
*/
OMPI_DECLSPEC void ompi_op_set_cxx_callback(ompi_op_t *op, MPI_User_function *fn);
/**
* Check to see if an op is intrinsic.

Просмотреть файл

@ -1,5 +1,6 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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-2006 High Performance Computing Center Stuttgart,
@ -17,8 +18,6 @@
#include "ompi/peruse/peruse.h"
#include "ompi/peruse/peruse-internal.h"
#include "ompi/constants.h"
#include "class/ompi_pointer_array.h"
static opal_list_t peruse_handle_list;
static opal_mutex_t peruse_handle_list_lock;

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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 +25,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 +47,9 @@ ompi_request_fns_t ompi_request_functions = {
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_complete_cb = NULL;
req->req_f_to_c_index = MPI_UNDEFINED;
req->req_mpi_object.comm = (struct ompi_communicator_t*) NULL;
}
@ -93,11 +95,15 @@ OBJ_CLASS_INSTANCE(
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 +115,7 @@ int ompi_request_init(void)
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 +147,7 @@ int ompi_request_init(void)
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;

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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 +28,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
@ -77,6 +78,13 @@ typedef int (*ompi_request_free_fn_t)(struct ompi_request_t** rptr);
*/
typedef int (*ompi_request_cancel_fn_t)(struct ompi_request_t* request, int flag);
/*
* Optional function called when the request is completed from the MPI
* library perspective. This function is not allowed to release any
* ressources related to the request.
*/
typedef int (*ompi_request_complete_fn_t)(struct ompi_request_t* request);
/**
* Forward declaration
*/
@ -105,16 +113,17 @@ typedef union ompi_mpi_object_t {
* 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_request_complete_fn_t req_complete_cb; /**< Called when the request is MPI completed */
ompi_mpi_object_t req_mpi_object; /**< Pointer to MPI object that created this request */
};
/**
@ -155,7 +164,7 @@ typedef struct ompi_request_t ompi_request_t;
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 +306,7 @@ typedef struct ompi_request_fns_t {
/**
* 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;
@ -384,6 +393,9 @@ static inline void ompi_request_wait_completion(ompi_request_t *req)
static inline int ompi_request_complete(ompi_request_t* request)
{
if( NULL != request->req_complete_cb ) {
request->req_complete_cb( request );
}
ompi_request_completed++;
request->req_complete = true;
if(ompi_request_waiting)

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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 +109,10 @@ notify_collectives(int msg)
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);

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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 +34,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 +48,11 @@ int
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 +60,7 @@ ompi_win_init(void)
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 +131,7 @@ ompi_win_create(void *base, size_t size,
}
/* 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 +149,7 @@ ompi_win_free(ompi_win_t *win)
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);
}

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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 +49,7 @@ extern "C" {
#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;

Просмотреть файл

@ -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 @@ headers += \
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 @@ libopen_pal_la_SOURCES += \
class/opal_list.c \
class/opal_object.c \
class/opal_atomic_lifo.c \
class/opal_pointer_array.c \
class/opal_value_array.c

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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,
@ -16,42 +17,44 @@
* $HEADER$
*/
#include "ompi_config.h"
#include "opal_config.h"
#include <stdlib.h>
#include <stdio.h>
#include <assert.h>
#include "ompi/constants.h"
#include "ompi/class/ompi_pointer_array.h"
#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 ompi_pointer_array_construct(ompi_pointer_array_t *);
static void ompi_pointer_array_destruct(ompi_pointer_array_t *);
static bool grow_table(ompi_pointer_array_t *table, size_t soft, size_t hard);
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, size_t soft, size_t hard);
OBJ_CLASS_INSTANCE(ompi_pointer_array_t, opal_object_t,
ompi_pointer_array_construct,
ompi_pointer_array_destruct);
OBJ_CLASS_INSTANCE(opal_pointer_array_t, opal_object_t,
opal_pointer_array_construct,
opal_pointer_array_destruct);
/*
* ompi_pointer_array constructor
* opal_pointer_array constructor
*/
static void ompi_pointer_array_construct(ompi_pointer_array_t *array)
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;
}
/*
* ompi_pointer_array destructor
* opal_pointer_array destructor
*/
static void ompi_pointer_array_destruct(ompi_pointer_array_t *array)
static void opal_pointer_array_destruct(opal_pointer_array_t *array)
{
/* free table */
if( NULL != array->addr) {
@ -61,18 +64,48 @@ static void ompi_pointer_array_destruct(ompi_pointer_array_t *array)
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 ompi_pointer_array_t object (IN)
* @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 OMPI_ERROR if it fails
* @return Array index where ptr is inserted or OPAL_ERROR if it fails
*/
int ompi_pointer_array_add(ompi_pointer_array_t *table, void *ptr)
int opal_pointer_array_add(opal_pointer_array_t *table, void *ptr)
{
int i;
int index;
int i, index;
OPAL_THREAD_LOCK(&(table->lock));
@ -82,7 +115,7 @@ int ompi_pointer_array_add(ompi_pointer_array_t *table, void *ptr)
(NULL == table->addr ? TABLE_INIT : table->size * TABLE_GROW),
OMPI_FORTRAN_HANDLE_MAX)) {
OPAL_THREAD_UNLOCK(&(table->lock));
return OMPI_ERR_OUT_OF_RESOURCE;
return OPAL_ERR_OUT_OF_RESOURCE;
}
}
@ -115,17 +148,17 @@ int ompi_pointer_array_add(ompi_pointer_array_t *table, void *ptr)
}
/**
* free a slot in dynamic pointer table for reuse
* Set the value of the dynamic array at a specified location.
*
*
* @param table Pointer to ompi_pointer_array_t object (IN)
* @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 ompi_pointer_array_set_item(ompi_pointer_array_t *table, int index,
int opal_pointer_array_set_item(opal_pointer_array_t *table, int index,
void * value)
{
assert(table != NULL);
@ -137,66 +170,36 @@ int ompi_pointer_array_set_item(ompi_pointer_array_t *table, int index,
if (!grow_table(table, ((index / TABLE_GROW) + 1) * TABLE_GROW,
index)) {
OPAL_THREAD_UNLOCK(&(table->lock));
return OMPI_ERROR;
return OPAL_ERROR;
}
}
/*
* allow a specific index to be changed.
*/
if ( NULL == table->addr[index] ) {
table->addr[index] = value;
/* mark element as free, if NULL element */
if( NULL == value ) {
if (index < table->lowest_free) {
table->lowest_free = index;
}
}
else {
table->number_free--;
/* Reset lowest_free if required */
if ( index == table->lowest_free ) {
int i;
/* 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; i<table->size; i++) {
if ( NULL == table->addr[i] ){
table->lowest_free = i;
break;
}
}
}
}
table->lowest_free = table->size;
for ( i=index; i<table->size; i++) {
if ( NULL == table->addr[i] ){
table->lowest_free = i;
break;
}
}
}
}
else {
table->addr[index] = value;
/* mark element as free, if NULL element */
if( NULL == value ) {
if (index < table->lowest_free) {
table->lowest_free = 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; i<table->size; i++) {
if ( NULL == table->addr[i] ){
table->lowest_free = i;
break;
}
}
}
}
}
table->addr[index] = value;
#if 0
opal_output(0,"ompi_pointer_array_set_item: OUT: "
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,
@ -204,7 +207,7 @@ int ompi_pointer_array_set_item(ompi_pointer_array_t *table, int index,
#endif
OPAL_THREAD_UNLOCK(&(table->lock));
return OMPI_SUCCESS;
return OPAL_SUCCESS;
}
/**
@ -221,14 +224,14 @@ int ompi_pointer_array_set_item(ompi_pointer_array_t *table, int index,
* In contrary to array_set, this function does not allow to overwrite
* a value, unless the previous value is NULL ( equiv. to free ).
*/
bool ompi_pointer_array_test_and_set_item (ompi_pointer_array_t *table,
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,"ompi_pointer_array_test_and_set_item: IN: "
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,
@ -272,7 +275,7 @@ bool ompi_pointer_array_test_and_set_item (ompi_pointer_array_t *table,
}
#if 0
opal_output(0,"ompi_pointer_array_test_and_set_item: OUT: "
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,
@ -283,31 +286,38 @@ bool ompi_pointer_array_test_and_set_item (ompi_pointer_array_t *table,
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(ompi_pointer_array_t *table, size_t soft, size_t hard)
static bool grow_table(opal_pointer_array_t *table, size_t soft, size_t hard)
{
size_t new_size;
int i, new_size_int;
void *p;
/* Ensure that we have room to grow -- stay less than
OMPI_FORTRAN_HANDLE_MAX. Note that OMPI_FORTRAN_HANDLE_MAX
is min(INT_MAX, fortran INTEGER max), so it's guaranteed to
fit within a [signed] int. */
if (table->size >= OMPI_FORTRAN_HANDLE_MAX) {
/* 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;
}
if (soft > OMPI_FORTRAN_HANDLE_MAX) {
if (hard > OMPI_FORTRAN_HANDLE_MAX) {
return false;
} else {
new_size = hard;
}
} else {
new_size = soft;
}
p = (void **) realloc(table->addr, new_size * sizeof(void *));
if (p == NULL) {
return false;

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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,
@ -17,8 +18,8 @@
*/
/** @file
*
* See ompi_bitmap.h for an explanation of why there is a split
* between OMPI and ORTE for this generic class.
* 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
@ -28,22 +29,20 @@
* INTEGER max)), just to be sure.
*/
#ifndef OMPI_POINTER_ARRAY_H
#define OMPI_POINTER_ARRAY_H
#ifndef OPAL_POINTER_ARRAY_H
#define OPAL_POINTER_ARRAY_H
#include "ompi_config.h"
#include "opal_config.h"
#include "opal/threads/mutex.h"
#include "opal/class/opal_object.h"
#if defined(c_plusplus) || defined(__cplusplus)
extern "C" {
#endif
BEGIN_C_DECLS
/**
* dynamic pointer array
*/
struct ompi_pointer_array_t {
struct opal_pointer_array_t {
/** base class */
opal_object_t super;
/** synchronization object */
@ -57,17 +56,39 @@ struct ompi_pointer_array_t {
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 ompi_pointer_array_t ompi_pointer_array_t;
typedef struct opal_pointer_array_t opal_pointer_array_t;
/**
* Class declaration
*/
OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_pointer_array_t);
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)
@ -78,7 +99,7 @@ OMPI_DECLSPEC OBJ_CLASS_DECLARATION(ompi_pointer_array_t);
* @return Index of inserted array element. Return value of
* (-1) indicates an error.
*/
OMPI_DECLSPEC int ompi_pointer_array_add(ompi_pointer_array_t *array, void *ptr);
OPAL_DECLSPEC int opal_pointer_array_add(opal_pointer_array_t *array, void *ptr);
/**
* Set the value of an element in array
@ -89,7 +110,7 @@ OMPI_DECLSPEC int ompi_pointer_array_add(ompi_pointer_array_t *array, void *ptr)
*
* @return Error code. (-1) indicates an error.
*/
OMPI_DECLSPEC int ompi_pointer_array_set_item(ompi_pointer_array_t *array,
OPAL_DECLSPEC int opal_pointer_array_set_item(opal_pointer_array_t *array,
int index, void *value);
/**
@ -101,7 +122,7 @@ OMPI_DECLSPEC int ompi_pointer_array_set_item(ompi_pointer_array_t *array,
* @return Error code. NULL indicates an error.
*/
static inline void *ompi_pointer_array_get_item(ompi_pointer_array_t *table,
static inline void *opal_pointer_array_get_item(opal_pointer_array_t *table,
int element_index)
{
void *p;
@ -126,11 +147,22 @@ static inline void *ompi_pointer_array_get_item(ompi_pointer_array_t *table,
* Simple inline function to return the size of the array in order to
* hide the member field from external users.
*/
static inline int ompi_pointer_array_get_size(ompi_pointer_array_t *array)
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
@ -146,7 +178,7 @@ static inline int ompi_pointer_array_get_size(ompi_pointer_array_t *array)
* In contrary to array_set, this function does not allow to overwrite
* a value, unless the previous value is NULL ( equiv. to free ).
*/
OMPI_DECLSPEC bool ompi_pointer_array_test_and_set_item (ompi_pointer_array_t *table,
OPAL_DECLSPEC bool opal_pointer_array_test_and_set_item (opal_pointer_array_t *table,
int index,
void *value);
@ -156,19 +188,21 @@ OMPI_DECLSPEC bool ompi_pointer_array_test_and_set_item (ompi_pointer_array_t *t
* @param array Pointer to array (IN)
*
*/
static inline void ompi_pointer_array_remove_all(ompi_pointer_array_t *array)
static inline void opal_pointer_array_remove_all(opal_pointer_array_t *array)
{
int i;
OPAL_THREAD_LOCK(&array->lock);
array->lowest_free = 0;
array->number_free = array->size;
for(i=0; i<array->size; i++) {
array->addr[i] = NULL;
}
OPAL_THREAD_UNLOCK(&array->lock);
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; i<array->size; i++) {
array->addr[i] = NULL;
}
OPAL_THREAD_UNLOCK(&array->lock);
}
#if defined(c_plusplus) || defined(__cplusplus)
}
#endif
#endif /* OMPI_POINTER_ARRAY_H */
END_C_DECLS
#endif /* OPAL_POINTER_ARRAY_H */

Просмотреть файл

@ -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 @@ check_PROGRAMS = \
opal_hash_table \
opal_list \
opal_value_array \
ompi_pointer_array \
opal_pointer_array \
ompi_rb_tree
TESTS = \
@ -66,13 +66,13 @@ opal_hash_table_LDADD = \
$(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 = \

Просмотреть файл

@ -1,8 +1,9 @@
/* -*- Mode: C; c-basic-offset:4 ; -*- */
/*
* 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,
@ -17,7 +18,7 @@
*/
/*
* This test is intended to test the ompi_pointer_array
* This test is intended to test the opal_pointer_array
* class
*/
@ -28,7 +29,7 @@
#include <string.h>
#include "support.h"
#include "ompi/class/ompi_pointer_array.h"
#include "ompi/class/opal_pointer_array.h"
typedef union {
int ivalue;
@ -38,7 +39,7 @@ typedef union {
static void test(bool thread_usage){
/* local variables */
ompi_pointer_array_t *array;
opal_pointer_array_t *array;
value_t *test_data;
int len_test_data,i,test_len_in_array,error_cnt;
int ele_index;
@ -48,7 +49,7 @@ static void test(bool thread_usage){
/* initialize thread levels */
use_threads=(int)opal_set_using_threads(thread_usage);
array=OBJ_NEW(ompi_pointer_array_t);
array=OBJ_NEW(opal_pointer_array_t);
assert(array);
len_test_data=5;
@ -63,7 +64,7 @@ static void test(bool thread_usage){
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);
opal_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) {
@ -89,11 +90,11 @@ static void test(bool thread_usage){
/* 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);
error_code=opal_pointer_array_set_item(array,ele_index,NULL);
if( 0 == error_code ) {
test_success();
} else {
test_failure(" ompi_pointer_array_set_item ");
test_failure(" opal_pointer_array_set_item ");
}
if( NULL == array->addr[ele_index]){
test_success();
@ -106,7 +107,7 @@ static void test(bool thread_usage){
test_failure(" lowest free ");
}
/* test ompi_pointer_array_get_item */
/* test opal_pointer_array_get_item */
array->number_free=array->size;
array->lowest_free=0;
for(i=0 ; i < array->size ; i++ ) {
@ -115,7 +116,7 @@ static void test(bool thread_usage){
error_cnt=0;
for(i=0 ; i < array->size ; i++ ) {
value.ivalue = i + 2;
ele_index=ompi_pointer_array_add(array, value.cvalue);
ele_index=opal_pointer_array_add(array, value.cvalue);
if( i != ele_index ) {
error_cnt++;
}
@ -123,12 +124,12 @@ static void test(bool thread_usage){
if( 0 == error_cnt ) {
test_success();
} else {
test_failure(" ompi_pointer_array_add 2nd ");
test_failure(" opal_pointer_array_add 2nd ");
}
error_cnt=0;
for(i=0 ; i < array->size ; i++ ) {
value.cvalue = ompi_pointer_array_get_item(array,i);
value.cvalue = opal_pointer_array_get_item(array,i);
if( (i+2) != value.ivalue ) {
error_cnt++;
}
@ -146,7 +147,7 @@ static void test(bool thread_usage){
int main(int argc, char **argv)
{
test_init("ompi_pointer_array");
test_init("opal_pointer_array");
/* run through tests with thread usage set to false */
test(false);