ompi/runtime: release F90 types in ompi_mpi_finalize()
F90 types cannot be freed by the enduser as specified by the standard. but since they are ompi_datatype_dup'ed from predefined datatypes, they have to be explicitly free'd at finalize time in order to avoid a memory leak. Signed-off-by: Gilles Gouaillardet <gilles@rist.or.jp>
Этот коммит содержится в:
родитель
45732fd764
Коммит
d94e8c97a0
@ -105,6 +105,8 @@ int ompi_mpi_finalize(void)
|
||||
ompi_proc_t** procs;
|
||||
size_t nprocs;
|
||||
volatile bool active;
|
||||
uint32_t key;
|
||||
ompi_datatype_t * datatype;
|
||||
OPAL_TIMING_DECLARE(tm);
|
||||
OPAL_TIMING_INIT_EXT(&tm, OPAL_TIMING_GET_TIME_OF_DAY);
|
||||
|
||||
@ -297,14 +299,16 @@ int ompi_mpi_finalize(void)
|
||||
}
|
||||
OBJ_DESTRUCT(&ompi_registered_datareps);
|
||||
|
||||
/* Remove all F90 types from the hash tables. As the OBJ_DESTRUCT will
|
||||
* call a special destructor able to release predefined types, we can
|
||||
* simply call the OBJ_DESTRUCT on the hash table and all memory will
|
||||
* be correctly released.
|
||||
*/
|
||||
OBJ_DESTRUCT( &ompi_mpi_f90_integer_hashtable );
|
||||
OBJ_DESTRUCT( &ompi_mpi_f90_real_hashtable );
|
||||
OBJ_DESTRUCT( &ompi_mpi_f90_complex_hashtable );
|
||||
/* Remove all F90 types from the hash tables */
|
||||
OPAL_HASH_TABLE_FOREACH(key, uint32, datatype, &ompi_mpi_f90_integer_hashtable)
|
||||
OBJ_RELEASE(datatype);
|
||||
OBJ_DESTRUCT(&ompi_mpi_f90_integer_hashtable);
|
||||
OPAL_HASH_TABLE_FOREACH(key, uint32, datatype, &ompi_mpi_f90_real_hashtable)
|
||||
OBJ_RELEASE(datatype);
|
||||
OBJ_DESTRUCT(&ompi_mpi_f90_real_hashtable);
|
||||
OPAL_HASH_TABLE_FOREACH(key, uint32, datatype, &ompi_mpi_f90_complex_hashtable)
|
||||
OBJ_RELEASE(datatype);
|
||||
OBJ_DESTRUCT(&ompi_mpi_f90_complex_hashtable);
|
||||
|
||||
/* Free communication objects */
|
||||
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user