root/ompi/mpi/cxx/mpicxx.h

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

INCLUDED FROM


   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) 2006-2008 Cisco Systems, Inc.  All rights reserved.
  14 // Copyright (c) 2008      Sun Microsystems, Inc.  All rights reserved.
  15 // Copyright (c) 2011      FUJITSU LIMITED.  All rights reserved.
  16 // Copyright (c) 2016      Los Alamos National Security, LLC. All rights
  17 //                         reserved.
  18 // Copyright (c) 2017      Research Organization for Information Science
  19 //                         and Technology (RIST). All rights reserved.
  20 // $COPYRIGHT$
  21 //
  22 // Additional copyrights may follow
  23 //
  24 // $HEADER$
  25 //
  26 
  27 #ifndef MPIPP_H
  28 #define MPIPP_H
  29 
  30 //
  31 // Let's ensure that we're really in C++, and some errant programmer
  32 // hasn't included <mpicxx.h> just "for completeness"
  33 //
  34 
  35 // We do not include the opal_config.h and may not replace extern "C" {
  36 #if defined(c_plusplus) || defined(__cplusplus)
  37 
  38 // do not include ompi_config.h.  it will smash free() as a symbol
  39 #include "mpi.h"
  40 
  41 // we include all this here so that we escape the silly namespacing issues
  42 #include <map>
  43 #include <utility>
  44 
  45 #include <stdarg.h>
  46 
  47 #if !defined(OMPI_IGNORE_CXX_SEEK) && OMPI_WANT_MPI_CXX_SEEK
  48 // We need to include the header files that define SEEK_* or use them
  49 // in ways that require them to be #defines so that if the user
  50 // includes them later, the double inclusion logic in the headers will
  51 // prevent trouble from occuring.
  52 
  53 // include so that we can smash SEEK_* properly
  54 #include <stdio.h>
  55 // include because on Linux, there is one place that assumes SEEK_* is
  56 // a #define (it's used in an enum).
  57 #include <iostream>
  58 
  59 static const int ompi_stdio_seek_set = SEEK_SET;
  60 static const int ompi_stdio_seek_cur = SEEK_CUR;
  61 static const int ompi_stdio_seek_end = SEEK_END;
  62 
  63 // smash SEEK_* #defines
  64 #ifdef SEEK_SET
  65 #undef SEEK_SET
  66 #undef SEEK_CUR
  67 #undef SEEK_END
  68 #endif
  69 
  70 // make globally scoped constants to replace smashed #defines
  71 static const int SEEK_SET = ompi_stdio_seek_set;
  72 static const int SEEK_CUR = ompi_stdio_seek_cur;
  73 static const int SEEK_END = ompi_stdio_seek_end;
  74 #endif
  75 
  76 #ifdef OPAL_HAVE_SYS_SYNCH_H
  77 // Solaris threads.h pulls in sys/synch.h which in certain versions
  78 // defines LOCK_SHARED.
  79 
  80 // include so that we can smash LOCK_SHARED
  81 #include <sys/synch.h>
  82 
  83 // a user app may be included on a system with an older version
  84 // sys/synch.h
  85 #ifdef LOCK_SHARED
  86 static const int ompi_synch_lock_shared = LOCK_SHARED;
  87 
  88 // smash LOCK_SHARED #defines
  89 #undef LOCK_SHARED
  90 
  91 // make globally scoped constants to replace smashed #defines
  92 static const int LOCK_SHARED = ompi_synch_lock_shared;
  93 #endif
  94 #endif
  95 
  96 // forward declare so that we can still do inlining
  97 struct opal_mutex_t;
  98 
  99 // See lengthy explanation in intercepts.cc about this function.
 100 extern "C" void
 101 ompi_mpi_cxx_op_intercept(void *invec, void *outvec, int *len,
 102                           MPI_Datatype *datatype, MPI_User_function *fn);
 103 
 104 //used for attr intercept functions
 105 enum CommType { eIntracomm, eIntercomm, eCartcomm, eGraphcomm};
 106 
 107 extern "C" int
 108 ompi_mpi_cxx_comm_copy_attr_intercept(MPI_Comm oldcomm, int keyval,
 109                                       void *extra_state, void *attribute_val_in,
 110                                       void *attribute_val_out, int *flag,
 111                                       MPI_Comm newcomm);
 112 extern "C" int
 113 ompi_mpi_cxx_comm_delete_attr_intercept(MPI_Comm comm, int keyval,
 114                                         void *attribute_val, void *extra_state);
 115 
 116 extern "C" int
 117 ompi_mpi_cxx_type_copy_attr_intercept(MPI_Datatype oldtype, int keyval,
 118                                       void *extra_state, void *attribute_val_in,
 119                                       void *attribute_val_out, int *flag);
 120 extern "C" int
 121 ompi_mpi_cxx_type_delete_attr_intercept(MPI_Datatype type, int keyval,
 122                                         void *attribute_val, void *extra_state);
 123 
 124 extern "C" int
 125 ompi_mpi_cxx_win_copy_attr_intercept(MPI_Win oldwin, int keyval,
 126                                       void *extra_state, void *attribute_val_in,
 127                                       void *attribute_val_out, int *flag);
 128 extern "C" int
 129 ompi_mpi_cxx_win_delete_attr_intercept(MPI_Win win, int keyval,
 130                                         void *attribute_val, void *extra_state);
 131 
 132 
 133 
 134 //
 135 // MPI generalized request intercepts
 136 //
 137 
 138 extern "C" int
 139 ompi_mpi_cxx_grequest_query_fn_intercept(void *state, MPI_Status *status);
 140 extern "C" int
 141 ompi_mpi_cxx_grequest_free_fn_intercept(void *state);
 142 extern "C" int
 143 ompi_mpi_cxx_grequest_cancel_fn_intercept(void *state, int canceled);
 144 
 145 /**
 146  * Windows bool type is not any kind of integer. Special care should
 147  * be taken in order to cast it correctly.
 148  */
 149 #if defined(WIN32) || defined(_WIN32) || defined(WIN64)
 150 #define OPAL_INT_TO_BOOL(VALUE)  ((VALUE) != 0 ? true : false)
 151 #else
 152 #define OPAL_INT_TO_BOOL(VALUE)  ((bool)(VALUE))
 153 #endif  /* defined(WIN32) || defined(_WIN32) || defined(WIN64) */
 154 
 155 #if 0 /* OMPI_ENABLE_MPI_PROFILING */
 156 #include "ompi/mpi/cxx/pmpicxx.h"
 157 #endif
 158 
 159 namespace MPI {
 160 
 161 #if ! OMPI_HAVE_CXX_EXCEPTION_SUPPORT
 162         extern int mpi_errno;
 163 #endif
 164 
 165   class Comm_Null;
 166   class Comm;
 167   class Intracomm;
 168   class Intercomm;
 169   class Graphcomm;
 170   class Cartcomm;
 171   class Datatype;
 172   class Errhandler;
 173   class Group;
 174   class Op;
 175   class Request;
 176   class Grequest;
 177   class Status;
 178   class Info;
 179   class Win;
 180   class File;
 181 
 182   typedef MPI_Aint Aint;
 183   typedef MPI_Fint Fint;
 184   typedef MPI_Offset Offset;
 185 
 186 #ifdef OMPI_BUILDING_CXX_BINDINGS_LIBRARY
 187 #include "ompi/mpi/cxx/constants.h"
 188 #include "ompi/mpi/cxx/functions.h"
 189 #include "ompi/mpi/cxx/datatype.h"
 190 #else
 191 #include "openmpi/ompi/mpi/cxx/constants.h"
 192 #include "openmpi/ompi/mpi/cxx/functions.h"
 193 #include "openmpi/ompi/mpi/cxx/datatype.h"
 194 #endif
 195 
 196   typedef void User_function(const void* invec, void* inoutvec, int len,
 197                              const Datatype& datatype);
 198 
 199     /* Prevent needing a -I${prefix}/include/openmpi, as it seems to
 200        really annoy peope that don't use the wrapper compilers and is
 201        no longer worth the fight of getting right... */
 202 #ifdef OMPI_BUILDING_CXX_BINDINGS_LIBRARY
 203 #include "ompi/mpi/cxx/exception.h"
 204 #include "ompi/mpi/cxx/op.h"
 205 #include "ompi/mpi/cxx/status.h"
 206 #include "ompi/mpi/cxx/request.h"   //includes class Prequest
 207 #include "ompi/mpi/cxx/group.h"
 208 #include "ompi/mpi/cxx/comm.h"
 209 #include "ompi/mpi/cxx/win.h"
 210 #include "ompi/mpi/cxx/file.h"
 211 #include "ompi/mpi/cxx/errhandler.h"
 212 #include "ompi/mpi/cxx/intracomm.h"
 213 #include "ompi/mpi/cxx/topology.h"  //includes Cartcomm and Graphcomm
 214 #include "ompi/mpi/cxx/intercomm.h"
 215 #include "ompi/mpi/cxx/info.h"
 216 #else
 217 #include "openmpi/ompi/mpi/cxx/exception.h"
 218 #include "openmpi/ompi/mpi/cxx/op.h"
 219 #include "openmpi/ompi/mpi/cxx/status.h"
 220 #include "openmpi/ompi/mpi/cxx/request.h"   //includes class Prequest
 221 #include "openmpi/ompi/mpi/cxx/group.h"
 222 #include "openmpi/ompi/mpi/cxx/comm.h"
 223 #include "openmpi/ompi/mpi/cxx/win.h"
 224 #include "openmpi/ompi/mpi/cxx/file.h"
 225 #include "openmpi/ompi/mpi/cxx/errhandler.h"
 226 #include "openmpi/ompi/mpi/cxx/intracomm.h"
 227 #include "openmpi/ompi/mpi/cxx/topology.h"  //includes Cartcomm and Graphcomm
 228 #include "openmpi/ompi/mpi/cxx/intercomm.h"
 229 #include "openmpi/ompi/mpi/cxx/info.h"
 230 #endif
 231 
 232     // Version string
 233     extern const char ompi_libcxx_version_string[];
 234 }
 235 
 236 #if 0 /* OMPI_ENABLE_MPI_PROFILING */
 237 #include "ompi/mpi/cxx/pop_inln.h"
 238 #include "ompi/mpi/cxx/pgroup_inln.h"
 239 #include "ompi/mpi/cxx/pstatus_inln.h"
 240 #include "ompi/mpi/cxx/prequest_inln.h"
 241 #endif
 242 
 243 //
 244 // These are the "real" functions, whether prototyping is enabled
 245 // or not. These functions are assigned to either the MPI::XXX class
 246 // or the PMPI::XXX class based on the value of the macro MPI
 247 // which is set in mpi2cxx_config.h.
 248 // If prototyping is enabled, there is a top layer that calls these
 249 // PMPI functions, and this top layer is in the XXX.cc files.
 250 //
 251 
 252 /* see note above... */
 253 #ifdef OMPI_BUILDING_CXX_BINDINGS_LIBRARY
 254 #include "ompi/mpi/cxx/datatype_inln.h"
 255 #include "ompi/mpi/cxx/functions_inln.h"
 256 #include "ompi/mpi/cxx/request_inln.h"
 257 #include "ompi/mpi/cxx/comm_inln.h"
 258 #include "ompi/mpi/cxx/intracomm_inln.h"
 259 #include "ompi/mpi/cxx/topology_inln.h"
 260 #include "ompi/mpi/cxx/intercomm_inln.h"
 261 #include "ompi/mpi/cxx/group_inln.h"
 262 #include "ompi/mpi/cxx/op_inln.h"
 263 #include "ompi/mpi/cxx/errhandler_inln.h"
 264 #include "ompi/mpi/cxx/status_inln.h"
 265 #include "ompi/mpi/cxx/info_inln.h"
 266 #include "ompi/mpi/cxx/win_inln.h"
 267 #include "ompi/mpi/cxx/file_inln.h"
 268 #else
 269 #include "openmpi/ompi/mpi/cxx/datatype_inln.h"
 270 #include "openmpi/ompi/mpi/cxx/functions_inln.h"
 271 #include "openmpi/ompi/mpi/cxx/request_inln.h"
 272 #include "openmpi/ompi/mpi/cxx/comm_inln.h"
 273 #include "openmpi/ompi/mpi/cxx/intracomm_inln.h"
 274 #include "openmpi/ompi/mpi/cxx/topology_inln.h"
 275 #include "openmpi/ompi/mpi/cxx/intercomm_inln.h"
 276 #include "openmpi/ompi/mpi/cxx/group_inln.h"
 277 #include "openmpi/ompi/mpi/cxx/op_inln.h"
 278 #include "openmpi/ompi/mpi/cxx/errhandler_inln.h"
 279 #include "openmpi/ompi/mpi/cxx/status_inln.h"
 280 #include "openmpi/ompi/mpi/cxx/info_inln.h"
 281 #include "openmpi/ompi/mpi/cxx/win_inln.h"
 282 #include "openmpi/ompi/mpi/cxx/file_inln.h"
 283 #endif
 284 
 285 #endif // #if defined(c_plusplus) || defined(__cplusplus)
 286 #endif // #ifndef MPIPP_H_

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