root/ompi/mpi/cxx/mpicxx.cc

/* [<][>][^][v][top][bottom][index][help] */
   1 // -*- c++ -*-
   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-2005 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) 2007-2012 Cisco Systems, Inc.  All rights reserved.
  14 // Copyright (c) 2007      Sun Microsystems, Inc.  All rights reserved.
  15 // Copyright (c) 2011      FUJITSU LIMITED.  All rights reserved.
  16 // Copyright (c) 2017      Research Organization for Information Science
  17 //                         and Technology (RIST). All rights reserved.
  18 // $COPYRIGHT$
  19 //
  20 // Additional copyrights may follow
  21 //
  22 // $HEADER$
  23 
  24 #include "mpicxx.h"
  25 
  26 /* Need to include ompi_config.h after mpicxx.h so that we get
  27    SEEK_SET and friends right */
  28 #include "ompi_config.h"
  29 
  30 #include "cxx_glue.h"
  31 
  32 #if OPAL_CXX_USE_PRAGMA_IDENT
  33 #pragma ident OMPI_IDENT_STRING
  34 #elif OPAL_CXX_USE_IDENT
  35 #ident OMPI_IDENT_STRING
  36 #endif
  37 namespace MPI {
  38     const char ompi_libcxx_version_string[] = OMPI_IDENT_STRING;
  39 }
  40 
  41 namespace MPI {
  42 
  43 #if ! OMPI_HAVE_CXX_EXCEPTION_SUPPORT
  44 int mpi_errno = MPI_SUCCESS;
  45 #endif
  46 
  47 
  48 void* const BOTTOM = (void*) MPI_BOTTOM;
  49 void* const IN_PLACE = (void*) MPI_IN_PLACE;
  50 
  51 // error-handling specifiers
  52 const Errhandler  ERRORS_ARE_FATAL((MPI_Errhandler)&(ompi_mpi_errors_are_fatal));
  53 const Errhandler  ERRORS_RETURN((MPI_Errhandler)&(ompi_mpi_errors_return));
  54 const Errhandler  ERRORS_THROW_EXCEPTIONS((MPI_Errhandler)&(ompi_mpi_errors_throw_exceptions));
  55 
  56 // elementary datatypes
  57 const Datatype CHAR(MPI_CHAR);
  58 const Datatype SHORT(MPI_SHORT);
  59 const Datatype INT(MPI_INT);
  60 const Datatype LONG(MPI_LONG);
  61 const Datatype SIGNED_CHAR(MPI_SIGNED_CHAR);
  62 const Datatype UNSIGNED_CHAR(MPI_UNSIGNED_CHAR);
  63 const Datatype UNSIGNED_SHORT(MPI_UNSIGNED_SHORT);
  64 const Datatype UNSIGNED(MPI_UNSIGNED);
  65 const Datatype UNSIGNED_LONG(MPI_UNSIGNED_LONG);
  66 const Datatype FLOAT(MPI_FLOAT);
  67 const Datatype DOUBLE(MPI_DOUBLE);
  68 const Datatype LONG_DOUBLE(MPI_LONG_DOUBLE);
  69 const Datatype BYTE(MPI_BYTE);
  70 const Datatype PACKED(MPI_PACKED);
  71 const Datatype WCHAR(MPI_WCHAR);
  72 
  73 // datatypes for reductions functions (C / C++)
  74 const Datatype FLOAT_INT(MPI_FLOAT_INT);
  75 const Datatype DOUBLE_INT(MPI_DOUBLE_INT);
  76 const Datatype LONG_INT(MPI_LONG_INT);
  77 const Datatype TWOINT(MPI_2INT);
  78 const Datatype SHORT_INT(MPI_SHORT_INT);
  79 const Datatype LONG_DOUBLE_INT(MPI_LONG_DOUBLE_INT);
  80 
  81 #if OMPI_BUILD_FORTRAN_BINDINGS
  82 // elementary datatype (Fortran)
  83 const Datatype REAL((MPI_Datatype)&(ompi_mpi_real));
  84 const Datatype INTEGER((MPI_Datatype)&(ompi_mpi_integer));
  85 const Datatype DOUBLE_PRECISION((MPI_Datatype)&(ompi_mpi_dblprec));
  86 const Datatype F_COMPLEX((MPI_Datatype)&(ompi_mpi_cplex));
  87 const Datatype LOGICAL((MPI_Datatype)&(ompi_mpi_logical));
  88 const Datatype CHARACTER((MPI_Datatype)&(ompi_mpi_character));
  89 
  90 // datatype for reduction functions (Fortran)
  91 const Datatype TWOREAL((MPI_Datatype)&(ompi_mpi_2real));
  92 const Datatype TWODOUBLE_PRECISION((MPI_Datatype)&(ompi_mpi_2dblprec));
  93 const Datatype TWOINTEGER((MPI_Datatype)&(ompi_mpi_2integer));
  94 
  95 // optional datatypes (Fortran)
  96 const Datatype INTEGER2((MPI_Datatype)&(ompi_mpi_integer));
  97 const Datatype REAL2((MPI_Datatype)&(ompi_mpi_real));
  98 const Datatype INTEGER1((MPI_Datatype)&(ompi_mpi_char));
  99 const Datatype INTEGER4((MPI_Datatype)&(ompi_mpi_short));
 100 const Datatype REAL4((MPI_Datatype)&(ompi_mpi_real));
 101 const Datatype REAL8((MPI_Datatype)&(ompi_mpi_double));
 102 
 103 #endif // OMPI_WANT_f77_BINDINGS
 104 
 105 // optional datatype (C / C++)
 106 const Datatype UNSIGNED_LONG_LONG(MPI_UNSIGNED_LONG_LONG);
 107 const Datatype LONG_LONG(MPI_LONG_LONG);
 108 const Datatype LONG_LONG_INT(MPI_LONG_LONG_INT);
 109 
 110 // c++ types
 111 const Datatype BOOL((MPI_Datatype)&(ompi_mpi_cxx_bool));
 112 const Datatype COMPLEX((MPI_Datatype)&(ompi_mpi_cxx_cplex));
 113 const Datatype DOUBLE_COMPLEX((MPI_Datatype)&(ompi_mpi_cxx_dblcplex));
 114 const Datatype F_DOUBLE_COMPLEX((MPI_Datatype)&(ompi_mpi_cxx_dblcplex));
 115 const Datatype LONG_DOUBLE_COMPLEX((MPI_Datatype)&(ompi_mpi_cxx_ldblcplex));
 116 
 117 // reserved communicators
 118 Intracomm COMM_WORLD(MPI_COMM_WORLD);
 119 Intracomm COMM_SELF(MPI_COMM_SELF);
 120 
 121 // Reported by Paul Hargrove: MIN and MAX are defined on OpenBSD, so
 122 // we need to #undef them.  See
 123 // http://www.open-mpi.org/community/lists/devel/2013/12/13521.php.
 124 #ifdef MAX
 125 #undef MAX
 126 #endif
 127 #ifdef MIN
 128 #undef MIN
 129 #endif
 130 
 131 // collective operations
 132 const Op MAX(MPI_MAX);
 133 const Op MIN(MPI_MIN);
 134 const Op SUM(MPI_SUM);
 135 const Op PROD(MPI_PROD);
 136 const Op MAXLOC(MPI_MAXLOC);
 137 const Op MINLOC(MPI_MINLOC);
 138 const Op BAND(MPI_BAND);
 139 const Op BOR(MPI_BOR);
 140 const Op BXOR(MPI_BXOR);
 141 const Op LAND(MPI_LAND);
 142 const Op LOR(MPI_LOR);
 143 const Op LXOR(MPI_LXOR);
 144 const Op REPLACE(MPI_REPLACE);
 145 
 146 // null handles
 147 const Group        GROUP_NULL = MPI_GROUP_NULL;
 148 const Win          WIN_NULL = MPI_WIN_NULL;
 149 const Info         INFO_NULL = MPI_INFO_NULL;
 150 //const Comm         COMM_NULL = MPI_COMM_NULL;
 151 //const MPI_Comm          COMM_NULL = MPI_COMM_NULL;
 152 Comm_Null    COMM_NULL;
 153 const Datatype     DATATYPE_NULL = MPI_DATATYPE_NULL;
 154 Request      REQUEST_NULL = MPI_REQUEST_NULL;
 155 const Op           OP_NULL = MPI_OP_NULL;
 156 const Errhandler   ERRHANDLER_NULL;
 157 const File FILE_NULL = MPI_FILE_NULL;
 158 
 159 // constants specifying empty or ignored input
 160 const char**       ARGV_NULL = (const char**) MPI_ARGV_NULL;
 161 const char***      ARGVS_NULL = (const char***) MPI_ARGVS_NULL;
 162 
 163 // empty group
 164 const Group GROUP_EMPTY(MPI_GROUP_EMPTY);
 165 
 166 } /* namespace MPI */

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