root/ompi/mpi/tool/pvar_reset.c

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

DEFINITIONS

This source file includes following definitions.
  1. MPI_T_pvar_reset

   1 /* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil -*- */
   2 /*
   3  * Copyright (c) 2012-2015 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_reset = PMPI_T_pvar_reset
  18 #endif
  19 
  20 #if OMPI_PROFILING_DEFINES
  21 #include "ompi/mpi/tool/profile/defines.h"
  22 #endif
  23 
  24 
  25 int MPI_T_pvar_reset(MPI_T_pvar_session session, MPI_T_pvar_handle handle)
  26 {
  27     int ret = MPI_SUCCESS;
  28 
  29     if (!mpit_is_initialized ()) {
  30         return MPI_T_ERR_NOT_INITIALIZED;
  31     }
  32 
  33     ompi_mpit_lock ();
  34 
  35     if (MPI_T_PVAR_ALL_HANDLES == handle) {
  36         OPAL_LIST_FOREACH(handle, &session->handles, mca_base_pvar_handle_t) {
  37             /* Per MPI 3.0: ignore read-only variables when resetting all
  38                handles. */
  39             if (!mca_base_pvar_is_readonly (handle->pvar) &&
  40                 MPI_SUCCESS != mca_base_pvar_handle_reset (handle)) {
  41                 ret = MPI_T_ERR_PVAR_NO_WRITE;
  42             }
  43         }
  44     } else {
  45         ret = mca_base_pvar_handle_reset (handle);
  46     }
  47 
  48     ompi_mpit_unlock ();
  49 
  50     return ompit_opal_to_mpit_error (ret);
  51 }

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