root/ompi/runtime/ompi_mpi_dynamics.c

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

DEFINITIONS

This source file includes following definitions.
  1. ompi_mpi_dynamics_disable
  2. ompi_mpi_dynamics_is_enabled
  3. ompi_mpi_dynamics_finalize

   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-2006 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-2015 Cisco Systems, Inc.  All rights reserved.
  14  * Copyright (c) 2007-2015 Los Alamos National Security, LLC.  All rights
  15  *                         reserved.
  16  * Copyright (c) 2013      NVIDIA Corporation.  All rights reserved.
  17  * Copyright (c) 2013-2014 Intel, Inc. All rights reserved
  18  * $COPYRIGHT$
  19  *
  20  * Additional copyrights may follow
  21  *
  22  * $HEADER$
  23  */
  24 
  25 #include "ompi_config.h"
  26 
  27 #include "opal/util/show_help.h"
  28 
  29 #include "ompi/runtime/params.h"
  30 #include "ompi/runtime/mpiruntime.h"
  31 
  32 static char *ompi_mpi_dynamics_disabled_msg = "Enabled";
  33 
  34 
  35 void ompi_mpi_dynamics_disable(const char *msg)
  36 {
  37     assert(msg);
  38 
  39     ompi_mpi_dynamics_enabled = false;
  40     ompi_mpi_dynamics_disabled_msg = strdup(msg);
  41 }
  42 
  43 bool ompi_mpi_dynamics_is_enabled(const char *function)
  44 {
  45     if (ompi_mpi_dynamics_enabled) {
  46         return true;
  47     }
  48 
  49     opal_show_help("help-mpi-api.txt",
  50                    "MPI function not supported",
  51                    true,
  52                    function,
  53                    ompi_mpi_dynamics_disabled_msg);
  54     return false;
  55 }
  56 
  57 void ompi_mpi_dynamics_finalize(void)
  58 {
  59     // If dynamics were disabled, then we have a message to free
  60     if (!ompi_mpi_dynamics_enabled) {
  61         free(ompi_mpi_dynamics_disabled_msg);
  62         ompi_mpi_dynamics_disabled_msg = NULL;
  63     }
  64 }

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