root/opal/mca/mpool/base/mpool_base_lookup.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. mca_mpool_base_component_lookup
  2. mca_mpool_base_module_lookup

   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-2013 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) 2006-2007 Mellanox Technologies. All rights reserved.
  14  * Copyright (c) 2008-2014 Cisco Systems, Inc.  All rights reserved.
  15  * Copyright (c) 2012-2016 Los Alamos National Security, LLC.  All rights reserved.
  16  * $COPYRIGHT$
  17  *
  18  * Additional copyrights may follow
  19  *
  20  * $HEADER$
  21  */
  22 
  23 #define OPAL_DISABLE_ENABLE_MEM_DEBUG 1
  24 #include "opal_config.h"
  25 
  26 #include <stdio.h>
  27 #include <string.h>
  28 
  29 #include "opal/mca/mca.h"
  30 #include "opal/mca/base/base.h"
  31 #include "opal/util/show_help.h"
  32 #include "opal/util/proc.h"
  33 
  34 #include "opal/mca/mpool/mpool.h"
  35 #include "opal/mca/mpool/base/base.h"
  36 
  37 mca_mpool_base_component_t* mca_mpool_base_component_lookup(const char *name)
  38 {
  39     mca_base_component_list_item_t *cli;
  40 
  41     /* Traverse the list of available modules; call their init functions. */
  42     OPAL_LIST_FOREACH(cli, &opal_mpool_base_framework.framework_components, mca_base_component_list_item_t) {
  43         mca_mpool_base_component_t* component = (mca_mpool_base_component_t *) cli->cli_component;
  44         if (strcmp(component->mpool_version.mca_component_name, name) == 0) {
  45             return component;
  46         }
  47     }
  48 
  49     return NULL;
  50 }
  51 
  52 
  53 
  54 mca_mpool_base_module_t *mca_mpool_base_module_lookup (const char *hints)
  55 {
  56     mca_mpool_base_module_t *best_module = mca_mpool_base_default_module;
  57     mca_base_component_list_item_t *cli;
  58     int best_priority = mca_mpool_base_default_priority;
  59     int rc;
  60 
  61     OPAL_LIST_FOREACH(cli, &opal_mpool_base_framework.framework_components, mca_base_component_list_item_t) {
  62         mca_mpool_base_component_t *component = (mca_mpool_base_component_t *) cli->cli_component;
  63         mca_mpool_base_module_t *module;
  64         int priority;
  65 
  66         rc = component->mpool_query (hints, &priority, &module);
  67         if (OPAL_SUCCESS == rc) {
  68             if (priority > best_priority) {
  69                 best_priority = priority;
  70                 best_module = module;
  71             }
  72         }
  73     }
  74 
  75     return best_module;
  76 }

/* [<][>][^][v][top][bottom][index][help] */