|
| 1 | +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ |
1 | 2 | /* |
2 | 3 | * Copyright (c) 2004-2007 The Trustees of Indiana University and Indiana |
3 | 4 | * University Research and Technology |
|
11 | 12 | * All rights reserved. |
12 | 13 | * Copyright (c) 2015 Research Organization for Information Science |
13 | 14 | * and Technology (RIST). All rights reserved. |
| 15 | + * Copyright (c) 2016 Los Alamos National Security, LLC. All rights |
| 16 | + * reserved. |
14 | 17 | * $COPYRIGHT$ |
15 | 18 | * |
16 | 19 | * Additional copyrights may follow |
@@ -49,18 +52,18 @@ mca_bml_base_inited(void) |
49 | 52 |
|
50 | 53 | int mca_bml_base_init( bool enable_progress_threads, |
51 | 54 | bool enable_mpi_threads) { |
52 | | - opal_list_item_t *item = NULL; |
53 | 55 | mca_bml_base_component_t *component = NULL, *best_component = NULL; |
54 | 56 | mca_bml_base_module_t *module = NULL, *best_module = NULL; |
55 | 57 | int priority = 0, best_priority = -1; |
56 | 58 | mca_base_component_list_item_t *cli = NULL; |
57 | 59 |
|
| 60 | + if (init_called) { |
| 61 | + return OPAL_SUCCESS; |
| 62 | + } |
| 63 | + |
58 | 64 | init_called = true; |
59 | 65 |
|
60 | | - for (item = opal_list_get_first(&ompi_bml_base_framework.framework_components); |
61 | | - opal_list_get_end(&ompi_bml_base_framework.framework_components) != item; |
62 | | - item = opal_list_get_next(item)) { |
63 | | - cli = (mca_base_component_list_item_t*) item; |
| 66 | + OPAL_LIST_FOREACH(cli, &ompi_bml_base_framework.framework_components, mca_base_component_list_item_t) { |
64 | 67 | component = (mca_bml_base_component_t*) cli->cli_component; |
65 | 68 | if(NULL == component->bml_init) { |
66 | 69 | opal_output_verbose( 10, ompi_bml_base_framework.framework_output, |
|
0 commit comments