1 /* 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 7 * reserved. 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. 12 * $COPYRIGHT$ 13 * 14 * Additional copyrights may follow 15 * 16 * $HEADER$ 17 */ 18 19 20 #include "opal_config.h" 21 #include <stdio.h> 22 #include <string.h> 23 24 #include "opal/mca/mca.h" 25 #include "opal/mca/base/base.h" 26 #include "opal/mca/allocator/allocator.h" 27 #include "opal/mca/allocator/base/base.h" 28 29 /* 30 * The following file was created by configure. It contains extern 31 * statements and the definition of an array of pointers to each 32 * component's public mca_base_component_t struct. 33 */ 34 35 #include "opal/mca/allocator/base/static-components.h" 36 37 /* 38 * Global variables 39 */ 40 MCA_BASE_FRAMEWORK_DECLARE(opal, allocator, NULL, NULL, NULL, NULL, 41 mca_allocator_base_static_components, 0); 42 43 /** 44 * Traverses through the list of available components, calling their init 45 * functions until it finds the component that has the specified name. It 46 * then returns the found component. 47 * 48 * @param name the name of the component that is being searched for. 49 * @retval mca_allocator_base_component_t* pointer to the requested component 50 * @retval NULL if the requested component is not found 51 */ 52 mca_allocator_base_component_t* mca_allocator_component_lookup(const char* name) 53 { 54 /* Traverse the list of available components; call their init functions. */ 55 mca_base_component_list_item_t *cli; 56 OPAL_LIST_FOREACH(cli, &opal_allocator_base_framework.framework_components, mca_base_component_list_item_t) { 57 mca_allocator_base_component_t* component = (mca_allocator_base_component_t *) cli->cli_component; 58 if(strcmp(component->allocator_version.mca_component_name, 59 name) == 0) { 60 return component; 61 } 62 } 63 return NULL; 64 } 65 66