2
* Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
3
* University Research and Technology
4
* Corporation. All rights reserved.
5
* Copyright (c) 2004-2005 The University of Tennessee and The University
6
* of Tennessee Research Foundation. All rights
8
* Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
9
* University of Stuttgart. All rights reserved.
10
* Copyright (c) 2004-2005 The Regents of the University of California.
11
* All rights reserved.
14
* Additional copyrights may follow
19
#include "orte_config.h"
23
#include "opal/event/event.h"
24
#include "opal/mca/mca.h"
25
#include "opal/mca/base/base.h"
26
#include "orte/mca/iof/iof.h"
27
#include "orte/mca/iof/base/base.h"
28
#include "orte/mca/iof/base/iof_base_endpoint.h"
31
int orte_iof_base_close(void)
33
opal_list_item_t* item;
35
/* We only need to flush if an iof component was successfully
38
if (orte_iof_base.iof_flush) {
39
orte_iof_base_flush();
40
orte_iof_base.iof_flush = false;
43
/* finalize component */
44
if (NULL != orte_iof.iof_finalize) {
45
orte_iof.iof_finalize();
48
/* shutdown any remaining opened components */
49
if (0 != opal_list_get_size(&orte_iof_base.iof_components_opened)) {
50
mca_base_components_close(orte_iof_base.iof_output,
51
&orte_iof_base.iof_components_opened, NULL);
54
/* final cleanup of resources */
55
OPAL_THREAD_LOCK(&orte_iof_base.iof_lock);
56
while((item = opal_list_remove_first(&orte_iof_base.iof_endpoints)) != NULL) {
59
OPAL_THREAD_UNLOCK(&orte_iof_base.iof_lock);
61
if (NULL != orte_iof_base.iof_service) {
62
orte_ns.free_name(&(orte_iof_base.iof_service));