1
1

Change references to keyhash according to the comm/datatype/win object -- append a prefix to keyhash in the respective structure

This commit was SVN r938.
Этот коммит содержится в:
Vishal Sahay 2004-03-19 16:34:09 +00:00
родитель 03a4898a4d
Коммит af4a977a21
5 изменённых файлов: 34 добавлений и 35 удалений

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

@ -13,13 +13,15 @@
#define ATTR_TABLE_SIZE 10 #define ATTR_TABLE_SIZE 10
/* This is done so that I can have a conssitent interface to my macros /* This is done so that I can have a conssitent interface to my macros
here, because Datatype and Type - both are used for Datatype here */
related stuff */
#define MPI_DATATYPE_NULL_COPY_FN MPI_TYPE_NULL_COPY_FN #define MPI_DATATYPE_NULL_COPY_FN MPI_TYPE_NULL_COPY_FN
#define lam_Comm_t lam_communicator_t * #define lam_c_t lam_communicator_t *
#define lam_Type_t lam_datatype_t * #define lam_d_t lam_datatype_t *
#define lam_Win_t lam_win_t * #define lam_w_t lam_win_t *
#define MPI_c_delete_attr_function MPI_Comm_delete_attr_function
#define MPI_d_delete_attr_function MPI_Type_delete_attr_function
#define MPI_w_delete_attr_function MPI_Win_delete_attr_function
#define CREATE_KEY() lam_bitmap_find_and_set_first_unset_bit(key_bitmap) #define CREATE_KEY() lam_bitmap_find_and_set_first_unset_bit(key_bitmap)
@ -39,11 +41,11 @@
#define GET_ATTR(type) \ #define GET_ATTR(type) \
lam_hash_table_get_value_uint32(((lam_##type##_t)object)->keyhash, key); lam_hash_table_get_value_uint32(((lam_##type##_t)object)->type##_keyhash, key);
#define SET_ATTR(type, attribute) \ #define SET_ATTR(type, attribute) \
ret = lam_hash_table_set_value_uint32(((lam_##type##_t)object)->keyhash,\ ret = lam_hash_table_set_value_uint32(((lam_##type##_t)object)->type##_keyhash,\
key, \ key, \
attribute); \ attribute); \
if (ret != LAM_SUCCESS) \ if (ret != LAM_SUCCESS) \
@ -51,7 +53,7 @@
#define REMOVE_ATTR_ENTRY(type) \ #define REMOVE_ATTR_ENTRY(type) \
ret = lam_hash_table_remove_value_uint32(((lam_##type##_t)object)->keyhash,\ ret = lam_hash_table_remove_value_uint32(((lam_##type##_t)object)->type##_keyhash,\
key);\ key);\
if (ret != LAM_SUCCESS) \ if (ret != LAM_SUCCESS) \
return ret; return ret;
@ -261,21 +263,21 @@ lam_attr_delete(lam_attribute_type_t type, void *object, int key,
switch(type) { switch(type) {
case COMM_ATTR: case COMM_ATTR:
attr = GET_ATTR(Comm); attr = GET_ATTR(c);
DELETE_ATTR_OBJECT(Comm, COMM, attr); DELETE_ATTR_OBJECT(c, COMM, attr);
REMOVE_ATTR_ENTRY(Comm); REMOVE_ATTR_ENTRY(c);
break; break;
case WIN_ATTR: case WIN_ATTR:
attr = GET_ATTR(Win); attr = GET_ATTR(w);
DELETE_ATTR_OBJECT(Win, WIN, attr); DELETE_ATTR_OBJECT(w, WIN, attr);
REMOVE_ATTR_ENTRY(Win); REMOVE_ATTR_ENTRY(w);
break; break;
case TYPE_ATTR: case TYPE_ATTR:
attr = GET_ATTR(Type); attr = GET_ATTR(d);
DELETE_ATTR_OBJECT(Type, TYPE, attr); DELETE_ATTR_OBJECT(d, TYPE, attr);
REMOVE_ATTR_ENTRY(Type); REMOVE_ATTR_ENTRY(d);
break; break;
default: default:
@ -320,30 +322,30 @@ lam_attr_set(lam_attribute_type_t type, void *object, int key, void *attribute,
switch(type) { switch(type) {
case COMM_ATTR: case COMM_ATTR:
oldattr = GET_ATTR(Comm); oldattr = GET_ATTR(c);
if (oldattr != NULL) { if (oldattr != NULL) {
DELETE_ATTR_OBJECT(Comm, COMM, oldattr); DELETE_ATTR_OBJECT(c, COMM, oldattr);
had_old = 1; had_old = 1;
} }
SET_ATTR(Comm, attribute); SET_ATTR(c, attribute);
break; break;
case WIN_ATTR: case WIN_ATTR:
oldattr = GET_ATTR(Win); oldattr = GET_ATTR(w);
if (oldattr != NULL) { if (oldattr != NULL) {
DELETE_ATTR_OBJECT(Win, WIN, oldattr); DELETE_ATTR_OBJECT(w, WIN, oldattr);
had_old = 1; had_old = 1;
} }
SET_ATTR(Win, attribute); SET_ATTR(w, attribute);
break; break;
case TYPE_ATTR: case TYPE_ATTR:
oldattr = GET_ATTR(Type); oldattr = GET_ATTR(d);
if (oldattr != NULL) { if (oldattr != NULL) {
DELETE_ATTR_OBJECT(Type, TYPE, oldattr); DELETE_ATTR_OBJECT(d, TYPE, oldattr);
had_old = 1; had_old = 1;
} }
SET_ATTR(Type, attribute); SET_ATTR(d, attribute);
break; break;
default: default:
@ -376,15 +378,15 @@ lam_attr_get(lam_attribute_type_t type, void *object, int key, void *attribute,
switch (type) { switch (type) {
case COMM_ATTR: case COMM_ATTR:
attr = GET_ATTR(Comm); attr = GET_ATTR(c);
break; break;
case WIN_ATTR: case WIN_ATTR:
attr = GET_ATTR(Win); attr = GET_ATTR(w);
break; break;
case TYPE_ATTR: case TYPE_ATTR:
attr = GET_ATTR(Type); attr = GET_ATTR(d);
break; break;
default: default:

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

@ -66,9 +66,6 @@ struct lam_attrkey_item_t {
void *copy_attr_fn; /**< Copy function for the attribute */ void *copy_attr_fn; /**< Copy function for the attribute */
void *delete_attr_fn; /**< Delete function for the attribute */ void *delete_attr_fn; /**< Delete function for the attribute */
void *extra_state; /**< Extra state of the attribute */ void *extra_state; /**< Extra state of the attribute */
int delete_ok; /**< Denotes if its ok to delete this key when
reference count is 0 -- the key can only be
deleted with MPI_*_free_keyval */
int key; /**< Keep a track of which key this item belongs to, so that int key; /**< Keep a track of which key this item belongs to, so that
the key can be deleted when this object is destroyed */ the key can be deleted when this object is destroyed */
}; };

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

@ -28,7 +28,7 @@ struct lam_communicator_t {
lam_group_t *c_remote_group; lam_group_t *c_remote_group;
/* Attributes */ /* Attributes */
lam_hash_table_t *keyhash; lam_hash_table_t *c_keyhash;
/* Topology information */ /* Topology information */
int c_cube_dim; /**< Inscribing cube dimension */ int c_cube_dim; /**< Inscribing cube dimension */

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

@ -106,7 +106,7 @@ typedef struct lam_datatype_t {
unsigned int bdt_used; /**< which basic datatypes are used in the data description */ unsigned int bdt_used; /**< which basic datatypes are used in the data description */
/* Attribute fields */ /* Attribute fields */
lam_hash_table_t *keyhash; lam_hash_table_t *d_keyhash;
char name[MPI_MAX_OBJECT_NAME]; char name[MPI_MAX_OBJECT_NAME];
dt_type_desc_t desc; /**< the data description */ dt_type_desc_t desc; /**< the data description */

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

@ -18,7 +18,7 @@ struct lam_win_t {
/* Attributes */ /* Attributes */
lam_hash_table_t *keyhash; lam_hash_table_t *w_keyhash;
/* index in Fortran <-> C translation array */ /* index in Fortran <-> C translation array */