This source file includes following definitions.
- ompi_mpit_lock
- ompi_mpit_unlock
- ompit_var_type_to_datatype
- ompit_opal_to_mpit_error
   1 
   2 
   3 
   4 
   5 
   6 
   7 
   8 
   9 
  10 
  11 
  12 
  13 
  14 
  15 #include "ompi/mpi/tool/mpit-internal.h"
  16 
  17 opal_mutex_t ompi_mpit_big_lock = OPAL_MUTEX_STATIC_INIT;
  18 
  19 volatile uint32_t ompi_mpit_init_count = 0;
  20 
  21 void ompi_mpit_lock (void)
  22 {
  23     opal_mutex_lock (&ompi_mpit_big_lock);
  24 }
  25 
  26 void ompi_mpit_unlock (void)
  27 {
  28     opal_mutex_unlock (&ompi_mpit_big_lock);
  29 }
  30 
  31 static MPI_Datatype mca_to_mpi_datatypes[MCA_BASE_VAR_TYPE_MAX] = {
  32     [MCA_BASE_VAR_TYPE_INT] = MPI_INT,
  33     [MCA_BASE_VAR_TYPE_UNSIGNED_INT] = MPI_UNSIGNED,
  34     [MCA_BASE_VAR_TYPE_UNSIGNED_LONG] = MPI_UNSIGNED_LONG,
  35     [MCA_BASE_VAR_TYPE_UNSIGNED_LONG_LONG] = MPI_UNSIGNED_LONG_LONG,
  36 
  37 #if SIZEOF_SIZE_T == SIZEOF_UNSIGNED_INT
  38     [MCA_BASE_VAR_TYPE_SIZE_T] = MPI_UNSIGNED,
  39 #elif SIZEOF_SIZE_T == SIZEOF_UNSIGNED_LONG
  40     [MCA_BASE_VAR_TYPE_SIZE_T] = MPI_UNSIGNED_LONG,
  41 #elif SIZEOF_SIZE_T == SIZEOF_LONG_LONG
  42     [MCA_BASE_VAR_TYPE_SIZE_T] = MPI_UNSIGNED_LONG_LONG,
  43 #else
  44     [MCA_BASE_VAR_TYPE_SIZE_T] = NULL,
  45 #endif
  46 
  47     [MCA_BASE_VAR_TYPE_STRING] = MPI_CHAR,
  48     [MCA_BASE_VAR_TYPE_VERSION_STRING] = MPI_CHAR,
  49     [MCA_BASE_VAR_TYPE_BOOL] = MPI_C_BOOL,
  50     [MCA_BASE_VAR_TYPE_DOUBLE] = MPI_DOUBLE,
  51     [MCA_BASE_VAR_TYPE_LONG] = MPI_LONG,
  52     [MCA_BASE_VAR_TYPE_INT32_T] = MPI_INT32_T,
  53     [MCA_BASE_VAR_TYPE_UINT32_T] = MPI_UINT32_T,
  54     [MCA_BASE_VAR_TYPE_INT64_T] = MPI_INT64_T,
  55     [MCA_BASE_VAR_TYPE_UINT64_T] = MPI_UINT64_T,
  56 };
  57 
  58 int ompit_var_type_to_datatype (mca_base_var_type_t type, MPI_Datatype *datatype)
  59 {
  60     if (!datatype) {
  61         return OMPI_SUCCESS;
  62     }
  63 
  64     *datatype = mca_to_mpi_datatypes[type];
  65     assert (*datatype);
  66 
  67     return OMPI_SUCCESS;
  68 }
  69 
  70 int ompit_opal_to_mpit_error (int rc)
  71 {
  72     if (rc >= 0) {
  73         
  74         return rc;
  75     }
  76 
  77     switch (rc) {
  78     case OPAL_ERR_OUT_OF_RESOURCE:
  79         return MPI_T_ERR_MEMORY;
  80     case OPAL_ERR_VALUE_OUT_OF_BOUNDS:
  81     case OPAL_ERR_NOT_BOUND:
  82         return MPI_T_ERR_INVALID_HANDLE;
  83     default:
  84         return MPI_ERR_UNKNOWN;
  85     }
  86 }