Commit 7124693b authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Break long lines.

parent 93515608
......@@ -48,8 +48,9 @@ int main(void) {
unsigned local_size[2] = {3,4};
unsigned local_start[2] = {2,3};
Xt_idxlist idxsection = xt_idxsection_new(start, num_dimensions, global_size,
local_size, local_start);
Xt_idxlist idxsection
= xt_idxsection_new(start, num_dimensions, global_size,
local_size, local_start);
//! [index section example]
puts("index section example:");
......@@ -66,13 +67,15 @@ int main(void) {
unsigned local_size[2][2] = {{2,2},{3,4}};
unsigned local_start[2][2] = {{0,0},{2,6}};
Xt_idxlist idxlists[] = {xt_idxsection_new(start, num_dimensions, global_size,
local_size[0], local_start[0]),
xt_idxsection_new(start, num_dimensions, global_size,
local_size[1], local_start[1])};
Xt_idxlist idxlists[]
= {xt_idxsection_new(start, num_dimensions, global_size,
local_size[0], local_start[0]),
xt_idxsection_new(start, num_dimensions, global_size,
local_size[1], local_start[1])};
Xt_count num_idxlists = sizeof(idxlists) / sizeof(idxlists[0]);
Xt_idxlist idxcollection = xt_idxlist_collection_new(idxlists, num_idxlists);
Xt_idxlist idxcollection
= xt_idxlist_collection_new(idxlists, num_idxlists);
//! [index list collection example]
puts("index list collection example:");
......
......@@ -13,9 +13,11 @@
* @param[in] num_idxlists number of index lists in idxlists
* @return returns a Xt_idxlist$
*/
Xt_idxlist xt_idxlist_collection_new(Xt_idxlist *idxlists, unsigned num_idxlists);
Xt_idxlist
xt_idxlist_collection_new(Xt_idxlist *idxlists, unsigned num_idxlists);
Xt_idxlist xt_idxlist_collection_unpack(void *buffer, int buffer_size, int *position,
MPI_Comm comm);
Xt_idxlist
xt_idxlist_collection_unpack(void *buffer, int buffer_size, int *position,
MPI_Comm comm);
#endif // XT_IDXLIST_COLLECTION_H
......@@ -4,11 +4,11 @@
#include "xt_idxsection.h"
#include "xt_idxstripes.h"
struct xt_idxlist_unpack_routine_table xt_idxlist_unpack_routines[] =
{{VECTOR, xt_idxvec_unpack},
{COLLECTION, xt_idxlist_collection_unpack},
{SECTION, xt_idxsection_unpack},
{STRIPES, xt_idxstripes_unpack}};
struct xt_idxlist_unpack_routine_table xt_idxlist_unpack_routines[]
= {{VECTOR, xt_idxvec_unpack},
{COLLECTION, xt_idxlist_collection_unpack},
{SECTION, xt_idxsection_unpack},
{STRIPES, xt_idxstripes_unpack}};
unsigned xt_num_unpack_routines = sizeof(xt_idxlist_unpack_routines) /
sizeof(xt_idxlist_unpack_routines[0]);
......@@ -16,7 +16,7 @@
* @param[in] local_size size of the local section in each dimension
* @param[in] local_start index of the first index of the local part
* within the global array for each dimension (C-style)
*
*
*/
Xt_idxlist xt_idxsection_new(Xt_idx start, unsigned num_dimensions,
unsigned * global_size, unsigned * local_size,
......
......@@ -12,7 +12,8 @@
* @param[in] stripes array defining the stripes
* @param[in] num_stripes number of stripes
*/
Xt_idxlist xt_idxstripes_new(struct Xt_stripe const * stripes, Xt_count num_stripes);
Xt_idxlist
xt_idxstripes_new(struct Xt_stripe const * stripes, Xt_count num_stripes);
Xt_idxlist xt_idxstripes_unpack(void *buffer, int buffer_size, int *position,
MPI_Comm comm);
......
......@@ -16,7 +16,8 @@
*/
Xt_idxlist xt_idxvec_new(Xt_idx *idxlist, Xt_count num_indices);
Xt_idxlist xt_idxvec_from_stripes_new(struct Xt_stripe * stripes, Xt_count num_stripes);
Xt_idxlist
xt_idxvec_from_stripes_new(struct Xt_stripe * stripes, Xt_count num_stripes);
Xt_idxlist xt_idxvec_unpack(void *buffer, int buffer_size, int *position,
MPI_Comm comm);
......
#include "xt_sort.h"
void (*xt_sort_index)(Xt_idx * a, int n, int * idx, int reset_index) = xt_quicksort_index;
void (*xt_sort_index)(Xt_idx * a, int n, int * idx, int reset_index)
= xt_quicksort_index;
void (*xt_sort_idxpos)(idxpos_type *v, int n) = xt_quicksort_idxpos;
void xt_sort_init() {
......
......@@ -136,7 +136,7 @@ int main(void) {
Xt_idx ref_indices[2] = {7,8};
struct Xt_stripe ref_stripes[1] = {{7,2,1}};
do_tests(intersection, ref_indices, 2, ref_stripes, 1);
xt_idxlist_delete(intersection);
......@@ -175,7 +175,7 @@ int main(void) {
Xt_idx ref_indices[1] = {0};
struct Xt_stripe ref_stripes[1] = {{0,1,1}};
do_tests(intersection, ref_indices, 0, ref_stripes, 0);
xt_idxlist_delete(intersection);
......@@ -214,7 +214,7 @@ int main(void) {
Xt_idx ref_indices[2] = {20,26};
struct Xt_stripe ref_stripes[2] = {{20,1,1}, {26,1,1}};
do_tests(intersection, ref_indices, 2, ref_stripes, 2);
xt_idxlist_delete(intersection);
......
......@@ -354,8 +354,10 @@ int main(void) {
Xt_idxlist idxstripes_a, idxstripes_b;
struct Xt_stripe stripes_a[10] = {{0,2,1},{3,2,1},{5,2,1},{8,2,1},{10,2,1},
{14,2,1},{17,2,1},{20,2,1},{23,2,1},{25,2,1}};
struct Xt_stripe stripes_b[5] = {{5,3,1},{8,2,1},{19,1,1},{20,2,1},{30,2,1}};
{14,2,1},{17,2,1},{20,2,1},{23,2,1},
{25,2,1}};
struct Xt_stripe stripes_b[5] = {{5,3,1},{8,2,1},{19,1,1},{20,2,1},
{30,2,1}};
idxstripes_a = xt_idxstripes_new(stripes_a, 10);
idxstripes_b = xt_idxstripes_new(stripes_b, 5);
......@@ -402,7 +404,8 @@ int main(void) {
// check intersection
Xt_idx ref_indices[2][15] = {{0,1,2,3,4,5,6},{0,1,1,2,2,2,3,3,3,4,4,4,5,5,6}};
Xt_idx ref_indices[2][15] = {{0,1,2,3,4,5,6},
{0,1,1,2,2,2,3,3,3,4,4,4,5,5,6}};
Xt_count ref_num_indices[2] = {7,15};
do_tests(intersection[0], ref_indices[0], ref_num_indices[0]);
......@@ -504,10 +507,13 @@ int main(void) {
}
}
Xt_idx sel_idx[num_pos];
int undef_count = xt_idxlist_get_indices_at_positions(idxlist, pos, num_pos, sel_idx, undef_idx);
if (undef_count != ref_undef_count) PUT_ERR("test_idxvec.c: (undef_count != ref_undef_count)\n");
int undef_count = xt_idxlist_get_indices_at_positions(idxlist, pos, num_pos,
sel_idx, undef_idx);
if (undef_count != ref_undef_count)
PUT_ERR("test_idxvec.c: (undef_count != ref_undef_count)\n");
for (int ip=0; ip<num_pos; ip++) {
if (sel_idx[ip] != ref_sel_idx[ip]) PUT_ERR("test_idxvec.c: (sel_idx[ip] != ref_sel_idx[ip])\n");
if (sel_idx[ip] != ref_sel_idx[ip])
PUT_ERR("test_idxvec.c: (sel_idx[ip] != ref_sel_idx[ip])\n");
}
xt_idxlist_delete(idxlist);
};
......@@ -535,10 +541,13 @@ int main(void) {
}
}
Xt_idx sel_idx[num_pos];
int undef_count = xt_idxlist_get_indices_at_positions(idxlist, pos, num_pos, sel_idx, undef_idx);
if (undef_count != ref_undef_count) PUT_ERR("test_idxvec.c: (undef_count != ref_undef_count)\n");
int undef_count = xt_idxlist_get_indices_at_positions(idxlist, pos, num_pos,
sel_idx, undef_idx);
if (undef_count != ref_undef_count)
PUT_ERR("test_idxvec.c: (undef_count != ref_undef_count)\n");
for (int ip=0; ip<num_pos; ip++) {
if (sel_idx[ip] != ref_sel_idx[ip]) PUT_ERR("test_idxvec.c: (sel_idx[ip] != ref_sel_idx[ip])\n");
if (sel_idx[ip] != ref_sel_idx[ip])
PUT_ERR("test_idxvec.c: (sel_idx[ip] != ref_sel_idx[ip])\n");
}
xt_idxlist_delete(idxlist);
......@@ -567,10 +576,13 @@ int main(void) {
}
}
Xt_idx sel_idx[num_pos];
int undef_count = xt_idxlist_get_indices_at_positions(idxlist, pos, num_pos, sel_idx, undef_idx);
if (undef_count != ref_undef_count) PUT_ERR("test_idxvec.c: (undef_count != ref_undef_count)\n");
int undef_count = xt_idxlist_get_indices_at_positions(idxlist, pos, num_pos,
sel_idx, undef_idx);
if (undef_count != ref_undef_count)
PUT_ERR("test_idxvec.c: (undef_count != ref_undef_count)\n");
for (int ip=0; ip<num_pos; ip++) {
if (sel_idx[ip] != ref_sel_idx[ip]) PUT_ERR("test_idxvec.c: (sel_idx[ip] != ref_sel_idx[ip])\n");
if (sel_idx[ip] != ref_sel_idx[ip])
PUT_ERR("test_idxvec.c: (sel_idx[ip] != ref_sel_idx[ip])\n");
}
xt_idxlist_delete(idxlist);
......@@ -599,10 +611,13 @@ int main(void) {
}
Xt_idx sel_idx[num_pos];
int undef_count = xt_idxlist_get_indices_at_positions(idxlist, pos, num_pos, sel_idx, undef_idx);
if (undef_count != ref_undef_count) PUT_ERR("test_idxvec.c: (undef_count != ref_undef_count)\n");
int undef_count = xt_idxlist_get_indices_at_positions(idxlist, pos, num_pos,
sel_idx, undef_idx);
if (undef_count != ref_undef_count)
PUT_ERR("test_idxvec.c: (undef_count != ref_undef_count)\n");
for (int ip=0; ip<num_pos; ip++) {
if (sel_idx[ip] != ref_sel_idx[ip]) PUT_ERR("test_idxvec.c: (sel_idx[ip] != ref_sel_idx[ip])\n");
if (sel_idx[ip] != ref_sel_idx[ip])
PUT_ERR("test_idxvec.c: (sel_idx[ip] != ref_sel_idx[ip])\n");
}
xt_idxlist_delete(idxlist);
};
......@@ -647,7 +662,8 @@ do_tests(Xt_idxlist idxlist, Xt_idx * ref_indices, Xt_count num_indices) {
int position = 0;
xt_idxlist_pack(idxlist, send_buffer, buffer_size, &position, MPI_COMM_WORLD);
xt_idxlist_pack(idxlist, send_buffer, buffer_size, &position,
MPI_COMM_WORLD);
// send the buffer
......@@ -664,14 +680,16 @@ do_tests(Xt_idxlist idxlist, Xt_idx * ref_indices, Xt_count num_indices) {
// receive the buffer
mpi_err_handler(MPI_Recv(recv_buffer, buffer_size, MPI_PACKED, rank, 0,
MPI_COMM_WORLD, MPI_STATUS_IGNORE), MPI_COMM_WORLD);
MPI_COMM_WORLD, MPI_STATUS_IGNORE),
MPI_COMM_WORLD);
// unpack the buffer
Xt_idxlist idxlist_copy;
position = 0;
idxlist_copy = xt_idxlist_unpack(recv_buffer, buffer_size, &position, MPI_COMM_WORLD);
idxlist_copy = xt_idxlist_unpack(recv_buffer, buffer_size, &position,
MPI_COMM_WORLD);
// check copy
......
......@@ -57,7 +57,8 @@ int main(void) {
int position = 0;
xt_idxlist_pack(idxvector, send_buffer, buffer_size, &position, MPI_COMM_WORLD);
xt_idxlist_pack(idxvector, send_buffer, buffer_size, &position,
MPI_COMM_WORLD);
// send the buffer
......@@ -74,14 +75,16 @@ int main(void) {
// receive the buffer
mpi_err_handler(MPI_Recv(recv_buffer, buffer_size, MPI_PACKED, rank, 0,
MPI_COMM_WORLD, MPI_STATUS_IGNORE), MPI_COMM_WORLD);
MPI_COMM_WORLD, MPI_STATUS_IGNORE),
MPI_COMM_WORLD);
// unpack the buffer
Xt_idxlist idxvector_copy;
position = 0;
idxvector_copy = xt_idxlist_unpack(recv_buffer, buffer_size, &position, MPI_COMM_WORLD);
idxvector_copy = xt_idxlist_unpack(recv_buffer, buffer_size, &position,
MPI_COMM_WORLD);
// check the received index vector
......@@ -173,11 +176,13 @@ int main(void) {
{ // subtest from test_ut
const int single_match_only = 1;
Xt_idx index_vector[] = {10,15,14,13,12,15,10,11,12,13,23,18,19,20,21,31,26,27,28,29};
Xt_idx index_vector[] = {10,15,14,13,12,15,10,11,12,13,23,18,19,
20,21,31,26,27,28,29};
size_t index_num = sizeof(index_vector) / sizeof(index_vector[0]);
Xt_idx intersection_vector[] = {12,12,13,13,14,15,15,20,21,23,28,29,31};
size_t intersection_num = sizeof(intersection_vector) / sizeof(intersection_vector[0]);
size_t intersection_num
= sizeof(intersection_vector) / sizeof(intersection_vector[0]);
Xt_idxlist idxvector;
......@@ -189,18 +194,23 @@ int main(void) {
int retval;
int intersection_pos[intersection_num];
int ref_intersection_pos[] = {4,8,3,9,2,1,5,13,14,10,18,19,15};
size_t ref_intersection_num = sizeof(ref_intersection_pos) / sizeof(ref_intersection_pos[0]);
size_t ref_intersection_num
= sizeof(ref_intersection_pos) / sizeof(ref_intersection_pos[0]);
assert(intersection_num == ref_intersection_num);
retval = xt_idxlist_get_positions_of_indices(idxvector, intersection_vector,
intersection_num, intersection_pos, single_match_only);
retval = xt_idxlist_get_positions_of_indices(idxvector,
intersection_vector,
intersection_num,
intersection_pos,
single_match_only);
assert(retval != 1);
// check positions:
for(int i=0; i<intersection_num; i++)
if (intersection_pos[i] != ref_intersection_pos[i])
PUT_ERR("unexpected results from xt_idxlist_get_positions_of_indices\n");
PUT_ERR("unexpected results from"
" xt_idxlist_get_positions_of_indices\n");
// clean up
xt_idxlist_delete(idxvector);
......@@ -208,8 +218,9 @@ int main(void) {
{ // check intersection
Xt_idx index_vector[2][3] = {{1,2,3},{1,2,3}};
Xt_count num_indices[2] = {sizeof(index_vector[0]) / sizeof(index_vector[0][0]),
sizeof(index_vector[0]) / sizeof(index_vector[0][0])};
Xt_count num_indices[2]
= {sizeof(index_vector[0]) / sizeof(index_vector[0][0]),
sizeof(index_vector[0]) / sizeof(index_vector[0][0])};
Xt_idxlist idxvector[2];
......@@ -242,8 +253,9 @@ int main(void) {
{ // check intersection
Xt_idx index_vector[2][3] = {{1,2,3},{2,3,4}};
Xt_count num_indices[2] = {sizeof(index_vector[0]) / sizeof(index_vector[0][0]),
sizeof(index_vector[0]) / sizeof(index_vector[0][0])};
Xt_count num_indices[2]
= {sizeof(index_vector[0]) / sizeof(index_vector[0][0]),
sizeof(index_vector[0]) / sizeof(index_vector[0][0])};
Xt_idxlist idxvector[2];
......@@ -276,8 +288,9 @@ int main(void) {
{ // check intersection
Xt_idx index_vector[2][3] = {{2,3,4},{1,2,3}};
Xt_count num_indices[2] = {sizeof(index_vector[0]) / sizeof(index_vector[0][0]),
sizeof(index_vector[0]) / sizeof(index_vector[0][0])};
Xt_count num_indices[2]
= {sizeof(index_vector[0]) / sizeof(index_vector[0][0]),
sizeof(index_vector[0]) / sizeof(index_vector[0][0])};
Xt_idxlist idxvector[2];
......@@ -310,8 +323,9 @@ int main(void) {
{ // check intersection
Xt_idx index_vector[2][3] = {{4,2,3},{3,1,2}};
Xt_count num_indices[2] = {sizeof(index_vector[0]) / sizeof(index_vector[0][0]),
sizeof(index_vector[0]) / sizeof(index_vector[0][0])};
Xt_count num_indices[2]
= {sizeof(index_vector[0]) / sizeof(index_vector[0][0]),
sizeof(index_vector[0]) / sizeof(index_vector[0][0])};
Xt_idxlist idxvector[2];
......@@ -344,8 +358,9 @@ int main(void) {
{ // check intersection
Xt_idx index_vector[2][3] = {{3,1,2},{4,2,3}};
Xt_count num_indices[2] = {sizeof(index_vector[0]) / sizeof(index_vector[0][0]),
sizeof(index_vector[0]) / sizeof(index_vector[0][0])};
Xt_count num_indices[2]
= {sizeof(index_vector[0]) / sizeof(index_vector[0][0]),
sizeof(index_vector[0]) / sizeof(index_vector[0][0])};
Xt_idxlist idxvector[2];
......@@ -508,7 +523,8 @@ int main(void) {
// test results
Xt_idx ref_indices[] = {0,-1,-2,-3,-4,1,2,3,4,5,-5,-6,-7,-8,-9,6,7,8,9,10};
Xt_idx ref_indices[] = {0,-1,-2,-3,-4,1,2,3,4,5,-5,-6,-7,-8,-9,
6,7,8,9,10};
check_idxlist(idxvec, ref_indices, 20);
// clean up
......@@ -535,10 +551,14 @@ int main(void) {
}
}
Xt_idx sel_idx[num_pos];
int undef_count = xt_idxlist_get_indices_at_positions(idxvec, pos, num_pos, sel_idx, undef_idx);
if (undef_count != ref_undef_count) PUT_ERR("test_idxvec.c: (undef_count != ref_undef_count)\n");
int undef_count
= xt_idxlist_get_indices_at_positions(idxvec, pos, num_pos, sel_idx,
undef_idx);
if (undef_count != ref_undef_count)
PUT_ERR("test_idxvec.c: (undef_count != ref_undef_count)\n");
for (int ip=0; ip<num_pos; ip++) {
if (sel_idx[ip] != ref_sel_idx[ip]) PUT_ERR("test_idxvec.c: (sel_idx[ip] != ref_sel_idx[ip])\n");
if (sel_idx[ip] != ref_sel_idx[ip])
PUT_ERR("test_idxvec.c: (sel_idx[ip] != ref_sel_idx[ip])\n");
}
xt_idxlist_delete(idxvec);
}
......@@ -562,10 +582,14 @@ int main(void) {
}
}
Xt_idx sel_idx[num_pos];
int undef_count = xt_idxlist_get_indices_at_positions(idxvec, pos, num_pos, sel_idx, undef_idx);
if (undef_count != ref_undef_count) PUT_ERR("test_idxvec.c: (undef_count != ref_undef_count)\n");
int undef_count
= xt_idxlist_get_indices_at_positions(idxvec, pos, num_pos, sel_idx,
undef_idx);
if (undef_count != ref_undef_count)
PUT_ERR("test_idxvec.c: (undef_count != ref_undef_count)\n");
for (int ip=0; ip<num_pos; ip++) {
if (sel_idx[ip] != ref_sel_idx[ip]) PUT_ERR("test_idxvec.c: (sel_idx[ip] != ref_sel_idx[ip])\n");
if (sel_idx[ip] != ref_sel_idx[ip])
PUT_ERR("test_idxvec.c: (sel_idx[ip] != ref_sel_idx[ip])\n");
}
xt_idxlist_delete(idxvec);
}
......@@ -589,10 +613,14 @@ int main(void) {
}
}
Xt_idx sel_idx[num_pos];
int undef_count = xt_idxlist_get_indices_at_positions(idxvec, pos, num_pos, sel_idx, undef_idx);
if (undef_count != ref_undef_count) PUT_ERR("test_idxvec.c: (undef_count != ref_undef_count)\n");
int undef_count
= xt_idxlist_get_indices_at_positions(idxvec, pos, num_pos, sel_idx,
undef_idx);
if (undef_count != ref_undef_count)
PUT_ERR("test_idxvec.c: (undef_count != ref_undef_count)\n");
for (int ip=0; ip<num_pos; ip++) {
if (sel_idx[ip] != ref_sel_idx[ip]) PUT_ERR("test_idxvec.c: (sel_idx[ip] != ref_sel_idx[ip])\n");
if (sel_idx[ip] != ref_sel_idx[ip])
PUT_ERR("test_idxvec.c: (sel_idx[ip] != ref_sel_idx[ip])\n");
}
xt_idxlist_delete(idxvec);
}
......@@ -609,17 +637,21 @@ int main(void) {
PUT_ERR("xt_idxlist_get_position_of_index did not return an error\n");
if (!xt_idxlist_get_position_of_index_off(idxvec, 1, &position, 0))
PUT_ERR("xt_idxlist_get_position_of_index_off did not return an error\n");
PUT_ERR("xt_idxlist_get_position_of_index_off"
" did not return an error\n");
if (!xt_idxlist_get_position_of_index_off(idxvec, 0, &position, 1))
PUT_ERR("xt_idxlist_get_position_of_index_off did not return an error\n");
PUT_ERR("xt_idxlist_get_position_of_index_off"
" did not return an error\n");
Xt_idx invalid_indices[2] = {1, 3};
int positions[2];
if (!xt_idxlist_get_positions_of_indices(idxvec, invalid_indices, 2, positions, 0))
PUT_ERR("xt_idxlist_get_position_of_indices did not return an error\n");
if (!xt_idxlist_get_positions_of_indices(idxvec, invalid_indices, 2,
positions, 0))
PUT_ERR("xt_idxlist_get_position_of_indices"
" did not return an error\n");
xt_idxlist_delete(idxvec);
}
......
......@@ -73,13 +73,14 @@ int main(void) {
int count = 0;
MPI_Datatype old_type = MPI_INT;
datatype = xt_mpi_generate_datatype(displacements, count, old_type, MPI_COMM_WORLD);
datatype = xt_mpi_generate_datatype(displacements, count, old_type,
MPI_COMM_WORLD);
if (datatype != MPI_DATATYPE_NULL)
PUT_ERR("error in xt_mpi_generate_datatype (count == 0)\n");
datatype = xt_mpi_generate_datatype_block(displacements, blocklengths, count,
old_type, MPI_COMM_WORLD);
datatype = xt_mpi_generate_datatype_block(displacements, blocklengths,
count, old_type, MPI_COMM_WORLD);
if (datatype != MPI_DATATYPE_NULL)
PUT_ERR("error in xt_mpi_generatxt_mpi_generate_datatype_blocke_datatype"
......@@ -99,15 +100,17 @@ int main(void) {
int send_data[3] = {123,234,345};
int ref_recv_data[1] = {123};
datatype = xt_mpi_generate_datatype(displacements, count, old_type, MPI_COMM_WORLD);
datatype = xt_mpi_generate_datatype(displacements, count, old_type,
MPI_COMM_WORLD);
if (test_datatype_int(datatype, count, send_data, ref_recv_data))
PUT_ERR("error in datatype generated by xt_mpi_generate_datatype\n");
MPI_Type_free(&datatype);
datatype = xt_mpi_generate_datatype_block(displacements, blocklengths, count,
old_type, MPI_COMM_WORLD);
datatype = xt_mpi_generate_datatype_block(displacements, blocklengths,
count, old_type,
MPI_COMM_WORLD);
if (test_datatype_int(datatype, count, send_data, ref_recv_data))
PUT_ERR("error in datatype generated by xt_mpi_generate_datatype_block\n");
......@@ -126,18 +129,21 @@ int main(void) {
int send_data[3] = {123,234,345};
int ref_recv_data[1] = {234};
datatype = xt_mpi_generate_datatype(displacements, count, old_type, MPI_COMM_WORLD);
datatype = xt_mpi_generate_datatype(displacements, count, old_type,
MPI_COMM_WORLD);
if (test_datatype_int(datatype, count, send_data, ref_recv_data))
PUT_ERR("error in datatype generated by xt_mpi_generate_datatype\n");
MPI_Type_free(&datatype);
datatype = xt_mpi_generate_datatype_block(displacements, blocklengths, count,
old_type, MPI_COMM_WORLD);
datatype = xt_mpi_generate_datatype_block(displacements, blocklengths,
count, old_type,
MPI_COMM_WORLD);
if (test_datatype_int(datatype, count, send_data, ref_recv_data))
PUT_ERR("error in datatype generated by xt_mpi_generate_datatype_block\n");
PUT_ERR("error in datatype generated by "
"xt_mpi_generate_datatype_block\n");
MPI_Type_free(&datatype);
......@@ -164,11 +170,13 @@ int main(void) {
MPI_Type_free(&datatype);
datatype = xt_mpi_generate_datatype_block(block_displacements, blocklengths,
block_count, old_type, MPI_COMM_WORLD);
datatype = xt_mpi_generate_datatype_block(block_displacements,
blocklengths, block_count,
old_type, MPI_COMM_WORLD);
if (test_datatype_int(datatype, element_count, send_data, ref_recv_data))
PUT_ERR("error in datatype generated by xt_mpi_generate_datatype_block\n");
PUT_ERR("error in datatype generated by "
"xt_mpi_generate_datatype_block\n");
MPI_Type_free(&datatype);
}
......@@ -194,11 +202,14 @@ int main(void) {
MPI_Type_free(&datatype);
datatype = xt_mpi_generate_datatype_block(block_displacements, blocklengths,
block_count, old_type, MPI_COMM_WORLD);
datatype = xt_mpi_generate_datatype_block(block_displacements,
blocklengths,
block_count, old_type,
MPI_COMM_WORLD);
if (test_datatype_int(datatype, element_count, send_data, ref_recv_data))
PUT_ERR("error in datatype generated by xt_mpi_generate_datatype_block\n");
PUT_ERR("error in datatype generated by "
"xt_mpi_generate_datatype_block\n");
MPI_Type_free(&datatype);
}
......@@ -226,11 +237,13 @@ int main(void) {
MPI_Type_free(&datatype);
datatype = xt_mpi_generate_datatype_block(block_displacements, blocklengths,
block_count, old_type, MPI_COMM_WORLD);
datatype = xt_mpi_generate_datatype_block(block_displacements,
blocklengths, block_count,
old_type, MPI_COMM_WORLD);
if (test_datatype_int(datatype, element_count, send_data, ref_recv_data))
PUT_ERR("error in datatype generated by xt_mpi_generate_datatype_block\n");
PUT_ERR("error in datatype generated by "
"xt_mpi_generate_datatype_block\n");
MPI_Type_free(&datatype);
}
......@@ -252,15 +265,18 @@ int main(void) {
old_type, MPI_COMM_WORLD);
if (test_datatype_int(datatype, element_count, send_data, ref_recv_data))
PUT_ERR("error in datatype generated by xt_mpi_generate_datatype\n");
PUT_ERR("error in datatype generated by "
"xt_mpi_generate_datatype\n");
MPI_Type_free(&datatype);
datatype = xt_mpi_generate_datatype_block(block_displacements, blocklengths,
block_count, old_type, MPI_COMM_WORLD);
datatype = xt_mpi_generate_datatype_block(block_displacements,
blocklengths, block_count,
old_type, MPI_COMM_WORLD);
if (test_datatype_int(datatype, element_count, send_data, ref_recv_data))
PUT_ERR("error in datatype generated by xt_mpi_generate_datatype_block\n");
PUT_ERR("error in datatype generated by "
"xt_mpi_generate_datatype_block\n");