1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */ 2 /* 3 * Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana 4 * University Research and Technology 5 * Corporation. All rights reserved. 6 * Copyright (c) 2004-2011 The University of Tennessee and The University 7 * of Tennessee Research Foundation. All rights 8 * reserved. 9 * Copyright (c) 2004-2005 High Performance Computing Center Stuttgart, 10 * University of Stuttgart. All rights reserved. 11 * Copyright (c) 2004-2005 The Regents of the University of California. 12 * All rights reserved. 13 * Copyright (c) 2008-2011 University of Houston. All rights reserved. 14 * Copyright (c) 2015 Los Alamos National Security, LLC. All rights 15 * reserved. 16 * $COPYRIGHT$ 17 * 18 * Additional copyrights may follow 19 * 20 * $HEADER$ 21 */ 22 23 24 #include "ompi_config.h" 25 #include <stdio.h> 26 27 #include "ompi/mca/mca.h" 28 #include "opal/mca/base/base.h" 29 30 #include "ompi/mca/fcoll/fcoll.h" 31 #include "ompi/mca/fcoll/base/base.h" 32 33 /* 34 * The following file was created by configure. It contains extern 35 * statements and the definition of an array of pointers to each 36 * component's public mca_base_component_t struct. 37 */ 38 #include "ompi/mca/fcoll/base/static-components.h" 39 40 /* 41 * Global variables; most of which are loaded by back-ends of MCA 42 * variables 43 */ 44 45 MCA_BASE_FRAMEWORK_DECLARE(ompi, fcoll, NULL, NULL, NULL, NULL, 46 mca_fcoll_base_static_components, 0); 47 48 /** 49 * Traverses through the list of available components, calling their init 50 * functions until it finds the component that has the specified name. It 51 * then returns the found component. 52 * 53 * @param name the name of the component that is being searched for. 54 * @retval mca_fcoll_base_component_t* pointer to the requested component 55 * @retval NULL if the requested component is not found 56 */ 57 mca_fcoll_base_component_t* mca_fcoll_base_component_lookup(const char* name) 58 { 59 /* Traverse the list of available components; call their init functions. */ 60 mca_base_component_list_item_t *cli; 61 OPAL_LIST_FOREACH(cli, &ompi_fcoll_base_framework.framework_components, mca_base_component_list_item_t) { 62 mca_fcoll_base_component_t* component = (mca_fcoll_base_component_t *) cli->cli_component; 63 if(strcmp(component->fcollm_version.mca_component_name, 64 name) == 0) { 65 return component; 66 } 67 } 68 return NULL; 69 } 70