root/ompi/mpi/tool/pvar_start.c

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

DEFINITIONS

This source file includes following definitions.
  1. pvar_handle_start
  2. MPI_T_pvar_start

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c) 2012-2013 Los Alamos National Security, LLC. All rights
   4  *                         reserved.
   5  * Copyright (c) 2014 Cisco Systems, Inc.  All rights reserved.
   6  * Copyright (c) 2017      IBM Corporation. All rights reserved.
   7  * $COPYRIGHT$
   8  *
   9  * Additional copyrights may follow
  10  *
  11  * $HEADER$
  12  */
  13 
  14 #include "ompi/mpi/tool/mpit-internal.h"
  15 
  16 #if OPAL_HAVE_WEAK_SYMBOLS && OMPI_PROFILING_DEFINES
  17 #pragma weak MPI_T_pvar_start = PMPI_T_pvar_start
  18 #endif
  19 
  20 #if OMPI_PROFILING_DEFINES
  21 #include "ompi/mpi/tool/profile/defines.h"
  22 #endif
  23 
  24 
  25 static int pvar_handle_start (mca_base_pvar_handle_t *handle)
  26 {
  27     if (OPAL_SUCCESS != mca_base_pvar_handle_start (handle)) {
  28         return MPI_T_ERR_PVAR_NO_STARTSTOP;
  29     }
  30 
  31     return MPI_SUCCESS;
  32 }
  33 
  34 int MPI_T_pvar_start(MPI_T_pvar_session session, MPI_T_pvar_handle handle)
  35 {
  36     int ret = MPI_SUCCESS;
  37 
  38     if (!mpit_is_initialized ()) {
  39         return MPI_T_ERR_NOT_INITIALIZED;
  40     }
  41 
  42     ompi_mpit_lock ();
  43 
  44     if (MPI_T_PVAR_ALL_HANDLES == handle) {
  45         OPAL_LIST_FOREACH(handle, &session->handles, mca_base_pvar_handle_t) {
  46             /* Per MPI 3.0: ignore continuous and started variables when starting
  47                all variable handles. */
  48             if (!mca_base_pvar_handle_is_running (handle) &&
  49                 OMPI_SUCCESS != pvar_handle_start (handle)) {
  50                 ret = MPI_T_ERR_PVAR_NO_STARTSTOP;
  51             }
  52         }
  53     } else {
  54         ret = pvar_handle_start (handle);
  55     }
  56 
  57     ompi_mpit_unlock ();
  58 
  59     return ompit_opal_to_mpit_error (ret);
  60 }

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