diff --git a/runtime/starpu/control/runtime_control.c b/runtime/starpu/control/runtime_control.c index 5854a403aa3fb1bcf41098c4bf268daf1075283f..a0b82f0252d518150278e27e50ac67d12ee1da75 100644 --- a/runtime/starpu/control/runtime_control.c +++ b/runtime/starpu/control/runtime_control.c @@ -142,6 +142,8 @@ int RUNTIME_init( CHAM_context_t *chamctxt, starpu_cublas_init(); #endif + starpu_cham_tile_interface_init(); + return hres; } @@ -157,6 +159,8 @@ void RUNTIME_finalize( CHAM_context_t *chamctxt ) return; } + starpu_cham_tile_interface_fini(); + #if defined(CHAMELEON_USE_CUDA) && !defined(CHAMELEON_SIMULATION) starpu_cublas_shutdown(); #endif diff --git a/runtime/starpu/include/cham_tile_interface.h b/runtime/starpu/include/cham_tile_interface.h index 286ba61c81cf9c826b42b45a2dcc5a62c9bb1087..1a7f887aae261c7c23f043f163ffbe16c7557239 100644 --- a/runtime/starpu/include/cham_tile_interface.h +++ b/runtime/starpu/include/cham_tile_interface.h @@ -53,4 +53,7 @@ cti_interface_get( starpu_cham_tile_interface_t *interface ) return &(interface->tile); } +void starpu_cham_tile_interface_init(); +void starpu_cham_tile_interface_fini(); + #endif /* _cham_tile_interface_h_ */ diff --git a/runtime/starpu/interface/cham_tile_interface.c b/runtime/starpu/interface/cham_tile_interface.c index 04325f473fedca87d80380ea3e07bd04dc21040a..eaab054d4c17844f19152095558cb4ad51dcc7d6 100644 --- a/runtime/starpu/interface/cham_tile_interface.c +++ b/runtime/starpu/interface/cham_tile_interface.c @@ -512,9 +512,6 @@ cti_free_datatype( MPI_Datatype *datatype ) } #endif -void -starpu_cham_tile_interface_init() __attribute__((constructor)); - void starpu_cham_tile_interface_init() { @@ -528,3 +525,14 @@ starpu_cham_tile_interface_init() #endif } } + +void +starpu_cham_tile_interface_fini() +{ + if ( starpu_interface_cham_tile_ops.interfaceid != STARPU_UNKNOWN_INTERFACE_ID ) + { +#if defined(HAVE_STARPU_MPI_INTERFACE_DATATYPE_REGISTER) + starpu_mpi_interface_datatype_unregister( starpu_interface_cham_tile_ops.interfaceid ); +#endif + } +}