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.
Этот коммит содержится в:
родитель
ca35881cd0
Коммит
e6a0069e95
@ -217,15 +217,22 @@ MPI::Datatype::Get_attr(int type_keyval,
|
||||
|
||||
inline void
|
||||
MPI::Datatype::Get_contents(int max_integers, int max_addresses,
|
||||
int max_datatypes, int array_of_integers[],
|
||||
MPI::Aint array_of_addresses[],
|
||||
MPI::Datatype array_of_datatypes[])
|
||||
const
|
||||
int max_datatypes, int array_of_integers[],
|
||||
MPI::Aint array_of_addresses[],
|
||||
MPI::Datatype array_of_datatypes[]) const
|
||||
{
|
||||
(void) MPI_Type_get_contents(mpi_datatype, max_integers, max_addresses,
|
||||
max_datatypes, const_cast<int *>(array_of_integers),
|
||||
const_cast<MPI_Aint*>(array_of_addresses),
|
||||
(MPI_Datatype *)(array_of_datatypes));
|
||||
int i;
|
||||
MPI_Datatype *d = new MPI_Datatype[max_datatypes];
|
||||
|
||||
(void) MPI_Type_get_contents(mpi_datatype, max_integers, max_addresses,
|
||||
max_datatypes,
|
||||
const_cast<int *>(array_of_integers),
|
||||
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
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user