1
1

Fix from an as-yet uncommitted test that Pak will commit shortly.

Found another places that we were incorrectly casting a C++ MPI handle
array to the corresponding C array type and hoping for the best (which
won't work at all).  This commit fixes things so that we now do the
proper conversion between C<-->C++ handles.

This commit was SVN r13346.
Этот коммит содержится в:
Jeff Squyres 2007-01-29 18:44:46 +00:00
родитель ca35881cd0
Коммит e6a0069e95

Просмотреть файл

@ -219,13 +219,20 @@ inline void
MPI::Datatype::Get_contents(int max_integers, int max_addresses, MPI::Datatype::Get_contents(int max_integers, int max_addresses,
int max_datatypes, int array_of_integers[], int max_datatypes, int array_of_integers[],
MPI::Aint array_of_addresses[], MPI::Aint array_of_addresses[],
MPI::Datatype array_of_datatypes[]) MPI::Datatype array_of_datatypes[]) const
const
{ {
int i;
MPI_Datatype *d = new MPI_Datatype[max_datatypes];
(void) MPI_Type_get_contents(mpi_datatype, max_integers, max_addresses, (void) MPI_Type_get_contents(mpi_datatype, max_integers, max_addresses,
max_datatypes, const_cast<int *>(array_of_integers), max_datatypes,
const_cast<MPI_Aint*>(array_of_addresses), const_cast<int *>(array_of_integers),
(MPI_Datatype *)(array_of_datatypes)); const_cast<MPI_Aint*>(array_of_addresses), d);
// Convert the C MPI_Datatypes to the user's OUT MPI::Datatype
// array parameter
for (i = 0; i < max_datatypes; ++i) {
array_of_datatypes[i] = d[i];
}
} }
inline void inline void