2004-12-22 01:16:09 +03:00
|
|
|
/*
|
2005-11-05 22:57:48 +03:00
|
|
|
* 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
|
|
|
|
* of Tennessee Research Foundation. All rights
|
|
|
|
* reserved.
|
2004-12-22 01:16:09 +03:00
|
|
|
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
* University of Stuttgart. All rights reserved.
|
2005-03-24 15:43:37 +03:00
|
|
|
* Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
* All rights reserved.
|
2004-12-22 01:16:09 +03:00
|
|
|
* $COPYRIGHT$
|
|
|
|
*
|
|
|
|
* Additional copyrights may follow
|
|
|
|
*
|
|
|
|
* $HEADER$
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "ompi_config.h"
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
#include "include/constants.h"
|
2005-07-04 03:09:55 +04:00
|
|
|
#include "opal/event/event.h"
|
2004-12-22 01:16:09 +03:00
|
|
|
#include "mca/mca.h"
|
|
|
|
#include "mca/base/base.h"
|
|
|
|
#include "mca/iof/iof.h"
|
|
|
|
#include "mca/iof/base/base.h"
|
2005-01-12 23:51:34 +03:00
|
|
|
#include "mca/iof/base/iof_base_endpoint.h"
|
|
|
|
|
|
|
|
|
2005-03-14 23:57:21 +03:00
|
|
|
int orte_iof_base_close(void)
|
2004-12-22 01:16:09 +03:00
|
|
|
{
|
2005-07-03 20:22:16 +04:00
|
|
|
opal_list_item_t* item;
|
2005-01-12 23:51:34 +03:00
|
|
|
|
2005-03-18 06:43:59 +03:00
|
|
|
/* We only need to flush if an iof component was successfully
|
|
|
|
selected */
|
|
|
|
|
2005-03-19 02:40:08 +03:00
|
|
|
if (orte_iof_base.iof_flush) {
|
2005-03-18 06:43:59 +03:00
|
|
|
orte_iof_base_flush();
|
2005-03-19 02:40:08 +03:00
|
|
|
orte_iof_base.iof_flush = false;
|
2005-03-18 06:43:59 +03:00
|
|
|
}
|
2005-01-12 23:51:34 +03:00
|
|
|
|
2006-02-04 00:01:11 +03:00
|
|
|
/* finalize component */
|
|
|
|
if (NULL != orte_iof.iof_finalize) {
|
|
|
|
orte_iof.iof_finalize();
|
|
|
|
}
|
|
|
|
|
2005-01-12 23:51:34 +03:00
|
|
|
/* shutdown any remaining opened components */
|
2005-07-03 20:22:16 +04:00
|
|
|
if (0 != opal_list_get_size(&orte_iof_base.iof_components_opened)) {
|
2005-03-14 23:57:21 +03:00
|
|
|
mca_base_components_close(orte_iof_base.iof_output,
|
|
|
|
&orte_iof_base.iof_components_opened, NULL);
|
2005-01-12 23:51:34 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
/* final cleanup of resources */
|
2005-07-04 02:45:48 +04:00
|
|
|
OPAL_THREAD_LOCK(&orte_iof_base.iof_lock);
|
2005-07-03 20:22:16 +04:00
|
|
|
while((item = opal_list_remove_first(&orte_iof_base.iof_endpoints)) != NULL) {
|
2005-01-12 23:51:34 +03:00
|
|
|
OBJ_RELEASE(item);
|
2004-12-22 01:16:09 +03:00
|
|
|
}
|
2005-07-04 02:45:48 +04:00
|
|
|
OPAL_THREAD_UNLOCK(&orte_iof_base.iof_lock);
|
2005-08-30 01:35:01 +04:00
|
|
|
|
|
|
|
if (NULL != orte_iof_base.iof_service) {
|
|
|
|
orte_ns.free_name(&(orte_iof_base.iof_service));
|
|
|
|
}
|
|
|
|
|
2004-12-22 01:16:09 +03:00
|
|
|
return OMPI_SUCCESS;
|
|
|
|
}
|
|
|
|
|