Fixes trac:2933: a bunch of C++ API corrections from Fujitsu. Custom
patch from the ticket, released under the BSD license. This commit was SVN r25949. The following Trac tickets were found above: Ticket 2933 --> https://svn.open-mpi.org/trac/ompi/ticket/2933
Этот коммит содержится в:
родитель
be16137072
Коммит
108799ea0e
@ -11,6 +11,7 @@
|
||||
// Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
// All rights reserved.
|
||||
// Copyright (c) 2006-2009 Cisco Systems, Inc. All rights reserved.
|
||||
// Copyright (c) 2011 FUJITSU LIMITED. All rights reserved.
|
||||
// $COPYRIGHT$
|
||||
//
|
||||
// Additional copyrights may follow
|
||||
@ -384,7 +385,7 @@ public:
|
||||
|
||||
static Errhandler Create_errhandler(Comm::Errhandler_function* function);
|
||||
|
||||
virtual void Set_errhandler(const Errhandler& errhandler) const;
|
||||
virtual void Set_errhandler(const Errhandler& errhandler);
|
||||
|
||||
virtual Errhandler Get_errhandler() const;
|
||||
|
||||
|
@ -11,6 +11,7 @@
|
||||
// Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
// All rights reserved.
|
||||
// Copyright (c) 2007-2011 Cisco Systems, Inc. All rights reserved.
|
||||
// Copyright (c) 2011 FUJITSU LIMITED. All rights reserved.
|
||||
// $COPYRIGHT$
|
||||
//
|
||||
// Additional copyrights may follow
|
||||
@ -543,7 +544,7 @@ MPI::Comm::Get_errhandler() const
|
||||
}
|
||||
|
||||
inline void
|
||||
MPI::Comm::Set_errhandler(const MPI::Errhandler& errhandler) const
|
||||
MPI::Comm::Set_errhandler(const MPI::Errhandler& errhandler)
|
||||
{
|
||||
(void)MPI_Comm_set_errhandler(mpi_comm, errhandler);
|
||||
}
|
||||
|
@ -11,6 +11,7 @@
|
||||
// Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
// All rights reserved.
|
||||
// Copyright (c) 2008-2009 Cisco Systems, Inc. All rights reserved.
|
||||
// Copyright (c) 2011 FUJITSU LIMITED. All rights reserved.
|
||||
// $COPYRIGHT$
|
||||
//
|
||||
// Additional copyrights may follow
|
||||
@ -39,19 +40,41 @@ static const int ERR_OTHER = MPI_ERR_OTHER;
|
||||
static const int ERR_INTERN = MPI_ERR_INTERN;
|
||||
static const int ERR_PENDING = MPI_ERR_PENDING;
|
||||
static const int ERR_IN_STATUS = MPI_ERR_IN_STATUS;
|
||||
static const int ERR_LASTCODE = MPI_ERR_LASTCODE;
|
||||
|
||||
static const int ERR_ACCESS = MPI_ERR_ACCESS;
|
||||
static const int ERR_AMODE = MPI_ERR_AMODE;
|
||||
static const int ERR_ASSERT = MPI_ERR_ASSERT;
|
||||
static const int ERR_BAD_FILE = MPI_ERR_BAD_FILE;
|
||||
static const int ERR_BASE = MPI_ERR_BASE;
|
||||
static const int ERR_INFO_VALUE = MPI_ERR_INFO_VALUE;
|
||||
static const int ERR_INFO_KEY = MPI_ERR_INFO_KEY;
|
||||
static const int ERR_CONVERSION = MPI_ERR_CONVERSION;
|
||||
static const int ERR_DISP = MPI_ERR_DISP;
|
||||
static const int ERR_DUP_DATAREP = MPI_ERR_DUP_DATAREP;
|
||||
static const int ERR_FILE_EXISTS = MPI_ERR_FILE_EXISTS;
|
||||
static const int ERR_FILE_IN_USE = MPI_ERR_FILE_IN_USE;
|
||||
static const int ERR_FILE = MPI_ERR_FILE;
|
||||
static const int ERR_INFO_KEY = MPI_ERR_INFO_KEY;;
|
||||
static const int ERR_INFO_NOKEY = MPI_ERR_INFO_NOKEY;
|
||||
static const int ERR_INFO_VALUE = MPI_ERR_INFO_VALUE;
|
||||
static const int ERR_INFO = MPI_ERR_INFO;
|
||||
static const int ERR_IO = MPI_ERR_IO;
|
||||
static const int ERR_KEYVAL = MPI_ERR_KEYVAL;
|
||||
static const int ERR_LOCKTYPE = MPI_ERR_LOCKTYPE;
|
||||
static const int ERR_NAME = MPI_ERR_NAME;
|
||||
static const int ERR_NO_MEM = MPI_ERR_NO_MEM;
|
||||
static const int ERR_NOT_SAME = MPI_ERR_NOT_SAME;
|
||||
static const int ERR_NO_SPACE = MPI_ERR_NO_SPACE;
|
||||
static const int ERR_NO_SUCH_FILE = MPI_ERR_NO_SUCH_FILE;
|
||||
static const int ERR_PORT = MPI_ERR_PORT;
|
||||
static const int ERR_QUOTA = MPI_ERR_QUOTA;
|
||||
static const int ERR_READ_ONLY = MPI_ERR_READ_ONLY;
|
||||
static const int ERR_RMA_CONFLICT = MPI_ERR_RMA_CONFLICT;
|
||||
static const int ERR_RMA_SYNC = MPI_ERR_RMA_SYNC;
|
||||
static const int ERR_SERVICE = MPI_ERR_SERVICE;
|
||||
static const int ERR_SIZE = MPI_ERR_SIZE;
|
||||
static const int ERR_SPAWN = MPI_ERR_SPAWN;
|
||||
static const int ERR_UNSUPPORTED_DATAREP = MPI_ERR_UNSUPPORTED_DATAREP;
|
||||
static const int ERR_UNSUPPORTED_OPERATION = MPI_ERR_UNSUPPORTED_OPERATION;
|
||||
static const int ERR_WIN = MPI_ERR_WIN;
|
||||
|
||||
static const int ERR_LASTCODE = MPI_ERR_LASTCODE;
|
||||
|
||||
// assorted constants
|
||||
OMPI_DECLSPEC extern void* const BOTTOM;
|
||||
@ -136,12 +159,14 @@ OMPI_DECLSPEC extern const Datatype REAL8;
|
||||
|
||||
// optional datatype (C / C++)
|
||||
OMPI_DECLSPEC extern const Datatype LONG_LONG;
|
||||
OMPI_DECLSPEC extern const Datatype LONG_LONG_INT;
|
||||
OMPI_DECLSPEC extern const Datatype UNSIGNED_LONG_LONG;
|
||||
|
||||
// c++ types
|
||||
OMPI_DECLSPEC extern const Datatype BOOL;
|
||||
OMPI_DECLSPEC extern const Datatype COMPLEX;
|
||||
OMPI_DECLSPEC extern const Datatype DOUBLE_COMPLEX;
|
||||
OMPI_DECLSPEC extern const Datatype F_DOUBLE_COMPLEX;
|
||||
OMPI_DECLSPEC extern const Datatype LONG_DOUBLE_COMPLEX;
|
||||
|
||||
// special datatypes for contstruction of derived datatypes
|
||||
|
@ -12,6 +12,7 @@
|
||||
// All rights reserved.
|
||||
// Copyright (c) 2006-2008 Sun Microsystems, Inc. All rights reserved.
|
||||
// Copyright (c) 2006-2007 Cisco Systems, Inc. All rights reserved.
|
||||
// Copyright (c) 2011 FUJITSU LIMITED. All rights reserved.
|
||||
// $COPYRIGHT$
|
||||
//
|
||||
// Additional copyrights may follow
|
||||
@ -148,6 +149,14 @@ public:
|
||||
|
||||
virtual int Pack_size(int incount, const Comm& comm) const;
|
||||
|
||||
virtual void Pack_external(const char* datarep, const void* inbuf, int incount,
|
||||
void* outbuf, Aint outsize, Aint& position) const;
|
||||
|
||||
virtual Aint Pack_external_size(const char* datarep, int incount) const;
|
||||
|
||||
virtual void Unpack_external(const char* datarep, const void* inbuf,
|
||||
Aint insize, Aint& position, void* outbuf, int outcount) const;
|
||||
|
||||
//
|
||||
// Miscellany
|
||||
//
|
||||
@ -156,6 +165,20 @@ public:
|
||||
const int array_of_starts[], int order)
|
||||
const;
|
||||
|
||||
virtual Datatype Create_darray(int size, int rank, int ndims,
|
||||
const int array_of_gsizes[], const int array_of_distribs[],
|
||||
const int array_of_dargs[], const int array_of_psizes[],
|
||||
int order) const;
|
||||
|
||||
// Language Binding
|
||||
static Datatype Create_f90_complex(int p, int r);
|
||||
|
||||
static Datatype Create_f90_integer(int r);
|
||||
|
||||
static Datatype Create_f90_real(int p, int r);
|
||||
|
||||
static Datatype Match_size(int typeclass, int size);
|
||||
|
||||
//
|
||||
// External Interfaces
|
||||
//
|
||||
|
@ -11,6 +11,7 @@
|
||||
// Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
// All rights reserved.
|
||||
// Copyright (c) 2006-2008 Sun Microsystems, Inc. All rights reserved.
|
||||
// Copyright (c) 2011 FUJITSU LIMITED. All rights reserved.
|
||||
|
||||
// $COPYRIGHT$
|
||||
//
|
||||
@ -163,6 +164,29 @@ MPI::Datatype::Pack_size(int incount, const MPI::Comm& comm) const
|
||||
return size;
|
||||
}
|
||||
|
||||
inline void
|
||||
MPI::Datatype::Pack_external(const char* datarep, const void* inbuf, int incount,
|
||||
void* outbuf, MPI::Aint outsize, MPI::Aint& position) const
|
||||
{
|
||||
(void)MPI_Pack_external(const_cast<char *>(datarep), const_cast<void *>(inbuf),
|
||||
incount, mpi_datatype, outbuf, outsize, &position);
|
||||
}
|
||||
|
||||
inline MPI::Aint
|
||||
MPI::Datatype::Pack_external_size(const char* datarep, int incount) const
|
||||
{
|
||||
MPI_Aint addr;
|
||||
(void)MPI_Pack_external_size(const_cast<char *>(datarep), incount, mpi_datatype, &addr);
|
||||
return addr;
|
||||
}
|
||||
|
||||
inline void
|
||||
MPI::Datatype::Unpack_external(const char* datarep, const void* inbuf,
|
||||
MPI::Aint insize, MPI::Aint& position, void* outbuf, int outcount) const
|
||||
{
|
||||
(void)MPI_Unpack_external(const_cast<char *>(datarep), const_cast<void *>(inbuf),
|
||||
insize, &position, outbuf, outcount, mpi_datatype);
|
||||
}
|
||||
|
||||
//
|
||||
// Miscellany
|
||||
@ -182,6 +206,53 @@ MPI::Datatype::Create_subarray(int ndims, const int array_of_sizes[],
|
||||
return type;
|
||||
}
|
||||
|
||||
inline MPI::Datatype
|
||||
MPI::Datatype::Create_darray(int size, int rank, int ndims,
|
||||
const int array_of_gsizes[], const int array_of_distribs[],
|
||||
const int array_of_dargs[], const int array_of_psizes[],
|
||||
int order) const
|
||||
{
|
||||
MPI_Datatype type;
|
||||
(void) MPI_Type_create_darray(size, rank, ndims,
|
||||
const_cast<int *>(array_of_gsizes),
|
||||
const_cast<int *>(array_of_distribs),
|
||||
const_cast<int *>(array_of_dargs),
|
||||
const_cast<int *>(array_of_psizes),
|
||||
order, mpi_datatype, &type);
|
||||
return type;
|
||||
}
|
||||
|
||||
inline MPI::Datatype
|
||||
MPI::Datatype::Create_f90_complex(int p, int r)
|
||||
{
|
||||
MPI_Datatype type;
|
||||
(void) MPI_Type_create_f90_complex(p, r, &type);
|
||||
return type;
|
||||
}
|
||||
|
||||
inline MPI::Datatype
|
||||
MPI::Datatype::Create_f90_integer(int r)
|
||||
{
|
||||
MPI_Datatype type;
|
||||
(void) MPI_Type_create_f90_integer(r, &type);
|
||||
return type;
|
||||
}
|
||||
|
||||
inline MPI::Datatype
|
||||
MPI::Datatype::Create_f90_real(int p, int r)
|
||||
{
|
||||
MPI_Datatype type;
|
||||
(void) MPI_Type_create_f90_real(p, r, &type);
|
||||
return type;
|
||||
}
|
||||
|
||||
inline MPI::Datatype
|
||||
MPI::Datatype::Match_size(int typeclass, int size)
|
||||
{
|
||||
MPI_Datatype type;
|
||||
(void) MPI_Type_match_size(typeclass, size, &type);
|
||||
return type;
|
||||
}
|
||||
|
||||
//
|
||||
// External Interfaces
|
||||
|
@ -11,6 +11,7 @@
|
||||
// Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
// All rights reserved.
|
||||
// Copyright (c) 2008 Cisco Systems, Inc. All rights reserved.
|
||||
// Copyright (c) 2011 FUJITSU LIMITED. All rights reserved.
|
||||
// $COPYRIGHT$
|
||||
//
|
||||
// Additional copyrights may follow
|
||||
@ -39,6 +40,15 @@ Compute_dims(int nnodes, int ndims, int dims[]);
|
||||
// Environmental Inquiry
|
||||
//
|
||||
|
||||
int
|
||||
Add_error_class();
|
||||
|
||||
int
|
||||
Add_error_code(int errorclass);
|
||||
|
||||
void
|
||||
Add_error_string(int errorcode, const char* string);
|
||||
|
||||
void
|
||||
Get_processor_name(char* name, int& resultlen);
|
||||
|
||||
|
@ -11,6 +11,7 @@
|
||||
// Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
// All rights reserved.
|
||||
// Copyright (c) 2008 Cisco Systems, Inc. All rights reserved.
|
||||
// Copyright (c) 2011 FUJITSU LIMITED. All rights reserved.
|
||||
// $COPYRIGHT$
|
||||
//
|
||||
// Additional copyrights may follow
|
||||
@ -53,6 +54,28 @@ MPI::Compute_dims(int nnodes, int ndims, int dims[])
|
||||
// Environmental Inquiry
|
||||
//
|
||||
|
||||
inline int
|
||||
MPI::Add_error_class()
|
||||
{
|
||||
int errcls;
|
||||
(void)MPI_Add_error_class(&errcls);
|
||||
return errcls;
|
||||
}
|
||||
|
||||
inline int
|
||||
MPI::Add_error_code(int errorclass)
|
||||
{
|
||||
int errcode;
|
||||
(void)MPI_Add_error_code(errorclass, &errcode);
|
||||
return errcode;
|
||||
}
|
||||
|
||||
inline void
|
||||
MPI::Add_error_string(int errorcode, const char* string)
|
||||
{
|
||||
(void)MPI_Add_error_string(errorcode, const_cast<char *>(string));
|
||||
}
|
||||
|
||||
inline void
|
||||
MPI::Get_processor_name(char* name, int& resultlen)
|
||||
{
|
||||
|
@ -11,6 +11,7 @@
|
||||
// Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
// All rights reserved.
|
||||
// Copyright (c) 2006 Cisco Systems, Inc. All rights reserved.
|
||||
// Copyright (c) 2011 FUJITSU LIMITED. All rights reserved.
|
||||
// $COPYRIGHT$
|
||||
//
|
||||
// Additional copyrights may follow
|
||||
@ -77,7 +78,7 @@ public:
|
||||
|
||||
virtual Group Get_remote_group() const;
|
||||
|
||||
virtual Intracomm Merge(bool high);
|
||||
virtual Intracomm Merge(bool high) const;
|
||||
|
||||
virtual Intercomm Create(const Group& group) const;
|
||||
|
||||
|
@ -10,6 +10,7 @@
|
||||
// University of Stuttgart. All rights reserved.
|
||||
// Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
// All rights reserved.
|
||||
// Copyright (c) 2011 FUJITSU LIMITED. All rights reserved.
|
||||
// $COPYRIGHT$
|
||||
//
|
||||
// Additional copyrights may follow
|
||||
@ -51,7 +52,7 @@ MPI::Intercomm::Get_remote_group() const
|
||||
}
|
||||
|
||||
inline MPI::Intracomm
|
||||
MPI::Intercomm::Merge(bool high)
|
||||
MPI::Intercomm::Merge(bool high) const
|
||||
{
|
||||
MPI_Comm newcomm;
|
||||
(void)MPI_Intercomm_merge(mpi_comm, (int)high, &newcomm);
|
||||
|
@ -12,6 +12,7 @@
|
||||
// All rights reserved.
|
||||
// Copyright (c) 2007-2009 Cisco Systems, Inc. All rights reserved.
|
||||
// Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
|
||||
// Copyright (c) 2011 FUJITSU LIMITED. All rights reserved.
|
||||
// $COPYRIGHT$
|
||||
//
|
||||
// Additional copyrights may follow
|
||||
@ -102,11 +103,13 @@ const Datatype REAL8((MPI_Datatype)&(ompi_mpi_double));
|
||||
// optional datatype (C / C++)
|
||||
const Datatype UNSIGNED_LONG_LONG(MPI_UNSIGNED_LONG_LONG);
|
||||
const Datatype LONG_LONG(MPI_LONG_LONG);
|
||||
const Datatype LONG_LONG_INT(MPI_LONG_LONG_INT);
|
||||
|
||||
// c++ types
|
||||
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));
|
||||
const Datatype F_DOUBLE_COMPLEX((MPI_Datatype)&(ompi_mpi_cxx_dblcplex));
|
||||
const Datatype LONG_DOUBLE_COMPLEX((MPI_Datatype)&(ompi_mpi_cxx_ldblcplex));
|
||||
|
||||
// reserved communicators
|
||||
|
@ -12,6 +12,7 @@
|
||||
// All rights reserved.
|
||||
// Copyright (c) 2006-2008 Cisco Systems, Inc. All rights reserved.
|
||||
// Copyright (c) 2008 Sun Microsystems, Inc. All rights reserved.
|
||||
// Copyright (c) 2011 FUJITSU LIMITED. All rights reserved.
|
||||
// $COPYRIGHT$
|
||||
//
|
||||
// Additional copyrights may follow
|
||||
@ -192,6 +193,7 @@ namespace MPI {
|
||||
#endif
|
||||
|
||||
typedef MPI_Aint Aint;
|
||||
typedef MPI_Fint Fint;
|
||||
typedef MPI_Offset Offset;
|
||||
|
||||
#ifdef OMPI_BUILDING_CXX_BINDINGS_LIBRARY
|
||||
|
@ -10,6 +10,7 @@
|
||||
// University of Stuttgart. All rights reserved.
|
||||
// Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
// All rights reserved.
|
||||
// Copyright (c) 2011 FUJITSU LIMITED. All rights reserved.
|
||||
// $COPYRIGHT$
|
||||
//
|
||||
// Additional copyrights may follow
|
||||
@ -80,7 +81,7 @@ public:
|
||||
virtual void Shift(int direction, int disp,
|
||||
int &rank_source, int &rank_dest) const;
|
||||
|
||||
virtual Cartcomm Sub(const bool remain_dims[]);
|
||||
virtual Cartcomm Sub(const bool remain_dims[]) const;
|
||||
|
||||
virtual int Map(int ndims, const int dims[], const bool periods[]) const;
|
||||
|
||||
|
@ -11,6 +11,7 @@
|
||||
// Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
// All rights reserved.
|
||||
// Copyright (c) 2007 Sun Microsystems, Inc. All rights reserved.
|
||||
// Copyright (c) 2011 FUJITSU LIMITED. All rights reserved.
|
||||
// $COPYRIGHT$
|
||||
//
|
||||
// Additional copyrights may follow
|
||||
@ -99,7 +100,7 @@ MPI::Cartcomm::Shift(int direction, int disp,
|
||||
}
|
||||
|
||||
inline MPI::Cartcomm
|
||||
MPI::Cartcomm::Sub(const bool remain_dims[])
|
||||
MPI::Cartcomm::Sub(const bool remain_dims[]) const
|
||||
{
|
||||
int ndims;
|
||||
MPI_Cartdim_get(mpi_comm, &ndims);
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user