#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <string.h>
#include <mpi.h>
#include <yaxt.h>
#include "tests.h"
#include "test_redist_common.h"
int main(void) {
{
enum { src_slice_len = 5, dst_slice_len = 3 };
Xt_xmap xmap = build_odd_selection_xmap(src_slice_len);
MPI_Aint src_displacements[1] = {0};
MPI_Aint dst_displacements[1] = {0};
dst_displacements,
PUT_ERR("error in xt_redist_get_MPI_Comm\n");
static const double src_data[] = {1,2,3,4,5};
double dst_data[] = {-1,-1,-1};
static const double ref_dst_data[] = {1,3,5};
check_redist(redist_coll, src_data,
sizeof (dst_data), dst_data, ref_dst_data);
}
{
Xt_xmap xmap = build_odd_selection_xmap(5);
Xt_redist redists[3] = {redist, redist, redist};
static const double src_data[3][5]
= {{1,2,3,4,5},{6,7,8,9,10},{11,12,13,14,15}};
double dst_data[3][3];
MPI_Aint src_displacements[3]
= {0, (MPI_Aint)((size_t)(src_data[1] - src_data[0]) * sizeof (double)),
(MPI_Aint)((size_t)(src_data[2] - src_data[0]) * sizeof(double)) };
MPI_Aint dst_displacements[3]
= {0, (MPI_Aint)((size_t)(dst_data[1] - dst_data[0]) * sizeof(double)),
(MPI_Aint)((size_t)(dst_data[2] - dst_data[0]) * sizeof(double)) };
PUT_ERR("error in xt_redist_get_MPI_Comm\n");
{
for (size_t j = 0; j < 3; ++j)
for (size_t i = 0; i < 3; ++i)
dst_data[j][i] = -1.0;
static const double ref_dst_data[3][3] = {{1,3,5},{6,8,10},{11,13,15}};
check_redist(redist_coll, src_data,
sizeof (dst_data), dst_data, ref_dst_data);
}
{
for (size_t j = 0; j < 3; ++j)
for (size_t i = 0; i < 3; ++i)
dst_data[j][i] = -1.0;
static const double ref_dst_data[3][3] = {{1,3,5},{6,8,10},{11,13,15}};
check_redist(redist_coll, src_data,
sizeof (dst_data), dst_data, ref_dst_data);
}
}
MPI_Finalize();
return TEST_EXIT_CODE;
}