#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <string.h>
#include <mpi.h>
#include <yaxt.h>
#include "tests.h"
#include "ctest_common.h"
#include "test_redist_common.h"
static void
static void
int main(int argc, char **argv) {
Xt_config config = redist_exchanger_option(&argc, &argv);
MPI_Finalize();
return TEST_EXIT_CODE;
}
static void
{
enum { src_slice_len = 5, dst_slice_len = 3 };
Xt_xmap xmap = build_odd_selection_xmap(src_slice_len, comm);
static const MPI_Aint displacements[1] = {0};
displacements, comm, config);
PUT_ERR("error in xt_redist_get_MPI_Comm\n");
static const double src_data[] = {1,2,3,4,5};
static const double ref_dst_data[] = {1,3,5};
enum { num_dst_elems = sizeof (ref_dst_data) / sizeof (ref_dst_data[0]) };
double dst_data[num_dst_elems];
check_redist(redist_coll, src_data,
num_dst_elems, dst_data, fill_array_double, NULL,
ref_dst_data, MPI_DOUBLE, MPI_DOUBLE);
}
static void
{
enum { src_slice_len = 5,
dst_slice_len = (src_slice_len+1)/2 };
Xt_xmap xmap = build_odd_selection_xmap(src_slice_len, comm);
Xt_redist redists[3] = {redist, redist, redist};
static const double src_data[3][src_slice_len]
= {{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)) };
dst_displacements, comm, config);
PUT_ERR("error in xt_redist_get_MPI_Comm\n");
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) / sizeof (dst_data[0][0]),
dst_data, fill_array_double, NULL,
ref_dst_data, MPI_DOUBLE, MPI_DOUBLE);
}
void xt_config_delete(Xt_config config)
void xt_initialize(MPI_Comm default_comm)
void xt_redist_delete(Xt_redist redist)
MPI_Comm xt_redist_get_MPI_Comm(Xt_redist redist)
Xt_redist xt_redist_collection_static_custom_new(Xt_redist *redists, int num_redists, const MPI_Aint src_displacements[num_redists], const MPI_Aint dst_displacements[num_redists], MPI_Comm comm, Xt_config config)
Xt_redist xt_redist_p2p_new(Xt_xmap xmap, MPI_Datatype datatype)
void xt_xmap_delete(Xt_xmap xmap)