root/opal/mca/pmix/pmix4x/pmix/src/mca/psensor/base/psensor_base_stubs.c

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

DEFINITIONS

This source file includes following definitions.
  1. pmix_psensor_base_start
  2. pmix_psensor_base_stop

   1 /*
   2  * Copyright (c) 2010      Cisco Systems, Inc.  All rights reserved.
   3  * Copyright (c) 2012      Los Alamos National Security, Inc. All rights reserved.
   4  * Copyright (c) 2014-2018 Intel, Inc.  All rights reserved.
   5  *
   6  * $COPYRIGHT$
   7  *
   8  * Additional copyrights may follow
   9  *
  10  * $HEADER$
  11  */
  12 
  13 
  14 #include <src/include/pmix_config.h>
  15 #include <pmix_common.h>
  16 
  17 #include "src/util/error.h"
  18 
  19 #include "src/mca/psensor/base/base.h"
  20 
  21 pmix_status_t pmix_psensor_base_start(pmix_peer_t *requestor, pmix_status_t error,
  22                                       const pmix_info_t *monitor,
  23                                       const pmix_info_t directives[], size_t ndirs)
  24 {
  25     pmix_psensor_active_module_t *mod;
  26     pmix_status_t rc;
  27     bool didit = false;
  28 
  29     pmix_output_verbose(5, pmix_psensor_base_framework.framework_output,
  30                         "%s:%d sensor:base: starting sensors",
  31                         pmix_globals.myid.nspace, pmix_globals.myid.rank);
  32 
  33     /* call the start function of all modules in priority order */
  34     PMIX_LIST_FOREACH(mod, &pmix_psensor_base.actives, pmix_psensor_active_module_t) {
  35         if (NULL != mod->module->start) {
  36             rc = mod->module->start(requestor, error, monitor, directives, ndirs);
  37             if (PMIX_SUCCESS != rc && PMIX_ERR_TAKE_NEXT_OPTION != rc) {
  38                 return rc;
  39             }
  40             didit = true;
  41         }
  42     }
  43 
  44     /* if none of the components could do it, then report
  45      * not supported upwards so the server knows to ask
  46      * the host to try */
  47     if (!didit) {
  48         return PMIX_ERR_NOT_SUPPORTED;
  49     }
  50 
  51     return PMIX_SUCCESS;
  52 }
  53 
  54 pmix_status_t pmix_psensor_base_stop(pmix_peer_t *requestor,
  55                                      char *id)
  56 {
  57     pmix_psensor_active_module_t *mod;
  58     pmix_status_t rc, ret = PMIX_SUCCESS;
  59 
  60     pmix_output_verbose(5, pmix_psensor_base_framework.framework_output,
  61                         "%s:%d sensor:base: stopping sensors",
  62                         pmix_globals.myid.nspace, pmix_globals.myid.rank);
  63 
  64     /* call the stop function of all modules in priority order */
  65     PMIX_LIST_FOREACH(mod, &pmix_psensor_base.actives, pmix_psensor_active_module_t) {
  66         if (NULL != mod->module->stop) {
  67             rc = mod->module->stop(requestor, id);
  68             if (PMIX_SUCCESS != rc && PMIX_ERR_TAKE_NEXT_OPTION != rc) {
  69                 if (PMIX_SUCCESS == ret) {
  70                     ret = rc;
  71                 }
  72                 /* need to continue to ensure that all
  73                  * sensors have been stopped */
  74             }
  75         }
  76     }
  77 
  78     return ret;
  79 }

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