root/ompi/mca/topo/base/topo_base_lazy_init.c

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

DEFINITIONS

This source file includes following definitions.
  1. mca_topo_base_lazy_init

   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-2015 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) 2009      Cisco Systems, Inc.  All rights reserved.
  14  * Copyright (c) 2012-2015 Inria.  All rights reserved.
  15  * Copyright (c) 2015      Los Alamos National Security, LLC. All rights
  16  *                         reserved.
  17  * $COPYRIGHT$
  18  *
  19  * Additional copyrights may follow
  20  *
  21  * $HEADER$
  22  */
  23 
  24 #include "ompi_config.h"
  25 
  26 #include <stdio.h>
  27 
  28 #include "ompi/constants.h"
  29 #include "ompi/mca/topo/base/base.h"
  30 
  31 
  32 /* This function is invoked by the top-level MPI API functions to
  33    lazily load the topo framework components (if it wasn't already --
  34    it's safe to invoke this function multiple times).  We do this
  35    because most MPI apps don't use MPI topology functions, so we might
  36    as well not load them unless we have to. */
  37 int mca_topo_base_lazy_init(void)
  38 {
  39     int err;
  40 
  41     if (!mca_base_framework_is_open (&ompi_topo_base_framework)) {
  42         /**
  43          * Register and open all available components, giving them a chance to access the MCA parameters.
  44          */
  45 
  46         err = mca_base_framework_open (&ompi_topo_base_framework, MCA_BASE_OPEN_DEFAULT);
  47         if (OMPI_SUCCESS != err) {
  48             return err;
  49         }
  50 
  51         if (OMPI_SUCCESS !=
  52             (err = mca_topo_base_find_available(OPAL_ENABLE_PROGRESS_THREADS, 1))) {
  53             return err;
  54         }
  55     }
  56 
  57     return OMPI_SUCCESS;
  58 }
  59 

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