2004-07-14 18:11:03 +04:00
|
|
|
// -*- c++ -*-
|
|
|
|
//
|
2005-11-05 22:57:48 +03:00
|
|
|
// Copyright (c) 2004-2005 The Trustees of Indiana University and Indiana
|
|
|
|
// University Research and Technology
|
|
|
|
// Corporation. All rights reserved.
|
|
|
|
// Copyright (c) 2004-2005 The University of Tennessee and The University
|
|
|
|
// of Tennessee Research Foundation. All rights
|
|
|
|
// reserved.
|
2004-11-28 23:09:25 +03:00
|
|
|
// Copyright (c) 2004-2005 High Performance Computing Center Stuttgart,
|
|
|
|
// University of Stuttgart. All rights reserved.
|
2005-03-24 15:43:37 +03:00
|
|
|
// Copyright (c) 2004-2005 The Regents of the University of California.
|
|
|
|
// All rights reserved.
|
2009-01-22 02:02:51 +03:00
|
|
|
// Copyright (c) 2007-2009 Cisco Systems, Inc. All rights reserved.
|
2007-11-03 05:40:22 +03:00
|
|
|
// Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
|
2012-02-17 15:42:51 +04:00
|
|
|
// Copyright (c) 2011 FUJITSU LIMITED. All rights reserved.
|
2004-11-22 04:38:40 +03:00
|
|
|
// $COPYRIGHT$
|
|
|
|
//
|
|
|
|
// Additional copyrights may follow
|
|
|
|
//
|
2004-07-14 18:11:03 +04:00
|
|
|
// $HEADER$
|
|
|
|
|
|
|
|
#include "mpicxx.h"
|
|
|
|
|
2008-09-04 19:02:52 +04:00
|
|
|
/* Need to include ompi_config.h after mpicxx.h so that we get
|
|
|
|
SEEK_SET and friends right */
|
2006-12-31 02:41:42 +03:00
|
|
|
#include "ompi_config.h"
|
|
|
|
|
2009-05-07 01:41:59 +04:00
|
|
|
#if OPAL_CXX_USE_PRAGMA_IDENT
|
2007-11-03 05:40:22 +03:00
|
|
|
#pragma ident OMPI_IDENT_STRING
|
2009-05-07 01:41:59 +04:00
|
|
|
#elif OPAL_CXX_USE_IDENT
|
2007-11-03 05:40:22 +03:00
|
|
|
#ident OMPI_IDENT_STRING
|
|
|
|
#endif
|
2008-06-20 17:36:02 +04:00
|
|
|
namespace MPI {
|
|
|
|
const char ompi_libcxx_version_string[] = OMPI_IDENT_STRING;
|
|
|
|
}
|
2007-11-03 05:40:22 +03:00
|
|
|
|
2006-12-31 02:41:42 +03:00
|
|
|
#include "ompi/errhandler/errhandler.h"
|
|
|
|
|
2004-07-14 18:11:03 +04:00
|
|
|
namespace MPI {
|
|
|
|
|
|
|
|
#if ! OMPI_HAVE_CXX_EXCEPTION_SUPPORT
|
|
|
|
int mpi_errno = MPI_SUCCESS;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2008-03-18 00:42:27 +03:00
|
|
|
void* const BOTTOM = (void*) MPI_BOTTOM;
|
2008-08-26 21:36:08 +04:00
|
|
|
void* const IN_PLACE = (void*) MPI_IN_PLACE;
|
2004-07-14 18:11:03 +04:00
|
|
|
|
|
|
|
// error-handling specifiers
|
2009-02-24 20:17:33 +03:00
|
|
|
const Errhandler ERRORS_ARE_FATAL((MPI_Errhandler)&(ompi_mpi_errors_are_fatal));
|
|
|
|
const Errhandler ERRORS_RETURN((MPI_Errhandler)&(ompi_mpi_errors_return));
|
|
|
|
const Errhandler ERRORS_THROW_EXCEPTIONS((MPI_Errhandler)&(ompi_mpi_errors_throw_exceptions));
|
2004-07-14 18:11:03 +04:00
|
|
|
|
|
|
|
// elementary datatypes
|
|
|
|
const Datatype CHAR(MPI_CHAR);
|
|
|
|
const Datatype SHORT(MPI_SHORT);
|
|
|
|
const Datatype INT(MPI_INT);
|
|
|
|
const Datatype LONG(MPI_LONG);
|
2006-02-01 19:01:32 +03:00
|
|
|
const Datatype SIGNED_CHAR(MPI_SIGNED_CHAR);
|
2004-07-14 18:11:03 +04:00
|
|
|
const Datatype UNSIGNED_CHAR(MPI_UNSIGNED_CHAR);
|
|
|
|
const Datatype UNSIGNED_SHORT(MPI_UNSIGNED_SHORT);
|
|
|
|
const Datatype UNSIGNED(MPI_UNSIGNED);
|
|
|
|
const Datatype UNSIGNED_LONG(MPI_UNSIGNED_LONG);
|
|
|
|
const Datatype FLOAT(MPI_FLOAT);
|
|
|
|
const Datatype DOUBLE(MPI_DOUBLE);
|
|
|
|
const Datatype LONG_DOUBLE(MPI_LONG_DOUBLE);
|
|
|
|
const Datatype BYTE(MPI_BYTE);
|
|
|
|
const Datatype PACKED(MPI_PACKED);
|
|
|
|
const Datatype WCHAR(MPI_WCHAR);
|
|
|
|
|
|
|
|
// datatypes for reductions functions (C / C++)
|
|
|
|
const Datatype FLOAT_INT(MPI_FLOAT_INT);
|
|
|
|
const Datatype DOUBLE_INT(MPI_DOUBLE_INT);
|
|
|
|
const Datatype LONG_INT(MPI_LONG_INT);
|
|
|
|
const Datatype TWOINT(MPI_2INT);
|
|
|
|
const Datatype SHORT_INT(MPI_SHORT_INT);
|
|
|
|
const Datatype LONG_DOUBLE_INT(MPI_LONG_DOUBLE);
|
|
|
|
|
|
|
|
#if OMPI_WANT_F77_BINDINGS
|
|
|
|
// elementary datatype (Fortran)
|
2009-02-24 20:17:33 +03:00
|
|
|
const Datatype REAL((MPI_Datatype)&(ompi_mpi_real));
|
|
|
|
const Datatype INTEGER((MPI_Datatype)&(ompi_mpi_integer));
|
|
|
|
const Datatype DOUBLE_PRECISION((MPI_Datatype)&(ompi_mpi_dblprec));
|
|
|
|
const Datatype F_COMPLEX((MPI_Datatype)&(ompi_mpi_cplex));
|
- Split the datatype engine into two parts: an MPI specific part in
OMPI
and a language agnostic part in OPAL. The convertor is completely
moved into OPAL. This offers several benefits as described in RFC
http://www.open-mpi.org/community/lists/devel/2009/07/6387.php
namely:
- Fewer basic types (int* and float* types, boolean and wchar
- Fixing naming scheme to ompi-nomenclature.
- Usability outside of the ompi-layer.
- Due to the fixed nature of simple opal types, their information is
completely
known at compile time and therefore constified
- With fewer datatypes (22), the actual sizes of bit-field types may be
reduced
from 64 to 32 bits, allowing reorganizing the opal_datatype
structure, eliminating holes and keeping data required in convertor
(upon send/recv) in one cacheline...
This has implications to the convertor-datastructure and other parts
of the code.
- Several performance tests have been run, the netpipe latency does not
change with
this patch on Linux/x86-64 on the smoky cluster.
- Extensive tests have been done to verify correctness (no new
regressions) using:
1. mpi_test_suite on linux/x86-64 using clean ompi-trunk and
ompi-ddt:
a. running both trunk and ompi-ddt resulted in no differences
(except for MPI_SHORT_INT and MPI_TYPE_MIX_LB_UB do now run
correctly).
b. with --enable-memchecker and running under valgrind (one buglet
when run with static found in test-suite, commited)
2. ibm testsuite on linux/x86-64 using clean ompi-trunk and ompi-ddt:
all passed (except for the dynamic/ tests failed!! as trunk/MTT)
3. compilation and usage of HDF5 tests on Jaguar using PGI and
PathScale compilers.
4. compilation and usage on Scicortex.
- Please note, that for the heterogeneous case, (-m32 compiled
binaries/ompi), neither
ompi-trunk, nor ompi-ddt branch would successfully launch.
This commit was SVN r21641.
2009-07-13 08:56:31 +04:00
|
|
|
const Datatype LOGICAL((MPI_Datatype)&(ompi_mpi_logical));
|
2009-02-24 20:17:33 +03:00
|
|
|
const Datatype CHARACTER((MPI_Datatype)&(ompi_mpi_character));
|
2004-07-14 18:11:03 +04:00
|
|
|
|
|
|
|
// datatype for reduction functions (Fortran)
|
2009-02-24 20:17:33 +03:00
|
|
|
const Datatype TWOREAL((MPI_Datatype)&(ompi_mpi_2real));
|
|
|
|
const Datatype TWODOUBLE_PRECISION((MPI_Datatype)&(ompi_mpi_2dblprec));
|
|
|
|
const Datatype TWOINTEGER((MPI_Datatype)&(ompi_mpi_2integer));
|
2004-07-14 18:11:03 +04:00
|
|
|
|
|
|
|
// optional datatypes (Fortran)
|
2009-02-24 20:17:33 +03:00
|
|
|
const Datatype INTEGER2((MPI_Datatype)&(ompi_mpi_integer));
|
|
|
|
const Datatype REAL2((MPI_Datatype)&(ompi_mpi_real));
|
|
|
|
const Datatype INTEGER1((MPI_Datatype)&(ompi_mpi_char));
|
|
|
|
const Datatype INTEGER4((MPI_Datatype)&(ompi_mpi_short));
|
|
|
|
const Datatype REAL4((MPI_Datatype)&(ompi_mpi_real));
|
|
|
|
const Datatype REAL8((MPI_Datatype)&(ompi_mpi_double));
|
2004-07-14 18:11:03 +04:00
|
|
|
|
|
|
|
#endif // OMPI_WANT_f77_BINDINGS
|
|
|
|
|
|
|
|
// optional datatype (C / C++)
|
|
|
|
const Datatype UNSIGNED_LONG_LONG(MPI_UNSIGNED_LONG_LONG);
|
|
|
|
const Datatype LONG_LONG(MPI_LONG_LONG);
|
2012-02-17 15:42:51 +04:00
|
|
|
const Datatype LONG_LONG_INT(MPI_LONG_LONG_INT);
|
2004-07-14 18:11:03 +04:00
|
|
|
|
|
|
|
// c++ types
|
2009-02-24 20:17:33 +03:00
|
|
|
const Datatype BOOL((MPI_Datatype)&(ompi_mpi_cxx_bool));
|
|
|
|
const Datatype COMPLEX((MPI_Datatype)&(ompi_mpi_cxx_cplex));
|
|
|
|
const Datatype DOUBLE_COMPLEX((MPI_Datatype)&(ompi_mpi_cxx_dblcplex));
|
2012-02-17 15:42:51 +04:00
|
|
|
const Datatype F_DOUBLE_COMPLEX((MPI_Datatype)&(ompi_mpi_cxx_dblcplex));
|
2009-02-24 20:17:33 +03:00
|
|
|
const Datatype LONG_DOUBLE_COMPLEX((MPI_Datatype)&(ompi_mpi_cxx_ldblcplex));
|
2004-07-14 18:11:03 +04:00
|
|
|
|
|
|
|
// reserved communicators
|
|
|
|
Intracomm COMM_WORLD(MPI_COMM_WORLD);
|
|
|
|
Intracomm COMM_SELF(MPI_COMM_SELF);
|
|
|
|
|
|
|
|
// collective operations
|
|
|
|
const Op MAX(MPI_MAX);
|
|
|
|
const Op MIN(MPI_MIN);
|
|
|
|
const Op SUM(MPI_SUM);
|
|
|
|
const Op PROD(MPI_PROD);
|
|
|
|
const Op MAXLOC(MPI_MAXLOC);
|
|
|
|
const Op MINLOC(MPI_MINLOC);
|
|
|
|
const Op BAND(MPI_BAND);
|
|
|
|
const Op BOR(MPI_BOR);
|
|
|
|
const Op BXOR(MPI_BXOR);
|
|
|
|
const Op LAND(MPI_LAND);
|
|
|
|
const Op LOR(MPI_LOR);
|
|
|
|
const Op LXOR(MPI_LXOR);
|
|
|
|
const Op REPLACE(MPI_REPLACE);
|
|
|
|
|
|
|
|
// null handles
|
|
|
|
const Group GROUP_NULL = MPI_GROUP_NULL;
|
|
|
|
const Win WIN_NULL = MPI_WIN_NULL;
|
|
|
|
const Info INFO_NULL = MPI_INFO_NULL;
|
|
|
|
//const Comm COMM_NULL = MPI_COMM_NULL;
|
|
|
|
//const MPI_Comm COMM_NULL = MPI_COMM_NULL;
|
|
|
|
Comm_Null COMM_NULL;
|
|
|
|
const Datatype DATATYPE_NULL = MPI_DATATYPE_NULL;
|
|
|
|
Request REQUEST_NULL = MPI_REQUEST_NULL;
|
|
|
|
const Op OP_NULL = MPI_OP_NULL;
|
|
|
|
const Errhandler ERRHANDLER_NULL;
|
2007-08-19 01:35:51 +04:00
|
|
|
#if OMPI_PROVIDE_MPI_FILE_INTERFACE
|
2006-09-20 02:28:21 +04:00
|
|
|
const File FILE_NULL = MPI_FILE_NULL;
|
2007-08-19 01:35:51 +04:00
|
|
|
#endif
|
2004-07-14 18:11:03 +04:00
|
|
|
|
|
|
|
// constants specifying empty or ignored input
|
|
|
|
const char** ARGV_NULL = (const char**) MPI_ARGV_NULL;
|
|
|
|
const char*** ARGVS_NULL = (const char***) MPI_ARGVS_NULL;
|
|
|
|
|
|
|
|
// empty group
|
|
|
|
const Group GROUP_EMPTY(MPI_GROUP_EMPTY);
|
|
|
|
|
|
|
|
// special datatypes for contstruction of derived datatypes
|
|
|
|
const Datatype UB(MPI_UB);
|
|
|
|
const Datatype LB(MPI_LB);
|
|
|
|
|
2007-06-19 01:29:09 +04:00
|
|
|
} /* namespace MPI */
|