1
1

Implement MPI-2.2 functionality of deleting attributes on

MPI_COMM_SELF in reverse order during MPI_FINALIZE (well, actually,
''all'' attributes are now deleted in reverse order whenever a
communicator is destructed).

Also revamped a few things in the MPI attribute implementation:

 * use a One Big Lock philosophy for making the implementation thread
   safe (vs. the pair of locks we were using before).  One Big Lock is
   quite a bit simpler and has fewer corner cases; the code for
   attributes is still complicated, but is definitely less complex
   than it used to be.
 * The COPY_ATTR_CALLBACKS and DELETE_ATTR_CALLBACKS macros no longer
   return; they simply set a value if something went wrong.  Then we
   check this value after the macros complete.  This simplifies
   unlocking, etc.
 * Added write barriers right before releasing locks to ensure memory
   consistency.
 * Fixed a bunch of typos in comments, and some indenting.

Many thanks to KAWASHIMA Takahiro who contributed the original patch
for attribute destruction ordering, and who helped test/debug/evolve
the patch to its final form.

Fixes trac:3123.

cmr:v1.7.2:reviewer=bosilca

This commit was SVN r28439.

The following Trac tickets were found above:
  Ticket 3123 --> https://svn.open-mpi.org/trac/ompi/ticket/3123
Этот коммит содержится в:
Jeff Squyres 2013-05-02 12:32:21 +00:00
родитель 42a9a4c62c
Коммит 52fd270663
2 изменённых файлов: 321 добавлений и 272 удалений

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -187,7 +187,7 @@ static inline
int ompi_attr_hash_init(opal_hash_table_t **hash)
{
*hash = OBJ_NEW(opal_hash_table_t);
if (NULL == hash) {
if (NULL == *hash) {
fprintf(stderr, "Error while creating the local attribute list\n");
return MPI_ERR_SYSRESOURCE;
}
@ -431,7 +431,7 @@ int ompi_attr_get_c(opal_hash_table_t *attr_hash, int key,
* Get an attribute on the comm/win/datatype in a form valid for
* Fortran MPI-2.
*
* @param attrhash The attribute hash table hanging on the object(IN)
* @param attr_hash The attribute hash table hanging on the object(IN)
* @param key Key val for the attribute (IN)
* @param attribute The actual attribute pointer (OUT)
* @param flag Flag whether an attribute is associated
@ -471,13 +471,13 @@ int ompi_attr_delete(ompi_attribute_type_t type, void *object,
/**
* This to be used from functions like MPI_*_DUP inorder to copy all
* This to be used from functions like MPI_*_DUP in order to copy all
* the attributes from the old Comm/Win/Dtype object to a new
* object.
* @param type Type of attribute (COMM/WIN/DTYPE) (IN)
* @param old_object The old COMM/WIN/DTYPE object (IN)
* @param new_object The new COMM/WIN/DTYPE object (IN)
* @param attr_hash The attribute hash table hanging on old object(IN)
* @param oldattr_hash The attribute hash table hanging on old object(IN)
* @param newattr_hash The attribute hash table hanging on new object(IN)
* @return OMPI error code
*
@ -485,7 +485,7 @@ int ompi_attr_delete(ompi_attribute_type_t type, void *object,
int ompi_attr_copy_all(ompi_attribute_type_t type, void *old_object,
void *new_object, opal_hash_table_t *oldattr_hash,
opal_hash_table_t *newkeyhash);
opal_hash_table_t *newattr_hash);
/**